|
WereAllMonkeys Newbie
Joined: 10 Dec 2003 Posts: 5 Location: USA
|
Posted: Tue Feb 03, 2004 12:55 am
Two questions about triggers. |
How can I delay the action of the trigger for a specific amount of time after it parses the text and before it does its thing?
How can I get one trigger to cycle through many things, example:
"Oh NO! Dreambo has been killed by Zorkon!" displays on the screen,
I would like to have the trigger cycle through, 'comfort Dreambo'
'Shout Way to go Zorkon' 'goss better luck next time' etc doing just one of them, and on the next death do the next one, or randomly select one of the actions. I know the intial set up of pattern, and value and the variable. But I don't see how to get it to respond with different values, or cycle through a set of them.
TIA
John |
|
|
|
Serentus Apprentice
Joined: 28 Sep 2001 Posts: 103 Location: USA
|
Posted: Tue Feb 03, 2004 6:19 am |
Try one of these
for random:
#TRIGGER {Oh NO! (%w) has been killed by (%w)!} {#IF (%random(1)) {comfort %1} {Shout Way to go %2}}
or for cycle:
#TRIGGER {Oh NO! (%w) has been killed by (%w)!} {#IF (@choice=1) {comfort;@choice=0} {shout;@choice=1}} |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Feb 03, 2004 7:23 pm |
For several choices, #CASE is probably better than #IF.
It's up to you whether to use a random choice or cycle through all the choices, you can't do both. Random choices are made using the %random predefined variable (or the %random() function) as the index of the #CASE command. Cycling is done by using a variable as the index and adding 1 to it every time.
The action can be delayed with the #ALARM command.
#TR {Oh NO! (%w) has been killed by (%w)} {#ALA +5 {#CASE %random {comfort %1} {shout Way to go %2} {goss better luck next time}}} |
|
|
|
WereAllMonkeys Newbie
Joined: 10 Dec 2003 Posts: 5 Location: USA
|
Posted: Thu Feb 05, 2004 8:44 pm |
Thanks so much for the help, I have got it working quite well now.
I thought I would mention for others like me, that are new to Zmud
this bit of info, when using zmud (gui) to make the above things work you would click trigger, then new, and put this in the Pattern line; Oh NO! (%1) has been killed by (%2) (You will need to of course edit this for your exact death notice).
Then in the Value section put this in; #ALA +5 {#CASE %random {comfort %1} {shout Way to go %2} {goss better luck next time}}
This will delay the output for 5 seconds and randomly choose one of them to send out.
I could not get the choice to work so I could cycle through them which is what I would prefer to do. What do I need to do to cycle through the choices? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Feb 05, 2004 10:51 pm |
I would also mention that while %1 and %2 will (currently) work in the pattern, they are NOT documented and are STRONGLY discouraged. The preferred wildcards are those listed in zMUD's help under the topic Pattern Matching. You'll note that they include the %w wildcard which both I and Serentus used but not the %1 and %2 which you replaced them with.
It's especially important to provide people who are new to zMUD with the correct syntax. Bad habits are easy to form and hard to break. |
|
|
|
Glinka Wanderer
Joined: 20 Dec 2000 Posts: 53 Location: USA
|
Posted: Fri Feb 06, 2004 2:41 am |
You can use a variable to cycle thru
your choices...make a varible like ..
@sympathy
then for your trigger's value..
#add sympathy (1)
#if (@sympathy>3) {sympathy=1}
#ALA +5 {#CASE @sympathy {comfort %1} {shout Way to go %2} {goss better luck next time}}
Hope this helps,
Glink |
|
|
|
|
|