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


Joined: 06 Sep 2006
Posts: 10

PostPosted: Wed Sep 06, 2006 4:14 pm   

Trigger setup
 
Right now I'm using a few triggers for my hp bar, with a power that goes off and on under certain conditions, but my issue is that it will try to turn off every round of combat, or on, depending on if the condition is met. I would like for it to only execute once each time. Any help would be greatly appreciated.

Here is what I currently have:

HP bar-

HP:[1336/1336] SP:[132/132] ST:[100.00%] PP:[100.00%] E:[] N PA
HP~:~[&hpcur~/&hpmax~] SP~:~[&spcur~/&spmax~] ST~:~[&{stam}~%~] PP~:~[&{prot}~%~] E~:~[*~] &STATE &STATE2

Values:

#IF (@stam < @prot) {power off}
#IF (@stam > @prot) {power on}

I'm really quite a novice at this. In case it will help, STATE1 here is always present, and has no connection to the rest of the hp bar. STATE2 shows what abilities I currently have activated. So when the power in question here is on, I see a V (in the hp bar used above it would be PAV when active) but the A could be off, or even the P. Regardless of which number of powers are on the the V will always be at the end :P Ok, hopefully that all made sense. Thanks!

Nathan
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Wed Sep 06, 2006 4:39 pm   
 
The simplest way is to introduce another variable that keeps track of whether it's on or off.

Change your #IF's to the following.
Code:

#IF (@stam < @prot && power == 1) {power off; #VAR Power 0}
#IF (@stam > @prot && power == 0) {power on; #VAR Power 1}
_________________
Asati di tempari!
Reply with quote
nduval
Beginner


Joined: 06 Sep 2006
Posts: 10

PostPosted: Wed Sep 06, 2006 4:49 pm   
 
Wow, that was much easier than I had expected. Thanks so much! That will help a lot with other stuff too =)
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