Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Shrake
Beginner


Joined: 10 Sep 2001
Posts: 26
Location: USA

PostPosted: Sun Jun 13, 2010 7:57 am   

Trigger and Bar help
 
Hello,

I was hoping you could help me out with health/Cp bar and a trigger. I will try to explain what I am trying to do and please let me know what information you need.

First of all I am trying to make Bars for health and Cp. Health-red and Cp blue . It looks like this in the Mud :
HP: [817/817] CONC: [550/865]

I also want to backstab a mob after I have hidden . Just not sure how to get it to backstab any mob. Here is what will be seen on the mud. The backstab command is bs :


The middle of the light forest consists mainly of oak trees and green
grass. The trees have been placed evenly apart, and almost in a straight
line which is probably not a coincidence. The darkness of the night does
little to fight off the feeling of openness present here. The darkness from
the night sky spreads through the forest There is a secure feeling about
the light forest.

The sky is overcast with dark clouds.
Obvious exits: north, south, east, northeast, west, southwest and
northwest.
A rude brigand (flagged by Shrake)

If you can help me out thanks. If you need more info please let me know.

Thanks.
Shrake
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Sun Jun 13, 2010 2:29 pm   
 
first you need to make a trigger to capture the information into variables

Code:
#TR {HP: ~[(%d)/(%d)~] CONC: ~[(%d)/(%d)~]} {
hp=%1
hpMax=%2
cp=%3
cpMax=%4
}


Then you need to go into the settings editor and make yourself a button for each of type gauge.
Then just input the various variable names and colors on the gauge tab.
_________________
Discord: Shalimarwildcat
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Sun Jun 13, 2010 2:34 pm   
 
As for the Backstab bit... i would suggest an alias.

Code:
#ALIAS bs($target) {
hide
#WAITFOR {Message for successful hide}
backstab $target
}
_________________
Discord: Shalimarwildcat
Reply with quote
Shrake
Beginner


Joined: 10 Sep 2001
Posts: 26
Location: USA

PostPosted: Mon Jun 14, 2010 7:55 am   
 
Hello Shalimar,

Thanks for helping me out. I am just not sure what and where to put the various variables on the guage ?

On the backstab I really want it to know the target so I do have to put target name in everytime if that can be done.

Thanks,
Shrake
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Jun 14, 2010 5:44 pm   
 
For the backstab, you would need to come up with some way for your alias to recognize what the target should be. Is there some message from the mud that you can point to and say "There, that's what I want to target"? Is it the "(flagged by Shrake") message you posted above? We really can't guess unless you tell us. And the computer can't recognize it unless there is some identifiable message that it can trigger off of.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Jun 14, 2010 5:48 pm   
 
As for the buttons, go into the Package editor and create a new button for each variable you want a gauge for. Set the type to "Gauge". Click on the Options tab. In the box labeled "Variable", you put the name of the variable you want it to track. Fill out other values in the Options and Gauge tabs as you wish.
Reply with quote
Shrake
Beginner


Joined: 10 Sep 2001
Posts: 26
Location: USA

PostPosted: Mon Jun 14, 2010 11:36 pm   
 
Hello,

I think (flagged by Shrake) would work ad message. I am working with gauge . I just want to clarify that Hp can go in Variable . I have put HP , hp, HP: into variable tab and it does not seem to work. I put the trigger in the pattern spot so not sure what I am doing wrong?

Thanks,
Shrake
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jun 15, 2010 1:55 am   
 
Put in @Hp
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jun 15, 2010 1:55 am   
 
Put in @Hp
Reply with quote
Shrake
Beginner


Joined: 10 Sep 2001
Posts: 26
Location: USA

PostPosted: Wed Jun 16, 2010 4:32 am   
 
Hello,

I just cannot get the Gauge to work. Here is what I did. I created the trigger that shalimar did for me . In Button under options I put Variable as @HP .Under Gauge Value:@HP,Max:@hpmax,Low:@maxhp10. I put in colors . The gauge is still not working . I was hoping you could tell me what I am doing wrong or missing ? Is there some way I need set up trigger maybe?
Thanks,
Shrake
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Wed Jun 16, 2010 4:48 am   
 
for low i think you mean: @hpMax/10



the trigger would only need to be redone if the variables have the wrong, or no value
if you can verify that they have the proper value, than the trigger is fine
_________________
Discord: Shalimarwildcat
Reply with quote
Shrake
Beginner


Joined: 10 Sep 2001
Posts: 26
Location: USA

PostPosted: Wed Jun 16, 2010 6:55 am   
 
Hello,

Thanks for all of your help on this. I seem to have the numbers on the Gauge working but the color is not going down as the hp go down ? Not sure what it could be. Any thoughts ?

Thanks,
Shrake
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Wed Jun 16, 2010 7:01 am   
 
it will only adjust the gauge as often as the numbers appear on screen to fire the trigger

also, make sure background color is not the same as your other colors
_________________
Discord: Shalimarwildcat
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Jun 16, 2010 12:21 pm   
 
Also, make sure the trigger is actually capturing properly and assigning the value to @HP.
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Thu Jun 17, 2010 8:19 pm   
 
Hey how would you move this to another window so you can have a free floating gauge if you wanted to? I have a gauge set up for my hps in current window. but i'd like it to be free floating really.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jun 17, 2010 9:07 pm   
 
1)create new window
2)move all the buttons to this new window
3)move variables and triggers to a new module, so that the buttons in the new window can still see the variables.
_________________
EDIT: I didn't like my old signature
Reply with quote
Shrake
Beginner


Joined: 10 Sep 2001
Posts: 26
Location: USA

PostPosted: Fri Jun 18, 2010 3:15 am   
 
Hello,

Well it is just not working . How can I tell if the trigger is capturing properly and assigning the value to @hp?


Thanks,
Shrake
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Jun 18, 2010 3:26 am   
 
1)put a #PRINT something to let me know which trigger this came from in the trigger code. If you see the message, then the trigger is matching.

2)locate your variable and delete the value, then cause the trigger to match again. If the variable remains blank, then even though the trigger matches there's something wrong with the code (ie, syntax error) or the pattern (ie, you forgot to use () or &).
_________________
EDIT: I didn't like my old signature
Reply with quote
Shrake
Beginner


Joined: 10 Sep 2001
Posts: 26
Location: USA

PostPosted: Sat Jun 19, 2010 6:59 am   
 
Hello,
Well I found an old trigger I used to use in Zmud. I had it make for me on this forum. Here it is :

HP~: ~[&Hp.current/&Hp.max~]%sCONC~: ~[&Conc.current/&Conc.max~]

It seems to work fine but I just cannot get the colors to work . It just stays one color even though the numbers of Current and max work. I have the colors set up as different colors . I just could not get the other Trigger to work. I might be setting up the Gauge wrong but I have checked it a few times. Any suggestions would be appreciated. If I should go back to other trigger I will .

Thanks,
Shrake
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Sat Jun 19, 2010 2:07 pm   
 
Well, if the colors aren't changing, it is almost certainly not the fault of this trigger. It is probably the settings on the gauge itself. However, I recommend changing this trigger. Currently this trigger uses a database variable for your values, which is not recommended. It can cause the gauge to be updated much more often than it needs to be, and can cause flicker. You have two options. One is to go back to your first trigger, perhaps putting a %s between "]" and "Conc" as you have in the second trigger. The first trigger might not have been working because there was more than one space there, and it wouldn't match. The second option is to change the second trigger to use individual variables, like this:
Code:

HP~: ~[&hp/&hpMax~]%sCONC~: ~[&cp/&cpMax~]

As for the gauge itself, can you post the actual XML of your gauge so we can see how it is set? Open the gauge in the Package Editor, click on the XML tab, and cut and paste it here in this forum, within [code]...[/code] tags.
Reply with quote
Shrake
Beginner


Joined: 10 Sep 2001
Posts: 26
Location: USA

PostPosted: Sat Jun 19, 2010 8:55 pm   
 
Hello,

I put the %s in and it worked like a charm(Colors too). I want to thank you all for helping out on this. I know it was a pain and thanks for your patience.

Cheers,
Shrake
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net