Health/Mana/Ego Bars

by Unknown

Back to Mechanic's Corner.

Unknown2007-06-27 02:44:35
The other thread concerning "how you view Lusternia" has peaked my interest in making Zmud prettier, so I'm trying to go through and add different graphical additions. I'm starting small, with some health bars, but I want to move up to an active afflictions list, something that keeps track of my vials/herb balance, and the status of my different body parts.

Right now I'm having some trouble making guages. I have them set up, and I have them colored. My problem is having it recognize my maxhealth/maxmana/maxego.

What sort of trigger or variable would I use to capture that, especially when it changes often, such as when I level up or use my yellow chakra? Also, I have the power bar working (maxpower is always 10), but it seems to delay a bit.

ALSO: I've been looking through the mechanics corner and the combat guide forums, as I'm just now learning Zmud, and I'm trying to build my own system. What's up with the different type of input variables? I see everything from %1, %2, etc (what I use), to ^(%d), and other things.

Here's the script I've written so far, any help is appreciated:

#CLASS {Healing System|Guages}
#VAR hp {2500}
#VAR mana {3325}
#VAR ego {3160}
#VAR power {10}
#VAR maxpower {10}
#TRIGGER {%1h, %2m, %3e, %4p} {hp=%1;mana=%2;ego=%3;power=%4}
#BUTTON 1 {Health} {} {} {} {@hp} {} {} {} {} {} {} {} {} {64} {} {Gauge||14|@maxhp|@maxhp/10|7} {} "" {Explore|Inset} {} {Health}
#BUTTON 2 {Mana} {} {} {} {@mana} {} {} {} {} {} {} {} {} {16} {} {Gauge||14|@maxmana|@maxmana/10|7} {} "" {Explore|Inset} {} {mana}
#BUTTON 3 {Ego} {} {} {} {@ego} {} {} {} {} {} {} {} {} {32} {} {Gauge||14|@maxego|@maxego/10|7} {} "" {Explore|Inset} {} {Ego}
#BUTTON 4 {Power} {} {} {} {@power} {} {} {} {} {} {} {} {} {80} {} {Gauge||14|@maxpower|@maxpower/10|7} {} "" {Explore|Inset} {} {Power}
#CLASS 0

Yrael2007-06-27 03:19:29
I also wonder if it is possible to make the black background of zmud transparent, so I may see my desktop peekture.
Krellan2007-06-27 03:37:25
use nexussssssss sad.gif
Alodia2007-06-27 04:11:11
QUOTE(Krellan @ Jun 27 2007, 11:37 AM) 420936
use nexussssssss sad.gif


I agree
Amarok2007-06-27 09:45:36
QUOTE(Deschain @ Jun 27 2007, 04:44 AM) 420910
#TRIGGER {%1h, %2m, %3e, %4p} {hp=%1;mana=%2;ego=%3;power=%4}



try setting this triggers option to "prompt"
alway for a gauge, need to set the max value, so it can display the difference.
Unknown2007-06-27 10:34:19
My recommendations:

1. Add the linebreak option to your prompt in Lusternia because zMUD/CMUD has trouble firing reliably on the GA/EOR prompts.

2. Don't use %1..%99 in your trigger patterns. These numbers are intended for use in the trigger code only and don't work as well in the patterns as a more specific wildcard. They only work as the "lazy backwards compatibility" option. Use (%d) to capture the numeric values instead: #TRIGGER {^(%d)h, (%d)m, (%d)e, (%d)p} {hp = %1;mana = %2;ego = %3;power = %4}

3. When distributing any script that has button commands in it, use 0 for the ID. Using 0 tells zMUD/CMUD to find the next incremental button value and create that, so it works even if someone already has one or more buttons defined in their settings. Using any other number will likely overwrite the existing button with that number.

4. Make triggers for your score lines to capture your max health/mana/ego. Max power is always going to be 10.
Unknown2007-06-27 13:26:54
QUOTE(Zarquan @ Jun 27 2007, 06:34 AM) 421054
My recommendations:

1. Add the linebreak option to your prompt in Lusternia because zMUD/CMUD has trouble firing reliably on the GA/EOR prompts.

2. Don't use %1..%99 in your trigger patterns. These numbers are intended for use in the trigger code only and don't work as well in the patterns as a more specific wildcard. They only work as the "lazy backwards compatibility" option. Use (%d) to capture the numeric values instead: #TRIGGER {^(%d)h, (%d)m, (%d)e, (%d)p} {hp = %1;mana = %2;ego = %3;power = %4}

3. When distributing any script that has button commands in it, use 0 for the ID. Using 0 tells zMUD/CMUD to find the next incremental button value and create that, so it works even if someone already has one or more buttons defined in their settings. Using any other number will likely overwrite the existing button with that number.

4. Make triggers for your score lines to capture your max health/mana/ego. Max power is always going to be 10.


Ahhh, I have to use score to catch it. Thanks for the tips. I've got to run to work, but when I get back I'm going to redo my script and we'll see what happens.

Thanks for the advice on trigger patterns too, I always wondered about that.
Unknown2007-06-27 13:53:01
QUOTE(Krellan @ Jun 26 2007, 11:37 PM) 420936
use nexussssssss sad.gif


Not all of us are OP Mugwump Moondancers.

QUOTE(Alodia @ Jun 27 2007, 12:11 AM) 420953
I agree


No.
Unknown2007-06-27 23:21:18
Got it working perfectly now:

note: type "config prompt add linebreak" for 100% accuracy.

#CLASS {Healing System|Guages}
#VAR hp {}
#VAR mana {}
#VAR ego {}
#VAR power {}
#VAR maxpower {}
#VAR maxhealth {}
#VAR maxmana {}
#VAR maxego {}
#TRIGGER {^(%d)h, (%d)m, (%d)e, (%d)p} {hp=%1;mana=%2;ego=%3;power=%4}
#TRIGGER {Health : (%d)/(%d)} {maxhealth=%2}
#TRIGGER {Mana : (%d)/(%d)} {maxmana=%2}
#TRIGGER {Ego : (%d)/(%d)} {maxego=%2}
#BUTTON 1 {Health} {} {} {} {@hp} {} {} {} {} {} {} {} {} {64} {} {Gauge||14|@maxhp|@maxhp/10|7} {} "" {Explore|Inset} {} {0}
#BUTTON 2 {Mana} {} {} {} {@mana} {} {} {} {} {} {} {} {} {16} {} {Gauge||14|@maxmana|@maxmana/10|7} {} "" {Explore|Inset} {} {0}
#BUTTON 3 {Ego} {} {} {} {@ego} {} {} {} {} {} {} {} {} {32} {} {Gauge||14|@maxego|@maxego/10|7} {} "" {Explore|Inset} {} {0}
#BUTTON 4 {Power} {} {} {} {@power} {} {} {} {} {} {} {} {} {80} {} {Gauge||14|@maxpower|@maxpower/10|7} {} "" {Explore|Inset} {} {0}
#CLASS 0
Unknown2007-06-28 11:36:33
Don't forget to change the #BUTTON 1/2/3/4 to #BUTTON 0...
Unknown2007-07-12 18:17:27
What am I doing wrong with this? the bars aren't reflecting me taking damage at all
Forren2007-07-12 18:25:10
QUOTE(Jindor @ Jul 12 2007, 02:17 PM) 425086
What am I doing wrong with this? the bars aren't reflecting me taking damage at all


Is your prompt trigger correctly matching your values?

A simple prompt trigger starts out like... ^(%d)h, (%d)m, (%d)e. Are you using similar wildcards? Try a test on your prompt to make sure it's correctly storing to the variables you want.

EDIT: I think I know why. You don't have () around the wildcards in your prompt trigger, and you're using them incorrectly. change it to...

^(%d)h, (%d)m, (%d)e, (%d)p

There rest should still work. I don't know how to handle %1, %2, etc in Zmud - You might have to use "" surrounding it in certain cases. In CMud, #VAR currentMana %2 works well.
Unknown2007-07-12 18:39:05
QUOTE(Forren @ Jul 12 2007, 01:25 PM) 425090
Is your prompt trigger correctly matching your values?

A simple prompt trigger starts out like... ^(%d)h, (%d)m, (%d)e. Are you using similar wildcards? Try a test on your prompt to make sure it's correctly storing to the variables you want.

EDIT: I think I know why. You don't have () around the wildcards in your prompt trigger, and you're using them incorrectly. change it to...

^(%d)h, (%d)m, (%d)e, (%d)p

There rest should still work. I don't know how to handle %1, %2, etc in Zmud - You might have to use "" surrounding it in certain cases. In CMud, #VAR currentMana %2 works well.


I do have more luck using #var instead of = . Either should technically work, but the former will take care of strange cases where the variable might not exist, and you don't (technically) have to create the variables as part of the script, since they'll be created when the trigger matches. The downside is that it's harder to track where the variable is going to be created; I've had problems with duplicate variables being created in different folders before. I believe you can get around it by using #var Class| value to ensure the variable is created in the right class.
Forren2007-07-12 18:43:19
QUOTE(mitbulls @ Jul 12 2007, 02:39 PM) 425092
I do have more luck using #var instead of = . Either should technically work, but the former will take care of strange cases where the variable might not exist, and you don't (technically) have to create the variables as part of the script, since they'll be created when the trigger matches. The downside is that it's harder to track where the variable is going to be created; I've had problems with duplicate variables being created in different folders before. I believe you can get around it by using #var Class| value to ensure the variable is created in the right class.


Nice thing about #VAR in Cmud is it will create the variables at the root, so they're very easy to spot errors in scripts.
Unknown2007-07-12 22:40:02
I did a direct C&P of that second one
Unknown2007-07-13 14:44:16
QUOTE(Jindor @ Jul 12 2007, 05:40 PM) 425169
I did a direct C&P of that second one


Did you remember to CONFIG PROMPT ADD LINEBREAK and CONFIG PROMPT STATS (or CONFIG PROMPT ALL should also work). The rest of it looks like it should be functional for zMUD; even the parts I mentioned should work, I just would have done them differently.
Forren2007-07-13 15:06:18
QUOTE(mitbulls @ Jul 13 2007, 10:44 AM) 425363
Did you remember to CONFIG PROMPT ADD LINEBREAK and CONFIG PROMPT STATS (or CONFIG PROMPT ALL should also work). The rest of it looks like it should be functional for zMUD; even the parts I mentioned should work, I just would have done them differently.


Oh yeah, forgot about that part for him - I assumed he was configuring the trigger to match on prompt and not newline, in which case you do not need a linebreak added.
Unknown2007-07-13 23:54:54
QUOTE
#CLASS {Healing System|Guages}
#VAR hp {}
#VAR mana {}
#VAR ego {}
#VAR power {}
#VAR maxpower {}
#VAR maxhealth {}
#VAR maxmana {}
#VAR maxego {}
#TRIGGER {^(%d)h, (%d)m, (%d)e, (%d)p} {hp=%1;mana=%2;ego=%3;power=%4}
#TRIGGER {Health : (%d)/(%d)} {maxhealth=%2}
#TRIGGER {Mana : (%d)/(%d)} {maxmana=%2}
#TRIGGER {Ego : (%d)/(%d)} {maxego=%2}
#BUTTON 1 {Health} {} {} {} {@hp} {} {} {} {} {} {} {} {} {64} {} {Gauge||14|@maxhp|@maxhp/10|7} {} "" {Explore|Inset} {} {0}
#BUTTON 2 {Mana} {} {} {} {@mana} {} {} {} {} {} {} {} {} {16} {} {Gauge||14|@maxmana|@maxmana/10|7} {} "" {Explore|Inset} {} {0}
#BUTTON 3 {Ego} {} {} {} {@ego} {} {} {} {} {} {} {} {} {32} {} {Gauge||14|@maxego|@maxego/10|7} {} "" {Explore|Inset} {} {0}
#BUTTON 4 {Power} {} {} {} {@power} {} {} {} {} {} {} {} {} {80} {} {Gauge||14|@maxpower|@maxpower/10|7} {} "" {Explore|Inset} {} {0}
#CLASS 0


Could it be that the only thing I could see as a variable is %d?
or how max* is all %2 as well as normal mana
Unknown2007-07-14 01:31:29
The maxhp variable should really be maxhealth.
Unknown2007-07-15 03:45:34
Ok health is working...now it won't track the max's of all the rest