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
dragonheart
Beginner


Joined: 09 Jun 2002
Posts: 15
Location: Norway

PostPosted: Sat Feb 07, 2004 10:19 pm   

IF and conditional status
 
Hello.
I've got stuck in a little problem I've got when fighting. I do too many things without actually being able to. Which ends up with me doing all kinds of good commands without a single result in a fight because I tend to lose out on information.
One of the things that are crucial to me is equilibrium. I've got a nice little thing setting a variable called statequilibrium true or false, so so far so good. But now for the bigger problem. I would like to check if I'm allowed to do a command by checking this status first!
Here's an example of what I mean:

#IF (@statequilibrium=1) {
get arrow from quiver
nock arrow on bow
shoot arrow at target
}
{If I don't have equilibrium, I would like to wait until I get it and then do the arrowstuff}

It's that last part I can't handle.
Can you help me on this please?
I don't know how to fix this...

PS.
The statequilibrium status changes when I actually have equilibrium, so a prerequisite we can use is that this status is either 1 or 0 when we need to check anything...

Best regards
Dragonheart
Reply with quote
musishun00
Wanderer


Joined: 16 Dec 2003
Posts: 77
Location: USA

PostPosted: Sat Feb 07, 2004 10:38 pm   
 
What I'd do is have a seperate variable for waiting to nock the arrow. Try this:

#ALIAS sh {
#IF (@statequilibrium=1) {
get arrow from quiver
nock arrow on bow
shoot arrow at %1
#VAR arrow_state 0} {
#VAR arrow_state 1
#VAR target %1}}

#ALIAS sh2 {
get arrow from quiver
nock arrow on bow
shoot arrow at @target}

#TRIGGER {You now have equilibrium.} {
#VAR stateequilibrium 1
#IF (@arrow_state=1) {
sh2} {}}

I think that should work for you. Give it a shot, and if something messes up, I'll try again. Smile
Reply with quote
dragonheart
Beginner


Joined: 09 Jun 2002
Posts: 15
Location: Norway

PostPosted: Sat Feb 07, 2004 11:40 pm   
 
Yes and no...
I like it that you check for equilibrium in a trigger,- but the problem is that I don't always want to shoot arrows at everything each time I get equilibrium.
In the MUD I play equilibrium and balance are essentials for actions,- so I can't trigger an action to getting equilibrium on it's own. Unless of course all I want to do is to shoot arrows :-)

Any other suggestion? Isn't there any way for me to wait for a condition to change in a variable, (in this case @statequilibrium) and then do an action?

Thanks again
Dragonheart
Reply with quote
Valint
Wanderer


Joined: 12 Nov 2003
Posts: 70
Location: USA

PostPosted: Sat Feb 07, 2004 11:42 pm   
 
If you have other triggers which change the statequilibrium variable as needed, you could use a #TEMP trigger, e.g.:

#ALIAS sh {#IF (@statequilibrium) {get arrow from quiver;nock arrow on bow;shoot arrow at %-1} {#SAY Waiting until you have equilibrium...;#TEMP {(@statequilibrium)} {get arrow from quiver;nock arrow on bow;shoot arrow at %-1} {} {exp}}}
Reply with quote
musishun00
Wanderer


Joined: 16 Dec 2003
Posts: 77
Location: USA

PostPosted: Sun Feb 08, 2004 12:44 am   
 
Oh. I hadn't thought about #TEMP triggers. I don't use them much... and by much I mean that I haven't used them at all yet. :P
Reply with quote
dragonheart
Beginner


Joined: 09 Jun 2002
Posts: 15
Location: Norway

PostPosted: Sun Feb 08, 2004 11:44 am   
 
Thanks folks...
Good suggestions and the one from Valint works the way I wanted it too...

When I tested it, I found out that my old trustworthy equilibrium trigger has something odd to it as well, so I need to finetune that. But the solution will now save me from losing due to not having the patience to wait :-)

One last question: What does the {exp} at the end?

Thank you very much

Dragonheart
Reply with quote
priit
Beginner


Joined: 03 Feb 2004
Posts: 29
Location: Estonia

PostPosted: Mon Feb 09, 2004 9:51 am   
 
quote:
Originally posted by dragonheart

Yes and no...
I like it that you check for equilibrium in a trigger,- but the problem is that I don't always want to shoot arrows at everything each time I get equilibrium.


well... you could add then one variable to determine if you want or not to shoot arrows when you hit equilibrium. and maybe add a key to toggle the status.

#VAR wantshoot {0} {0}
#KEY KEY0 {#IF (@wantshoot=1) {#VAR wantshoot 0;#SHOW {* SHOOTING MODE OFF *}} {#VAR wantshoot 1;#SHOW {* SHOOTING MODE ON *}}}

#TRIGGER {You now have equilibrium.} {#VAR stateequilibrium 1;#IF (@wantshoot=1) {get arrow from quiver;nock arrow on bow;shoot arrow at target}}
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