|
Zophiel Newbie
Joined: 08 Oct 2004 Posts: 2
|
Posted: Fri Oct 08, 2004 2:41 pm
Help a Noob with the trigger for guages. |
Alrighty I've spent the last 3 hours searching the help files and back topics. Everything I've tried has been to no avail.
I've managed to set up guages for healtth and mana but the guages remain static with absolutely no movement at all.
I am working off of the following model for the trigger.
#TR {(%n)/(%d)hp (%n)/(%d)ma} {
#VAR hp %1
#VAR maxhp %2
#VAR mana %3
#VAR maxmana %4
}
My value for hp is 980. My value for mana is 1280. These are my max values and both are currently at the max.
Can someone tell me excatly what the trigger should like using those vaulues when I enter it into the value field.
Also do I need to enter independent variables for hp and mana in the variable settings? Or will this be accomplished just by setting up the trigger? If I do need to enter then independently, what should they look like? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Oct 08, 2004 10:46 pm |
That trigger is designed for entry in the command line, not in the Value field.
The trigger matches a line which looks something like:
597/980hp 1192/1280ma
If your prompt, or other source doesn't look like that (including spaces) then this trigger will do nothing. This trigger appears to have been designed to match a prompt, which means it also needs the 'prompt' option and should actually look like this:
#TR {(%n)/(%d)hp (%n)/(%d)ma} {
#VAR hp %1
#VAR maxhp %2
#VAR mana %3
#VAR maxmana %4
} {} {prompt}
The trigger has no direct effect on your gauges. It merely changes some variables. The change in the variables is what changes your gauge, and that only happens IF these variables are used in your gauge values (on the Gauge tab).
The trigger will create the variables if they don't exist, there is no need to make them yourself. |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
Zophiel Newbie
Joined: 08 Oct 2004 Posts: 2
|
Posted: Fri Oct 08, 2004 11:14 pm |
Alrighty. I entered #TR {(%n)/(%d)hp (%n)/(%d)ma} {
#VAR hp %1
#VAR maxhp %2
#VAR mana %3
#VAR maxmana %4
} {} {prompt}
into the command line but when I test the trigger it displays this
-123/123hp -123/123ma
and not this
597/980hp 1192/1280ma.
Any chance you could give a dumbed down explanation of how to set up hp and mana guages with hp1014 and mana1329 for this poor befuddled noob. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Oct 08, 2004 11:48 pm |
-123/123hp -123/123ma
This is just an EXAMPLE! It's not the ONLY line the trigger will ever match (which would make the trigger useless). zMUD's Test tab uses -123 to show where the pattern matches signed or unsigned numbers. It uses 123 to show where the pattern matches unsigned numbers only.
If you want to 'test' whether the trigger will work with a particular line, type or paste that line into the 'test' box, replacing whatever was there before. In addition to
-123/123hp -123/123ma
it also works with
597/980hp 1192/1280ma.
It doesn't work with
hp1014 and mana1329
since that line only has two numbers, not four, doesn't include any slashes, has the letters before the numbers instead of after, and has another word (and) between the numbers. In other words, it doesn't look anything like the pattern!
If that's the pattern you want to match, then your trigger pattern should be:
hp(%d) and mana(%d)
Replace %d with %n if you want to allow negative numbers. Since this clearly doesn't include your maximum values, you'll have to use some other method (direct entry, another trigger, etc) for those.
Trigger patterns are covered in detail in the helptopics 'Pattern Matching', '#TRIGGER', 'Introduction to Triggers', and many others so I won't bother to repeat everything you could read for yourself. |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Oct 09, 2004 8:16 am |
To set up hitpoint and mana gauges, first determine where you can get the information needed for the gauges. This is usually the current and maximum values. Many people can get all these values from their prompt, but many others can only get their current values from the prompt and have to get their maximum values from another source. I don't know which group you fall into.
Once you've determined the source of the information, write a trigger to put that information into variables. The pattern of the trigger should match the line which is providing the information, using appropriate wildcards from the Pattern Matching topic in place of numbers and anything else which may change. If that line is a prompt, the prompt option should be used. The commands (or Value) should simply be a series of #VARIABLE statements, one per value. You haven't ever specifically said what your prompt looks like, so I can't tell you exactly what your trigger should look like.
If your prompt only provides current values, you have a choice of methods for obtaining the maximum values. The simplest method is to simply look up the maximum values and manually enter them into variables, then update those variables whenever your maximums change. Since you said that your maximum hp is 980 and your maximum mana is 1280:
#VAR maxhp 980
#VAR maxmana 1280
Once you have all your variables and triggers created, go ahead and make the gauges. This is easiest in the Settings Editor, where gauges are listed as a type of button.
Here's the procedure:
1. Use the Buttons button to open the Settings Editor. If you already have it open, use the Show menu to select Buttons.
2. Create a new button by clicking the New button.
3. Enter the button's name in the Caption field. HP
4. Set the button's Kind to Gauge.
5. Go to the Gauge tab.
6. Enter the formula/value which controls the gauge in the Value field. @hp
7. Enter the formula/value which tells when the gauge should be full in the Gauge Max field. @Maxhp
8. Enter the formula/value which controls when the gauge should change colors in the Gauge Low field. @Maxhp/4
9. Click the Gauge Color box and select a color or use the default. bright blue
10. You can also change the Low color and Background color if you want, but the default values work well.
11. If you don't like the size or position of the gauge, go to the Position/Size tab and adjust them.
12. Save, of course.
Repeat for mana, but change the Caption and variables. |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|