Unknown2007-11-02 16:05:34
I am looking for something that will create status bars for health mana ego etc. in zmud form
plz and thx
plz and thx
Unknown2007-11-02 16:10:43
QUOTE(Jindor @ Nov 2 2007, 12:05 PM) 455489
I am looking for something that will create status bars for health mana ego etc. in zmud form
plz and thx
plz and thx
I had them for a while...but before you put much time into making them, let me tell you beforehand...
You'll never look at them. :\\
Unknown2007-11-02 16:12:31
Oh yeah, you like posted them but I could never get them to work for some reason
Unknown2007-11-02 16:12:53
I actually only look at health and mana, myself. Health more so, especially if your bar changes colour depending on how empty it is.
Unknown2007-11-03 20:39:09
You'll need three things for a status bar:
An example QSC trigger:
And finally, the button itself. The code for this is a little unwieldy to look at in the import/export formatting, and in most cases it's simply easier to create it through the settings editor:
If you make the button in the settings editor, take the following steps:
- A Prompt trigger to track current hp, mp, and ego levels.
- An SC or QSC trigger to track maximum hp, mana, and ego levels.
- The gauge itself, which is actually a type of button.
CODE
#TRIGGER {^(*)h, (*)m, (*)e, *p, *en, *w *-$} {#VAR hp %1;#VAR mp %2;#VAR ego %3} "" {nocr|prompt}
An example QSC trigger:
CODE
#TRIGGER {| Health : */(*)    Mana : */(*)  Ego  : */(*)*|} {#VAR maxhp %1;#VAR maxmp %2;#VAR maxego %3}
And finally, the button itself. The code for this is a little unwieldy to look at in the import/export formatting, and in most cases it's simply easier to create it through the settings editor:
CODE
#BUTTON 1 {@hp/@maxhp} {} {} {} {@hp} {} {} {} {} {} {} {} {} {32} {} {Gauge||12|@maxhp|@maxhp*0.5|0} {} "" {Explore|Inset} {} {}
If you make the button in the settings editor, take the following steps:
- In the 'Kind' drop down menu, select Gauge.
- Name the button using variables, so that the button displays your current levels as numeric values, in addition to the colored bars. I.E. @hp/@maxhp might show '1460/2250'
- In the 'Gauge' tab, set the 'Value' to the variable you want the gauge to track. In this example, Value would be @hp. The 'Gauge Max' field should be set to the maximum levels of the appropriate statistic, in this case @maxhp. Finally, the 'Gauge Low' field is the number at which the Gauge will change to it's warning color. The easiest way to set this is as a percentage of the @maxhp value, for example '@maxhp*0.5' would set the Gauge to turn to it's warning color at 50% of maximum health.
- Select the colors you wish to use for the gauge. If you select a dark set of colors, you may need to change the button text to a lighter color by altering the Foreground Color in the 'Caption' field of the 'Button States' tab.
Unknown2007-11-03 22:39:32
1. It's better to use %d for numbers instead of *.
2. It's better to add the linebreak in Lusternia and leave off the nocr|prompt options.
3. It's better to use 0 for a button ID when creating a button from a script, as that tells zMUD to use the first available number.
2. It's better to add the linebreak in Lusternia and leave off the nocr|prompt options.
3. It's better to use 0 for a button ID when creating a button from a script, as that tells zMUD to use the first available number.
Unknown2007-11-03 23:27:34
QUOTE(Zarquan @ Nov 3 2007, 10:39 PM) 455786
1. It's better to use %d for numbers instead of *.
I was under the impression that * parsed faster than %d.
QUOTE(Zarquan @ Nov 3 2007, 10:39 PM) 455786
2. It's better to add the linebreak in Lusternia and leave off the nocr|prompt options.
I'm not sure what you mean here. I know what a line break is, obviously, but how do you add one within Lusternia?
QUOTE(Zarquan @ Nov 3 2007, 10:39 PM) 455786
3. It's better to use 0 for a button ID when creating a button from a script, as that tells zMUD to use the first available number.
My mistake. I simply exported the button from a blank settings setup instead of considering how it would interact with existing buttons.
Hyperion2007-11-03 23:39:49
QUOTE(Harrow @ Nov 3 2007, 04:27 PM) 455801
I'm not sure what you mean here. I know what a line break is, obviously, but how do you add one within Lusternia?
CONFIG PROMPT ADD LINEBREAK
Eldanien2007-11-03 23:43:18
Case by case basis, regarding * vs %d. * (get next character, immediately tack it on, evaluate rest) will evaluate every single other character in the trigger text for the remainder of the regex pattern. %d has an extra step with each check (get next character, evaluate if it is numeric, tack it on if true), but will stop as soon as it encounters a non-numeric character as the subpattern breaks. If there's more text after the number than there are numbers, then %d will be faster.
That's just a rough explanation, of course. I'm sure the pattern matching algorithm used has various optimizations involved. But unless you're doing lookahead in pattern matching, this is how it works.
It is almost always better to avoid * if you're wanting to optimize your regex patterns. For some people, some computers, this alone can spare you from client lag.
That's just a rough explanation, of course. I'm sure the pattern matching algorithm used has various optimizations involved. But unless you're doing lookahead in pattern matching, this is how it works.
It is almost always better to avoid * if you're wanting to optimize your regex patterns. For some people, some computers, this alone can spare you from client lag.
Unknown2007-11-03 23:48:53
I'll keep that in mind in the future.