Welcome to the Builder Academy

Question trigger question -- alarm if fighting

More
17 Nov 2016 01:02 #6273 by Banlock
First time I'm trying to build a trigger, so I'd like to see if I'm on the right track ...

I'd like to have a bar where if a fight breaks out the barkeep says, "No fighting!" -- but just once. Like in episode IV when the bartender says "No Blasters!" :-)

I'm thinking that every mob that is usually at the bar would need to have a trigger (maybe if strangers fight, he doesn't care) that would:

Trigger on mob being in a fight
make sure global of already_alarmed is not set
make sure mob is in the bar
make sure that bartender is present
force bartender to say speech
set global of already_alarmed

Am i on the right track here? What would be the least resource-intensive way to unset the global?

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

More
17 Nov 2016 22:07 #6276 by thomas
Well, this is an interesting idea. I'd probably give the bartender an ACTION type trigger, triggering on *, with NArg 1.
Such a trigger will fire on any input, particularly fight messages.

So, when the trigger fires, we need to determine if the one triggering the script is fighting (after all, other messages trigger an action trigger as well - like enter and leave).
This can be checked with "if %actor.fighting%". If that is the case, just "say No fighting!" - no need to force a mob to do something itself.
Now, to prevent the trigger from being triggered over and over again, you can simply add a sleep time after saying the sentence. A trigger that is already running will not be started again.
The last thing to do is to add an end to the if statement.

So you'll end up with someting like this:
Code:
if %actor.fighting% say No fighting! wait 120 s end
The following user(s) said Thank You: Banlock

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

More
17 Nov 2016 23:06 #6278 by WhiskyTest
additionally it should be:
"No fighting! No fighting!"
Then he dives for cover behind the bar..

;)
The following user(s) said Thank You: Banlock

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

More
19 Nov 2016 14:32 #6280 by Banlock
Thanks, that keeps things simple.

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

More
18 Dec 2016 20:38 #6412 by Parnassus
Wouldn't it be easier to toss the fighter from the bar and then sleep for a shorter time? That should automatically stop the fight and the short sleep should make it possible for anybody fighting that original person to stop. If the fight doesn't stop, the next fight message will set off the trigger again allowing the bartender to toss the next fighter out.

A zone that I wrote for Smaug has a pacifist mob that tries to disarm anyone that picks a fight with him. If he manages to disarm, he grabs the weapon and teleports out for a second or so, just to break up the fight. He then heals back to 100% and teleports back before the player can see that he's gone (although the player's screen says something about the target being missing). The mob then gives the weapon back to the player and suggests he leave. This was in response to someone who asked why the Paladin class in Smaug had access to disarm which doesn't sound like honorable behavior for a Paladin.

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

Time to create page: 0.186 seconds