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


Joined: 17 Oct 2008
Posts: 2

PostPosted: Fri Oct 17, 2008 7:19 pm   

Need help with a little code...
 
Okey, it's probably extremely easy to create, but I simply don't know how.. I think I understand how it SHOULD be, but I can't get it out right.. So here is what I want:

I want my code to "warn" me when my Hitpoints is going LOWER than a certain amount of Hitpoints.

So what I understand is, that I should use variables, and use some sort of IF %hp < %number... or something like that..

Please help me, if anyone understands what I am looking for.. =)

It looks like this in the game, if it will help: 2519H 380M 742E 113630G 6458M

H being Hitpoints
M being Mana
E being Endurance
G being Gold
M being Morale

Thank you for any help...

/Intrepedian
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Oct 17, 2008 8:50 pm   
 
#TRIGGER {(%d)H %dM %dE %dG %dM} {#IF (%1<500 AND !@alreadywarned) {#SAY WARNING WARNING WARNING! You are close to death!;alreadywarned=1};#IF (%1>499) {alreadywarned=0}}

Just a basic trigger. *shrug* It'll also prevent unnecessary spam from having your hitpoints show up on the screen every round of combat. If you don't mind the spam, by all means, remove the alreadywarned parts.

Charneus
Reply with quote
Intrepedian
Newbie


Joined: 17 Oct 2008
Posts: 2

PostPosted: Fri Oct 17, 2008 9:27 pm   
 
Thank you so much!

That's exactly what I wanted... That's so perfect!

Thank you again Charneus!

/Intrepedian
Reply with quote
Rappy
Wanderer


Joined: 15 Jul 2005
Posts: 96

PostPosted: Fri Oct 17, 2008 11:17 pm   
 
You could also look into setting up a button as a gauge to visually tell when you are getting low on health/mana/movement. The gauge settings have a LOW parameter. So you could do something like this...

Code:
#BUTTON "Health gauge" {Health: @hp/@maxhp (%format(2,%eval(%float(@hp,2)/@maxhp*100))%)} {} {} {} {@hp} {} {HEART} {Size} {255} {15} {Pos} {0} {0} {32832} {} {Gauge||4|@maxhp|@maxhp/4|7} {} "" {} {Health: @hp/@maxhp} {}


All of which are easily edited once you enter in the code in the edit box, just right-click the button that shows up

To explain what those parts are in more detail... "Health gauge" is the name of the button, you can use that to #UNBUTTON it, the next part is what is SHOWN on the actual gauge itself, which would be

Health: 130/208 (62.50%) (for example)

@hp is the value setting and HEART is the icon I choose for it.

The next 6 values are for Size and Pos, which you can edit later, this places it directly underneath your edit box in top/left of that area.

The last two spots are for the Gauge settings and Tooltip.

For an example of how this looks from my own zMUD screen, look at http://members.cox.net/routed/my%20zMUD.png

Using charneus' trigger you can change the trigger to actually update your @hp @maxhp, etc variables automatically.

Send me a message here, or e-mail me if you want help with any of this, and I can do what I can to help you out =)

-Rappy
_________________
Windows 11 Pro,
cMUD 3.34
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Fri Oct 17, 2008 11:45 pm   
 
While these are both excellent solutions, I would remind you that if you're triggering off your prompt for something like this, where it is important to know "RIGHT FRIGGIN NOW SO I DON'T DIE!!!" you should change your trigger to fire off prompt instead of newline. These settings are under the options tab when you're viewing the trigger in the settings editor. This is how I had my dispell trigger setup on the MUD I used to play, where you had say 9,000hps, and with a good spellup could take on a mob with 18k damroll and only take 1700-2000 damage hits... yet if you get dispelled and don't rewear between rounds of combat you would take 8,000 damage hits (8,000 at the damage reduction I was at from remorting and equipment strength) it is vitally important that your trigger off dispell message fires right then to force a rewear. I would say that a low hp message would be just as important.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
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