Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
funjuse
Beginner


Joined: 19 Feb 2001
Posts: 20

PostPosted: Sun Nov 25, 2001 12:58 am   

Smart Triggers
 
i want to make a trigger action based on a success/roll
ex:
>palm denar
[Success: 61, Roll: 65] You nearly drop a silver denar before palming it. You
aren't sure if anyone saw you.
(wait for the no longer busy
You are no longer busy.
>unpalm denar
You flip your wrist, and cause a silver denar to reappear in your hand.
>palm denar
[Success: 61, Roll: 46] You can't quite manage to palm a silver denar.
(wait for the no longer busy)
You are no longer busy.

>palm denar

if you need more of an example let me know...but please help me out, its very confusing figuring out.
Reply with quote
decantor
Apprentice


Joined: 14 Nov 2001
Posts: 100

PostPosted: Sun Nov 25, 2001 8:23 am   
 
#trigger {You are no longer busy.} {do_action}

#trigger { You nearly drop a silver denar before palming it. } {#alias do_action {unpalm denar}}

#trigger {You flip your wrist, and cause a silver denar to reappear in your hand.} {#alias do_action {palm denar}}

When you want to stop:
#alias do_action ""
Reply with quote
funjuse
Beginner


Joined: 19 Feb 2001
Posts: 20

PostPosted: Sun Nov 25, 2001 8:47 am   
 
you mis-understood, the message varies whether or not the roll > success that means the action is completed. im trying to unpalm denar if action succeeds and palm denar again if action fails.

someone had helped me with this before but the topic is lost. it looked along the lines of ~[Success: %d, Roll: %d] with various ~'s everywhere. i forget how it went
Reply with quote
decantor
Apprentice


Joined: 14 Nov 2001
Posts: 100

PostPosted: Sun Nov 25, 2001 9:37 am   
 
#trigger {You are no longer busy.} {do_action}

#trigger {[Success: (%d), Roll: (%d)]} {#var success %1;#var roll %2;check_success}

#alias check_success
{
#math success_check {@success - @roll}
#IF (@success_check >= 0) {#var do_action {unpalm denar}}
}

#trigger { You nearly drop a silver denar before palming it. } {#alias do_action {palm denar}}

When you want to stop:
#alias do_action ""
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Nov 25, 2001 11:49 pm   
 
quote:

#trigger {~[Success: (%d), Roll: (%d)~]} {#var success %1;#var roll %2;check_success}



That should do it, but if it still messes up on you then perhaps ~ the comma and the two colons. Both are either special characters that ZMud uses or something ZMud normally uses to delimit strings. I don't think they're problematic in this case, though.


li'l shmoe of Dragon's Gate MUD
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Nov 26, 2001 7:36 pm   
 
It appears from your transcript that "unpalm" doesn't have a lag, so why not just do it automatically? Sure, you'll probably get a lot of unneeded unpalms, but so what?

#TR {You are no longer busy} {unpalm denar;palm denar}

LightBulb
Reply with quote
funjuse
Beginner


Joined: 19 Feb 2001
Posts: 20

PostPosted: Mon Nov 26, 2001 11:05 pm   
 
because the game masters they see that and they get angry....and delete your character

lightbulb...you had rigged me something up earlier but somehow the post got removed or past the ages??? ill have to write it down this time or study it and learn how to do it myself.

If the success is lower then the roll i want it to wait for the no longer busy and then however many ms i choose(so that the game will register it) then i want it to unpalm or if the roll is lower then the success then i want it to palm over again. I will make a separate trigger off of "you flip your wrist etc." that will re-palm, im just not good with the > = < stuff that decides if it happened or not(my programming knowledge only extends to basic c++)
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Tue Nov 27, 2001 1:36 am   
 


#TR {~[Success: (%d), Roll: (%d)~]} {
#IF (%2 < %1)
{#WAIT someseconds ; palm denar}
{#TEMP {you are no longer busy} {#WAIT someseconds ; unpalm denar; palm denar}
}
}

I dont see that you need aliases and #MATHs and stuff...just do it from the trigger itself.

Oh, and if you upgrade to version 6.22 (or the next version when it comes out, which will be pretty stable) you could do it all in a single trigger, without using the #TEMP thingy.

Caled
Reply with quote
funjuse
Beginner


Joined: 19 Feb 2001
Posts: 20

PostPosted: Wed Nov 28, 2001 1:07 am   
 
i got it figured out with caled's base. Thanks man, now i got it working with..

#TR {~[Success: (%d), Roll: (%d)~]}
#TEMP {you are no longer busy} {
#WAIT %random( 600, 1200)
#IF (%2 < %1) {
@palming = "palm denar"
}
#IF (%2 > %1) {
@palming = "unpalm denar"
}
@palming
}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Nov 28, 2001 1:48 am   
 
Oops, you didn't define %2 = %1. You really should change one of those #IF's to include it. I don't know if that would be a good roll or a bad one, so I can't tell you which.

LightBulb
Reply with quote
funjuse
Beginner


Joined: 19 Feb 2001
Posts: 20

PostPosted: Thu Nov 29, 2001 10:03 pm   
 
yeah i did that after it stopped working when they exactly matched...i added a new if statement thanks for your help anyway though lightbulb :)
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: Fri Nov 30, 2001 5:00 am   
 
Actually, you could reduce the amount of coding needed by using the "else" part of the #IF.


#IF (%2 < %1) {@palming = "palm denar"} {@palming = "unpalm denar"}

Not that it really matters, but if it was a really large script, you'd want to do something like this to increase the speed. And it -is- much simpler.

Caled
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net