Welcome to the Builder Academy

Question Trigger Timing

More
22 Jul 2015 23:21 #5449 by Parnassus
Replied by Parnassus on topic Trigger Timing
I think its possible to %force% a prompt on or off but that seems invasive to me. Also, I think prompt is a toggle so I'd hate to turn it on instead of off. It's actually one of the things that I was considering.

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

More
24 Jul 2015 12:23 #5452 by thomas
Replied by thomas on topic Trigger Timing
I think I need to clear up a few misunderstandings here.

The parser for DG is actually very fast. The reason for needing a wait on a TRIGEDIT-ROOM-ENTER trigger is that the actual triggering happens BEFORE the player is moved into the room. The reasoning behind this is that the room enter trigger can prevent the move (by returning 0). This would not be possible if the trigger triggered after the move. This means that you need a "wait 1 s" statement so that the move can take place, then you can send to the char[1].

Using a common trigger for all your dialogue, you're running into a different - but related - problem. Some types of triggers cannot trigger if they're already running (to prevent infinite recursion). Adding a short wait statement solves this[1], in that waits allow other scripts to run, and so means the mud won't actually hang even if multiple scripts trigger each other.

There are some ways around your problem, the first being the simplest: Don't trigger multiple triggers off of each other. Instead, use the available "behind the scenes" data to make it plausible. Here's a pseudocode example:
Code:
# find my co-actor set inroom %actor.room.people% while %inroom% if %inroom.vnum% == 1234 set coactor %inroom% end set inroom %inroom.next_in_room% end if !%coactor% say Oh my god, they killed Kenny! halt end say Kenny, you ok? %force% %coactor% say Mmmf! say At one point Kenny even polymorphed the guy into a blue frog...it was total carnage. %force% %coactor% say Mmmf! ...
This will accomplish what you want, and still prevent a dead guy from speaking.


[1] The current code for "wait" allows three documented forms, "wait until hh[:]mm", "wait X s" and "wait X t", the last being X mud hours. A fourth option would be nice, to avoid the long wait on room entry. Something along the lines of "wait X c" (for cycles), of which there are 20 a second.
This already works, and is an undocumented feature.
The following user(s) said Thank You: Parnassus

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

More
25 Jul 2015 03:01 #5456 by Parnassus
Replied by Parnassus on topic Trigger Timing
Thanks for the explanation and the pseudocode.

thomas wrote: [1] The current code for "wait" allows three documented forms, "wait until hh[:]mm", "wait X s" and "wait X t", the last being X mud hours. A fourth option would be nice, to avoid the long wait on room entry. Something along the lines of "wait X c" (for cycles), of which there are 20 a second.
This already works, and is an undocumented feature.


Sorry, this confused me. Would it be nice or does it already work? I don't think I've heard of the t for mud hours so that's interesting to me also.

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

More
25 Jul 2015 09:05 #5457 by thomas
Replied by thomas on topic Trigger Timing
it works already.

Actually all forms of "wait x y" where y != t and y != s means "wait x cycles" due to the way it is implemented.
But, let's stick with "wait x c" so we don't break it in the future ;)

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

Time to create page: 0.212 seconds