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
Smeff
Newbie


Joined: 17 Mar 2006
Posts: 9

PostPosted: Fri Mar 17, 2006 4:37 pm   

#cond question
 
I'm having a bit of a problem with #cond in my healing scripts in Imperian.

Code:
#trigger {You quickly eat} {#cond {H:* M:* E:* W:*} {#if (@eating="orphine") {stupid=0;agrophobia=0;claustrophobia=0;vertigo=0;masochism=0}}}


I continue the code on for all the other herbs.. but it doesn't seem to want to fire.

Quote:

H:250 M:250 E:1200 W:1200
You quickly eat an orphine seed.
H:250 M:250 E:1200 W:1200


An example of what you would see (This would be at the bottom of the screen)

I've also noticed that the status bar, with hp, mana, etc (At the bottom of the screen) does not register as a trigger until another echo comes into the screen from the game, so the status is recorded and scrolled up... Perhaps this is part of the problem with the #cond not firing? Is there any way to figure this out?
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: Fri Mar 17, 2006 5:16 pm   
 
The #COND doesn't go inside the trigger body. It's a separate command of its own, issued after the #TRIG. So the code you've written above won't work. Try something like:
Code:
#TR {You quickly eat} {#NOOP - If you need to do something on this line, put it here}
#COND {H:* M:* E:* W:*} {#if (@eating="orphine") {stupid=0;agrophobia=0;claustrophobia=0;vertigo=0;masochism=0}}

Check out the description of sequential patterns in the Advanced zMUD Triggers Guide.
_________________
Come visit Mozart Mud...and tell an imm that Aerith sent you!
Reply with quote
Smeff
Newbie


Joined: 17 Mar 2006
Posts: 9

PostPosted: Fri Mar 17, 2006 5:32 pm   
 
Hmm.. So in

Code:
#TR {You quickly eat}


I put {#NOOP}? Or do I place an alias or something else into it? And where do I put the #cond, if it doesn't go into the trigger?

Quite confusing, the link you sent.. If "You quickly eat" fires, wouldn't it look right away for the status bar? Or is it just the way I entered it?
Reply with quote
JQuilici
Adept


Joined: 21 Sep 2005
Posts: 250
Location: Austin, TX

PostPosted: Fri Mar 17, 2006 6:42 pm   
 
Ok...one thing at a time.
  • No, the #NOOP is simply a way for me to put in a comment. It doesn't do any action. That was a short way of saying, "If you need to do an action immediately upon receiving the 'You quickly eat' message from the MUD, this is the place to put that command."
  • The #COND goes exactly where I showed it. It's a separate command AFTER the #TR command, and adds a second state to the trigger. To be painfully explicit, there are two lines in my code above. One starts with #TR, the second starts with #COND (try making your browser window as wide as possible to avoid line-wraps inside the code block to see what I mean).
    Here's another example, that won't wrap. Get a completely clean window by hitting Esc at the character window, then cut and paste the following two lines into the command-line:
    Code:
    #TR {trig} {#SAY State 1 fired}
    #COND {cond} {#SAY State 2 fired}

    The first line creates a trigger on 'trig' with a #say action, and the second ADDS A SECOND STATE to that tigger, which catches 'cond' and also has a #say action. Let me say again - there is only ONE trigger, but it has TWO states.
    After entering the above, you can type 'cond' all you want, and nothing will happen, because the trigger is in the first state (waiting for 'trig'). If you type 'trig', you'll get the 'State 1 fired' message, and the trigger will change state. Now, you can type 'trig' all you want, and nothing will happen, because the trigger is in the second state (waiting for 'cond'). When you type 'cond', you'll see the 'State 2 fired' message, and the trigger will return to its orginal state.
  • This is pretty much what the link I posted said, too, but with a different example.
  • The code you originally posted looked like you were trying to do a multistate trigger which would (a) catch 'You quickly eat', then (b) wait until you got that status-info-looking-thing, then (c) reset your vars to zero if you had eaten 'orphine'. As posted, your code doesn't work because the syntax is wrong - you don't put the #COND inside the action block of the #TRIG, you put it afterward (like in my example).

If this is still confusing, let's work on the simple 2-state trigger I posted in THIS post, and ask away.
_________________
Come visit Mozart Mud...and tell an imm that Aerith sent you!
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Mar 17, 2006 9:18 pm   
 
You'll want to modify the parameters on the second state to ensure that it fires on a prompt and that it fires only if it's the very next line after the eating. As it is coded now, your failsafe will reset your afflictions every time you eat the herb.

Code:
#TR {You quickly eat} {}
#COND {H:* M:* E:* W:*} {#if (@eating="orphine") {stupid=0;agrophobia=0;claustrophobia=0;vertigo=0;masochism=0}} {nocr|prompt|within|param=1}
Reply with quote
Smeff
Newbie


Joined: 17 Mar 2006
Posts: 9

PostPosted: Sat Mar 18, 2006 6:05 am   
 
I've updated it so far...

Code:
#alias condcheck_herb {Lots and lots of #if (@eating="blah") statements to check to see what's being eaten and reset}
#TR {You quickly eat} {#NOOP}
#COND {H:* M:* E:* W:*} {?}


I understand this cond thing, so far.. Just need to tag that extra little bit of parameters at the end and decide whether I should put condcheck_herb into the spot there.

Also, how would I go into putting the parameters into the coding? Should I do it through the states tab?

EDIT: I think I figured it out.. Thank you for the help, I'll keep testing it all out! You guys rule!

EDIT AGAIN: Meh. Playing with stuff, and it's not working correctly >< Messing with the things on the options button of the trigger...

EDIT AGAIN: Fixed it up.. It's working great out of #echo testing.. I'll have to play on the game tomorrow to see if it works! I can't wait to try! Thanks for all the help!!
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