Welcome to the Builder Academy

Question New Trigger Variable - Wait State

More
02 Jan 2016 02:49 #5552 by WhiskyTest
Ever wanted to 'stun' or force a character to stay put?
I wanted to make a falling pit trap that a player takes damage from after entering the room.
The messages come up one second after entering the room - by then the player may well have simply left!
So... I added 'wait' as below, so I could prevent said player from doing anything until after the script resolved.

usage:
nop %actor.wait(1)% // adds a 1 second wait to the character

Code:
in dg_variables.c, approximately after line 1125 where it has just handled Wisdom: snprintf(str, slen, "%d", GET_WIS(c)); } + else if (!str_cmp(field, "wait")) + { + if (subfield && *subfield) + { + int addition = atoi(subfield); + WAIT_STATE(c, addition * ( PULSE_VIOLENCE / 2) ); // by default violence is 2 seconds + } + snprintf(str, slen, "%d", GET_WAIT_STATE(c)); + } break; } /* switch *field */
The following user(s) said Thank You: thomas, Valkin

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

More
06 Feb 2016 22:57 #5578 by krell
That's pretty cool and I think it makes sense mechanics-wise.

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

More
07 Feb 2016 06:36 #5580 by Rumble
Well done. This has come up numerous times in trigger discussions but you are the first to post a solution. I will add it.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

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

More
08 Feb 2016 23:09 #5585 by WhiskyTest
Nice, glad it was helpful! :)

It would be worth changing ( PULSE_VIOLENCE / 2) to ( RL_SEC )
I couldn't think of the definition name at the time

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

Time to create page: 0.191 seconds