Welcome to the Builder Academy

Question Ask Triggers for multiple mobs in one room

More
31 Jan 2020 22:15 #8529 by thomas
Yes, the important thing here is:

they need return 0 for everything else to allow other triggers in the room to interact

If a script does not return 0, it is considered to have handled the inquiry - others won't get checked. If it returns 0, it is considered to be "not applicable" and next trigger is checked.

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

More
01 Feb 2020 01:53 - 01 Feb 2020 05:42 #8531 by krell

Fizban wrote: The scripts don't need to be combined, the if checks just need to be selective enough to only trigger for things meant to trigger their speech, and they need return 0 for everything else to allow other triggers in the room to interact with any command that doesn't trigger the first script, etc.


Man, why couldn't I have seen this hours ago?!? As it is, this is the script I managed to come up with for my previously mentioned test mobs that seems to work. You have no idea what complicated mess I was working on before I scrapped the whole thing, twice....
Code:
* * Mulitple Mobs Ask Trigger * context %self.id% mobile_1 edgar mobile_2 jess * * if %cmd.mudcommand% == ask && %arg% if %self.name% /= %arg.car% say %actor.name% is the greatest! say My name is %self.name%! elseif edgar /= %arg.car% && edgar != %self.name.car% return 0 elseif jess /= %arg.car% && jess != %self.name.car% return 0 elseif %arg.car% && %arg.car% != %self.name.car% return 0 end elseif %cmd.mudcommand% == ask && !%arg% return 0 else return 0 end

I was going to share earlier, but I didn't have a chance to test it until after work so I didn't know if it would work or not. Besides, I had some bugs I had to work out due to the odd misype. Also, I can't seem to get strings assigned to variables to work properly. Maybe someone can help with that?

Addendum:

I've already reduced it down to the following:
Code:
* * Mulitple Mobs Ask Trigger * * if %cmd.mudcommand% == ask && %arg% if %self.name.car% /= %arg.car% say %actor.name% is the greatest! say My name is %self.name%! elseif %self.name.car% != %arg.car% return 0 end else return 0 end
Last edit: 01 Feb 2020 05:42 by krell. Reason: Improvment and modification to shared script

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

Time to create page: 0.181 seconds