My Health Bar

by Unknown

Back to Mechanic's Corner.

Unknown2005-09-11 20:27:31
Alright, I've been going through a bunch of the posts in the forum and have tried to make a Frankenstien healthbar taking bunches of different peoples ideas. I got the buttons to display the numbers, but they don't update even if I type score.

CODE
#CLASS {Gauges}
#TRIGGER {^&%d{health}h, &%d{mana}m, &%d{ego}e, &%d{power}p, &%d{endurance}en, &%d{willpower}w &*{balances}-$} {
 #var health %1
 #var mana %2
 #var ego %3
 #var power %4
 #var endurance %5
 #var willpower %6
 } "" {nocr|prompt}
#TRIGGER {health : %d/&%d{maxhealth}} {#VAR maxhealth %7}
#TRIGGER {mana : %d/&%d{maxmana}} {#VAR maxmana %8}
#TRIGGER {willpower : %d/&%d{maxwillpower}} {#VAR maxwillpower %9}
#BUTTON 1 {Health: @Health / @MaxHealth} {} {} {} {@health} {} {} {Size} {100} {30} {Pos} {0} {0} {14} {} {Gauge||15|@MaxHealth|@MaxHealth-|0} {} "" {Explore|Inset} {} {}
#BUTTON 2 {Mana: @Mana / @MaxMana} {} {} {} {@Mana} {} {} {Size} {100} {30} {Pos} {0} {131} {1} {} {Gauge||15|@MaxMana|@MaxMana-|0} {} "" {Explore|Inset} {} {}
#CLASS 0


Sorry in advance if this is as ugly as sin, I'm trying to learn.

Cheers
Soll2005-09-11 20:45:16
CODE

#CLASS {Gauges}
#TRIGGER {^(%d)h, (%d)m, (%d)e, (%d)p, (%d)en, (%d)w (*)-$} {
#var health %1
#var mana %2
#var ego %3
#var power %4
#var endurance %5
#var willpower %6
#var balances %7
} "" {nocr|prompt}
#TRIGGER {Health : (%d)/(%d)} {#VAR maxhealth %2}
#TRIGGER {Mana : (%d)/(%d)} {#VAR maxmana %2}
#TRIGGER {Willpower : (%d)/(%d)} {#VAR maxwillpower %2}
#BUTTON 1 {Health: @Health / @MaxHealth} {} {} {} {@health} {} {} {Size} {100} {30} {Pos} {0} {0} {14} {} {Gauge||15|@MaxHealth|@MaxHealth-|0} {} "" {Explore|Inset} {} {}
#BUTTON 2 {Mana: @Mana / @MaxMana} {} {} {} {@Mana} {} {} {Size} {100} {30} {Pos} {0} {131} {1} {} {Gauge||15|@MaxMana|@MaxMana-|0} {} "" {Explore|Inset} {} {}
#CLASS 0


Your trigger numbers were way off, and the fact that you were capturing the prompt to variables in the pattern, and then again in the value would cause more slowness than necessary in that trigger. Try that, and see if it works.
Unknown2005-09-11 20:58:31
No, the buttons still don't update. It's really frustrating that I can't get a proper prompt thingy. I'll look through the forum and see if I can't dredge out an old healthbar.
Unknown2005-09-11 21:05:57
Actually, I fixed it a little; the trigger for getting the mana off of score needed two more spaces. Now I have the max mana and health but can't get the current health to work.
Unknown2005-09-12 10:53:31
I'd get rid of the $ at the end of the prompt trigger, and make sure you use the GA/EOR emulation setting.
Unknown2005-09-13 04:32:46
My health bars work for one character but not another. Wierd. Here is the code now:
CODE
#CLASS {Gauges}
#TRIGGER {^(%d)h, (%d)m, (%d)e, (%d)p, (%d)en, (%d)w (*)-} {#var health %1;#var mana %2;#var ego %3;#var power %4;#var endurance %5;#var willpower %6;#var balances %7} "" {nocr|prompt}
#TRIGGER {Health : (%d)/(%d)} {#VAR maxhealth %2}
#TRIGGER {Mana   : (%d)/(%d)} {#VAR maxmana %2}
#TRIGGER {Endurance : (%d)/(%d)} {#VAR maxendurance %2}
#TRIGGER {Power  : (%d)/(%d)} {#VAR maxpower %2}
#BUTTON 1 {H: @health} {} {} {} {@health} {} {} {Size} {100} {30} {Pos} {118} {0} {32846} {} {Gauge||15|@MaxHealth|@MaxHealth-|7} {} "" {Explore|Inset} {} {}
#BUTTON 2 {M: @mana} {} {} {} {@mana} {} {} {Size} {100} {30} {Pos} {118} {101} {32817} {} {Gauge||15|@MaxMana|@MaxMana-|15} {} "" {Explore|Inset} {} {}
#BUTTON 3 {E: @endurance} {} {} {} {@endurance} {} {} {Size} {100} {30} {Pos} {149} {0} {32864} {} {Gauge||15|@maxendurance|@Maxendurance-|15} {} "" {Explore|Inset} {} {}
#BUTTON 4 {P: @power} {} {} {} {@power} {} {} {Size} {100} {30} {Pos} {149} {101} {32848} {} {Gauge||15|@maxpower|@maxpower-|7} {} "" {Explore|Inset} {} {}
#CLASS 0


It works on my tae'dae, complete with prompt tracking, but not my orclach.
Unknown2005-09-13 10:50:04
Does your orclach have a full prompt? Or did you leave it at the default, which has no endurance or willpower?
Unknown2005-09-13 20:40:29
Yeah, full prompt. But I' ll check again when I get home.
Unknown2005-09-14 06:45:50
Sorry for the double post, but I've found out the reason why my prompt tracks for one character and not the other. My tae'dae, the prompt sits right on the line of the console. But for my orclach, there is a blank space underneath the prompt.

Like Tae'dae - (the line is the bottom of the the window)

1000h, 1000 m etc...

Orclach -

1000h, 1000m, etc...
__________________

You do get what I mean? Does anyone know how to correct that, because that is the only reason why it doesn't work.
Unknown2005-09-14 14:15:54
Did you add a linebreak to your prompt? Do you have GA/EOR emulation on in zMUD? (I recommend the latter, to ensure messages are always on new lines and not tacked onto prompts.)
Unknown2005-09-14 14:59:30
That's the whole point...how do I get rid of the linebreak underneath the prompt because zmud isn't counting that as a prompt; that is why the health bars don't update. And yes, I do have GA/EOR emulation checked in zmud.
Unknown2005-09-14 17:55:14
The blank line isn't causing zMUD to not recognize the prompt. Something else may be incorrect in your triggering of the prompt.
Unknown2005-09-15 01:47:00
No there isn't, because the prompt is that same for both characters, but it only tracks one of them: the one with the prompt exactly on the line(i.e. the character that is being tracked has got a working health bar and such). Mabey I didn't make it clear enough.

Character with tracking prompt:
_____________________________________

1000h, 1000m, etc...

You see a room.

1000h, 1000m, etc... (Note that the prompt is at the bottom of window)


Character with no tracking prompt:
______________________________

1000h, 1000m, etc...

You see a room.

1000h, 1000m, etc...
(EMPTY SPACE HERE) - (Note that prompt is not at the bottom of the window)

Same code, same prompt config, just a linebreak underneath one of the prompts, so it must be that that is causing that problem. To further emphasize, all of my other characters have no sort of double spacing in the window. So if I pressed "enter" a lot for them it would look like:

1000h, 1000m, etc...
1000h, 1000m, etc...
1000h, 1000m, etc...
1000h, 1000m, etc...
1000h, 1000m, etc...

But my other character it would look like this:

1000h, 1000m, etc...

1000h, 1000m, etc...

1000h, 1000m, etc...

1000h, 1000m, etc...

Just tell me how to get rid of the double spacing.
Unknown2005-09-15 11:10:25
If you turned off the GA/EOR emulation, it should get rid of the extra lines. However, I would be very surprised if that made your prompt trigger suddenly start firing.