 |
HunterCo Beginner
Joined: 21 Oct 2000 Posts: 11 Location: USA
|
Posted: Mon Feb 11, 2002 2:48 am
Confused, as usual, regarding triggers, etc. |
This is what I'm trying to do:
The prompt I use in a game looks like this-
<66/66hp 140/140m 250/250mv>
I'm trying to translate that info into a couple gauges, but really am lost on how to do so. Can I get a hand with how to make the Triggers/Variables/Buttons(Guage)? I've tried the help files, but that confuses me even more :0 |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Mon Feb 11, 2002 4:10 am |
<66/66hp 140/140m 250/250mv>
quote:
From help files:
SETPROMPT
Syntax: #SETP string varname [varname...]
SETPROMPT example
MUD prompt looks like:
<100/150hp 50/60ma 90/100mv>
The correct SETPROMPT command would be:
#SETPROMPT "<" hp maxhp mana maxmana mv maxmv
I'm trying to translate that info into a couple gauges,
quote:
From help files:
GAUGE
Syntax: #GAUGE id caption [value] [maxvalue] [lowvalue] [class] [normcolor] [lowcolor]
Creates a graphical gauge that you can use to visually track the value of an expression. For example, you can track your hit points, mana, etc using a gauge. Gauges are special versions of Buttons. To modify some of the special properties of a gauge, you will need to use the Settings Editor. The Gauge command can be used to quickly set or modify the main properties of a gauge.
The id is the short name given to the gauge so that you can refer to it using script commands. The id is not displayed anywhere on the gauge.
...
GAUGE examples
#GAUGE hp "hp" @hp @maxhp (@maxhp/10) "blue" "red"
creates a nice hitpoint gauge. The value of the @hp variable is tracked. If @hp is less than @maxhp/10 then the gauge will be red, otherwise it will be blue.
TonDiening
Uses 6.16 |
|
|
 |
EdwinDroom Wanderer
Joined: 25 Jan 2002 Posts: 77 Location: Ireland
|
Posted: Mon Feb 11, 2002 4:13 am |
#TR ~<(%1)~/(%2)hp (%3)~/(%4)m (%5)~/(%6)mv~>
hp=%1
maxhp=%2
m=%3
maxm=%4
mv=%5
maxmv=%6
#GAUGE hp "hp" @hp @maxhp (@maxhp/10) "" "blue" "red"
and similar for m and mv
It's 3 a.m. , so maybe someone could put this into a one liner, and debug if need be? That's the general code you need though, as typed into the command line...
Change the values of maxhp/10 etc to put the color change where you want it.
Hope this is some help
Ed
All the best freaks are here, please stop staring at me |
|
|
 |
EdwinDroom Wanderer
Joined: 25 Jan 2002 Posts: 77 Location: Ireland
|
Posted: Mon Feb 11, 2002 4:15 am |
*GRIN* thought i'd seen that prompt format somewhere before
All the best freaks are here, please stop staring at me |
|
|
 |
HunterCo Beginner
Joined: 21 Oct 2000 Posts: 11 Location: USA
|
Posted: Tue Feb 12, 2002 5:12 am |
Wow, that seemed easy enough... Once I knew what to look for in the help files that is. I tried both suggestions just to get a feel for both... thanks guys! I really appreciate it.
-HunterCo |
|
|
 |
HunterCo Beginner
Joined: 21 Oct 2000 Posts: 11 Location: USA
|
Posted: Tue Feb 12, 2002 5:17 am |
Uh oh... :) See, I knew if it could be screwed up, I could do so. These are the exact strings I used...
#SETPROMPT "<" hp maxhp mana maxmana mv maxmv
#GAUGE hp "HitPoints" @hp @maxhp (@maxhp/10) "" "green" "red"
#GAUGE mv "Movement" @mv @maxmv (@maxmv/10) "" "yellow" "red"
#GAUGE mana "Mana" @mana @maxmana (@maxmana/10) "" "cyan" "red"
I have three gauges now, one green, one cyan, one yellow with the correct labels... but they are not representing the amount of each variable when changed, nor do the change color... Do I have a typo in those somewhere, or is there a mistake maybe? By exact prompt is:
<76/76hp 147/147m 260/260mv> [I] (Gold=50533, 292793xp/135957tnl) :
HELP AGAIN PLEASE! ;)
-HunterCo |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Tue Feb 12, 2002 7:53 am |
I don't have zMud in front of me but we could
check the prompt trigger which looks like
isn't working for you.
You can test it with #SH @hp @hpmax
<76/76hp 147/147m 260/260mv> [I] (Gold=50533, 292793xp/135957tnl) :
Using what Edwin Droom posted with a twist:
In the settings editor, make a new trigger:
TRIGGER:
^~<(%d)~/(%d)hp (%d)~/(%d)m (%d)~/(%d)mv~>
VALUE:
hp=%1
maxhp=%2
mana=%3
maxmana=%4
mv=%5
maxmv=%6
OPTIONS:
[X] prompt
[ ] newline
[ ] trigger on trigger
TonDiening
Beta Upgrading to 6.26 |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Feb 12, 2002 7:22 pm |
Use the button editor, it's much easier than the command line for gauges.
LightBulb
All scripts untested unless otherwise noted |
|
|
 |
HunterCo Beginner
Joined: 21 Oct 2000 Posts: 11 Location: USA
|
Posted: Thu Feb 28, 2002 12:01 am |
Hmmm. I do have another question that may also come into play. The prompt is different colors. Could the codes used for different colors be interfering at all with the trigger?
BTW: Tried the latest trigger and it's still not working right. Sorry about the trouble.
-HunterCo |
|
|
 |
HunterCo Beginner
Joined: 21 Oct 2000 Posts: 11 Location: USA
|
Posted: Thu Feb 28, 2002 12:07 am |
Well, let me give you a little more info here.
I tried the command:
#SH @hp @maxhp
and it returned:
%1 %2
-HunterCo |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Feb 28, 2002 7:24 pm |
The colors shouldn't make any difference.
There's nothing wrong with using the #SETPROMPT command. There's nothing wrong with using a trigger to parse the prompt. However, they both do the same thing so it's best to only use one or the other.
#SETPROMPT "<" hp maxhp mana maxmana mv maxmv
or
#TR {~<(%d)/(%d)hp (%d)/(%d)m (%d)/(%d)mv} {#VAR hp %1;#VAR maxhp %2;#VAR mana %3;#VAR maxmana %4;#VAR mv %5;#VAR maxmv %6} {} {nocr|prompt}
or
#TR {~<&hp/&{maxhp}hp &mana/&{maxmana}m &mv/&{maxmv}mv} {} {} {nocr|prompt}
Any of these should work, and they all do exactly the same thing.
LightBulb
All scripts untested unless otherwise noted |
|
|
 |
HunterCo Beginner
Joined: 21 Oct 2000 Posts: 11 Location: USA
|
Posted: Sat Mar 02, 2002 7:49 am |
Okay, there is progress being made.
I used the trigger by Lightbulb:
#TR {~<(%d)/(%d)hp (%d)/(%d)m (%d)/(%d)mv} {#VAR hp %1;#VAR maxhp %2;#VAR mana %3;#VAR maxmana %4;#VAR mv %5;#VAR maxmv %6} {} {nocr|prompt}
Now, each time the prompt is displayed on screen, the refresh button in the trigger screen goes yellow, telling me something has been updated. Although, the values of the variables are still a %1 or %2, and not the actual number from the %d value... thus doing a
#SH @hp returns a %1, and also the gauges remain at 100%.
It's close, I can feel it. Argh!
-HunterCo |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Sat Mar 02, 2002 12:58 pm |
Why do you get #SH @hp returns a %1
Do you have an alias/trigger/variable called %1?
Is your
View->Preferences->Special Characters
Parameter Char: % [checked]?
I can't think of any other reason at this time why you would get that.
That would be one of your major problems. If the gauge is trying to
track a variable with value %1 .. it wont work.
TonDiening
Beta Upgrading to 6.26 |
|
|
 |
HunterCo Beginner
Joined: 21 Oct 2000 Posts: 11 Location: USA
|
Posted: Thu Mar 07, 2002 6:30 pm |
Okay- please nobody hit me with rotten fruit or heavy machinery. I just double-checked the special characters and the % was not selected. As soon as I selected it, the gauges began working.
Thanks all for the help. I would never have gotten it without you!
-HunterCo |
|
|
 |
|
|