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
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Jun 19, 2005 4:19 pm   

Hp guages
 
I'm having troubles making an HP gauge. I don't know if you could help me. But here's what the prompt looks like.

860 hps|286 sp|1113 mp >

Now, the thing is, the prompt updates itself only when you enter a command. And also, here's what the hp info looks like in battle:

hp: 605 sp: 286 mp: 740


Could someone show me a way to make an hp guage for it, please? Would be greatly appreciated. Thanks.

Charneus
Reply with quote
KillerKitty
Beginner


Joined: 15 Jun 2005
Posts: 21

PostPosted: Sun Jun 19, 2005 6:06 pm   
 
Replace the numbers in the first 3 lines below with your maximum hp, sp and mp in that order,
THEN copy and paste this into where you normally type commands into zMUD and press enter.

#VARIABLE hpmax 860
#VARIABLE spmax 286
#VARIABLE mpmax 1113
#TRIGGER {^(%d) hps~|(%d) sp~|(%d)} {%1 = @hp;%2 = @sp;%3 = @mp} "" "prompt"
#TRIGGER {^hp: (%d) sp: (%d) mp: (%d) {%1 = @hp;%2 = @sp;%3 = @mp}
#GAUGE hpgauge "@hp / @hpmax hp" @hp @hpmax (@hpmax/2.5) "" "green" "red" "black"
#GAUGE spgauge "@sp / @spmax sp" @mp @spmax (@spmax/2.5) "" "blue" "darkblue" "black"
#GAUGE mpgauge "@mp / @mpmax mp" @sp @mpmax (@mpmax/2.5) "" "magenta" "darkmagenta" "black"



You can then right click on any of the gauges to change their colours, size and position on your screen in the options that pop up :)
_________________
www.bbc.co.uk/doctorwho
EXTERMINATE
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Jun 19, 2005 6:16 pm   
 
Gauges require three things: triggers to capture the info, variables to hold the captured info, and buttons to display the info.

First, the variables:

#variable hp {0} {0}
#variable mp {0} {0}
#variable sp {0} {0}

Second, the triggers:

#trigger {(%d) hps~|(%d) sp~|(%d) mp ~>} {hp = %1;sp = %2;mp = %3} {prompt|nocr}
#trigger {hp: (%d) sp: (%d) mp: (%d)} {hp = %1;sp = %2;mp = %3} {prompt|nocr}

Third, the gauges (creating them via the settings editor should be fairly straightforward via the New Button option, so I'll just list what variables/expressions to use):

Hp gauge: gaugemax = (variable containing something equating to your maximum hp, probably triggered off your character info), gaugelow = 0, gaugevalue = @hp

sp gauge: gaugemax = (variable containing something equating to your maximum sp, probably triggered off your character info), gaugelow = 0, gaugevalue = @sp

Mp gauge: gaugemax = (variable containing something equating to your maximum mp, probably triggered off your character info), gaugelow = 0, gaugevalue = @mp
_________________
EDIT: I didn't like my old signature
Reply with quote
KillerKitty
Beginner


Joined: 15 Jun 2005
Posts: 21

PostPosted: Sun Jun 19, 2005 7:15 pm   
 
My one will work fine for you if you just copy and paste it in after changing the maximum hp/sp/mp, but he copied the help file pretty good. :)

You don't need to make the main variables in advance, the triggers I mentioned make them automatically.

Also having the maximums as variables means they can be changed easier from within the mud whenever his maximums changed for example if he gains a level and gets more hp he can just type @hpmax = 1000 or whatever without having to go into the settings.
_________________
www.bbc.co.uk/doctorwho
EXTERMINATE
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Jun 19, 2005 7:19 pm   
 
Both helped out quite a bit. Killer, there was one mistake you made.

#GAUGE mpgauge "@mp / @mpmax mp" @sp @mpmax (@mpmax/2.5) "" "magenta" "darkmagenta" "black"

You have the variable @sp instead of @mp there. But it's all fixed. I took a little from both and worked with it until I got it to work like I needed it to. Thank you both.

Charneus

By the way, I've made complex triggers before, but still, I'm new to a lot of it. :(
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