Guages

by Unknown

Back to Mechanic's Corner.

Unknown2004-12-20 14:31:53
Cany anyone lay out an idiot's guide to setting up status bars/guages for Zmud? I mean barebones lay out.
Shihsou2004-12-26 00:42:34
If you're talking about button gauges, yeah, that's easy enough. The way I do it is to first set up a prompt capture trigger, something like:

#CLASS Healthbar
#TRIGGER {^%dh,%s%dm,%s%de,%s%dw%s%dp%s(%w)-} {#VAR hp %1 0;#VAR mana %2 0;#VAR end %3 0;#VAR wil %4 0;#VAR pow %5 0}
#CLASS 0

Make sure to set it to Prompt instead of Newline or your vars will be one prompt behind.

Next, you'll need a maximum value for each variable. To do this, I use both a multi-state trigger that follows each max as its listed in score, and an alias that turns on said trigger whenever I input score.

#CLASS Healthbar
#ALIAS {score} {#T+ scoretrig;#WAIT 1;score}
#TRIGGER scoretrig {^Acolyte%sShihsou%s,%sApprentice%sof%sDamnation$} {}
#COND {Level%s:%s%d ~(%d~%~)} {#var currentlvl %1;#var exp %2;#GAG} {Within|Param=2}
#COND {Health%s:%s%d/%d%sEndurance%s:%s%d/%d} {#var maxhp %2;#var maxend %4;#GAG} {Within|Param=3}
#COND {Mana%s:%s%d/%d%sWillpower%s:%s%d/%d} {#var maxmana %2;#var willpower %3;#var maxwillpower %4;#GAG} {Within|Param=4}
#COND {Reserves%s:%s%1~%} {#IF (@filling=1) {#VAR reserves %1;#T- "scoretrig"} {#T- "scoretrig"}} {Within|Param=5}
#CLASS 0

That basically sets up one line to follow the next. If you'll note the #IF in the last line, its because I use this in conjunction with an autolink trigger.

Alright, now that you have the max amounts from the score and current amounts from the prompt, you can set up your buttons. I don't like to use the command line for this because I hate having to remember which number is what, so I'll basically describe what you do in the editor.

When you create your new button, you're going to use the variable name for the current value as the button name, thus @hp for health, etc. Using the little rubix cube thing on the right side, select the color you want the gauge to normally be when full. You should choose the Gauge under the type. If you want it to do anything when pressed (such as sipping a health vial) put the commands for that down in the Value window.

Next, for size and position. I have my gauges set at 110 wide and 15 high. Its a matter of preference, really. I like having them small so I can see more of the screen. This is also why I have them all in a horizontal row right on top of the Command line.

Lastly, under Gauge (this tab only shows up for Gauges wink.gif ) for Value you'll put your current value variable, thus @hp. For Gauge Max put your max value (@maxhp), and for gauge low you're going to put something in for evaluation. I like @maxhp/4, as I have my autosipper to work at @maxhp/2. If it ever turns bright red, I know something's up that I need to act on. And finally, select the colors you want the gauge to show up in.

Et voila! Your first button is complete! Try to use clashing colors for the text value of the button (ie the name) so that the numerical value shows up well.

The other types of buttons work similarly, including the kind for afflicts, where you can have the button turn red when you're afflicted (works by parsing an affliction message and setting it to a flag variable. Your button is set to react on a true/false depending on the variable state)

Obviously this is pretty basic, but hey, you wanted an idiot's guide.

EDIT: Made some changes to the script in order to make it run faster and work right with the #T+ #T- thing...
Shiri2004-12-26 18:47:35
...anyone know the precise size for the JAVA bar things? whistling.gif I'm trying, I really am Hiriako!