Welcome to the Builder Academy

Question Could use some trigger help

More
30 Apr 2018 21:38 #8013 by krell
Replied by krell on topic Could use some trigger help
This is probably a stupid question, but you are testing the trigger with a mortal character, right?

Please Log in or Create an account to join the conversation.

More
30 Apr 2018 21:41 #8014 by JTP
Replied by JTP on topic Could use some trigger help
Yep :)

Please Log in or Create an account to join the conversation.

More
01 May 2018 02:00 #8015 by krell
Replied by krell on topic Could use some trigger help
Okay, give the below a try. I had to use "%door% <room vnum> <dir> flags <a|b|c|d>" to make this work. Simply using 'open stone' didn't work. See HELP %DOOR% for details. I'm confident you'll be able to take this snippet and adapt it to your needs. :)

Code:
Name: 'Stone Door Command', VNum: [60095], RNum: [ 1457] Trigger Intended Assignment: Rooms Trigger Type: Command , Numeric Arg: 100, Arg list: * Commands: if %cmd% == push && door /= %arg% %door% 60099 north flags a %send% %actor% Okay %echoaround% %actor% %actor.name% opens stone. elseif %cmd% == push && stone /= %arg% %door% 60099 north flags a %send% %actor% Okay %echoaround% %actor% %actor.name% opens stone. elseif %cmd.mudcommand% == open && door /= %arg% %echo% Nope! elseif %cmd.mudcommand% == open && stone /= %arg% %echo% Nope! else return 0 end

Please Log in or Create an account to join the conversation.

More
01 May 2018 12:42 - 01 May 2018 12:43 #8017 by JTP
Replied by JTP on topic Could use some trigger help
Boiled it down to:
Code:
Name: 'dont allow open', VNum: [10544], RNum: [ 1468] Trigger Intended Assignment: Rooms Trigger Type: Command , Numeric Arg: 100, Arg list: * Commands: if %cmd% == push && stone /= %arg% %door% 14700 east flags a %send% %actor% You push the stone and open a passage to the east. %echoaround% %actor% %actor.name% push the stone and open a passage to the east. elseif %cmd.mudcommand% == open && stone /= %arg% %echo% You can't open that. else return 0 end


I get the right message if i type open door...i also get the right message when i type push stone..

BUT

exit is still closed hmmmm :/
Last edit: 01 May 2018 12:43 by JTP.

Please Log in or Create an account to join the conversation.

More
01 May 2018 12:55 #8018 by JTP
Replied by JTP on topic Could use some trigger help
Ok now it works, i had typed the room vnum i was going to, had to write the vnum the trigger is in...


Ok next step...first time i type push stone..it opens.

How can i make it so that the second time i type push stone, it close it again..

Need some way to tell if the exit is open or closed...Hope you understand what i mean.

Please Log in or Create an account to join the conversation.

More
01 May 2018 13:59 #8019 by krell
Replied by krell on topic Could use some trigger help
Use a global or a remote variable and use it as a flag. The state of the flag can be used to toggle the script between opening or closing the exit when you use the "push" command. Here's one of my own scripts using a global as a flag. The important thing to remember is to set your flag to 1 or 0 depending on the last state of the door. For example, if the door is open set your flag to 1, then if your door is closed set your flag to 0. HELP GLOBAL or HELP REMOTE for more details.

Code:
Trigger Intended Assignment: Objects Trigger Type: Random , Numeric Arg: 100, Arg list: None Commands: context %self.id% if %weather.sunlight% == 3 && !%park_light_on_zone600% set park_light_on_zone600 1 global park_light_on_zone600 %echo% %self.shortdesc% on the side of the path flickers momentarily as its LED matrix comes to life. elseif %weather.sunlight% == 1 && %park_light_on_zone600% set park_light_on_zone600 0 global park_light_on_zone600 %echo% %self.shortdesc% on the side of the path dims as its LED matrix slowly winks out. elseif %weather.sunlight% == 1 && %park_light_on_zone600% != 0 set park_light_on_zone600 0 global park_light_on_zone600 elseif %weather.sunlight% == 3 && %park_light_on_zone600% != 1 set park_light_on_zone600 1 global park_light_on_zone600 end

Using a flag as a toggle in my code above is probably not really necessary, but I was paranoid about things not working or firing repeatedly instead of only once.

Please Log in or Create an account to join the conversation.

Time to create page: 0.191 seconds