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
Lain
Novice


Joined: 26 Oct 2001
Posts: 38

PostPosted: Wed Apr 30, 2003 11:40 pm   

Health messages
 
How could I check if @hp is below a percentage of @maxhp but above a percentage of @maxhp?

I'm trying to send a message to the window if my health gets relatively low, and another message if it gets extremely low.

If I just use @maxhp/2 then the first message will be sent regardless of whether it is below the amount for the second message. I looked through and tried some expressions but I couldn't work out "lower then but higher then".

Pattern: Hp~: (&hp) ~((&maxhp)~) Gp~: (&gp) ~((&maxgp)~) Xp: (&xp)

Lain
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu May 01, 2003 4:13 am   
 
Change the thresholds, but this concept would work:

#IF (%eval(@Hp*100/@HpMax) < 50) {#SH HEALTH %if(%eval(@Hp*100/@HpMax) < 30,LOW,EXTREMELY LOW)}

Ton Diening
Reply with quote
Lain
Novice


Joined: 26 Oct 2001
Posts: 38

PostPosted: Thu May 01, 2003 7:23 am   
 
Thank you Ton,

It seems I had to swap the 'low, extremely low' around, aside from that it does exactly what I was looking for.

Lain
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