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
ganmo
Beginner


Joined: 23 Oct 2008
Posts: 18

PostPosted: Mon Oct 18, 2010 7:26 pm   

Gauge tutorial?
 
Hey,
I'm totally new in using the more advanced features in cmud. I only came as far as using the automapper feature.
Anyway I wonder if there's some guide for newbies to make a hp/sp gauge out there? The ones I seen I didn't understand them.

What I know is that you at least has the get the hp/sp info from the buffer. I know also that you have to write a trigger to do that,
but that's where i am stuck. I don't know how to write a trigger.

The only trigger that I have tried which also worked is the ones which switch colour of some certain text.

For example:
pattern: What?
#CW
#setcolor orange

I think it was like that probably. Wrong.

Anyway how do I get the hp/sp info to a gauge, if the line looks like this:
** HP: 202/202 SP: 202/202
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Mon Oct 18, 2010 7:50 pm   
 
Assuming your prompt follows the order value/max_value, go into the package editor and create a new trigger. Then click on the xml tab and paste the following into the text box on the right side.
Code:

<trigger priority="10" newline="false" prompt="true" id="6">
  <pattern>^~*~*%sHP:%s(%d)/(%d)%sSP:%s(%d)/(%d)</pattern>
  <value>#var HP %1
#var HP_Max %2
#var SP %3
#var SP_Max %4</value>
</trigger>


Click save and your trigger is finished. Adjust the trigger on prompt or trigger on new line options if it isn't firing. Now you can set up you gauges using the @HP, @HP_Max, @SP, and @SP_Max variables that the trigger will create.

For the gauges:
Create a new button in the package editor.
Select Gauge from the type drop down box.
Click save.
Select the Gauge tab at the bottom of the editor.
In the Value: box type @HP
In the Max: box type @HP_Max
Adjust the Gauge color and background colors to your liking.
If you want the numeric values displayed on the gauge too in the Caption: box type @HP/@HP_Max
Click save.
You can adjust the size and where they are displayed in the Options tab.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
ganmo
Beginner


Joined: 23 Oct 2008
Posts: 18

PostPosted: Mon Oct 18, 2010 10:52 pm   
 
Thanks for the tutorial.
I followed it however it doesn't work. I guess it might be the trigger.
If you got time to spare, you can try it out maybe?
the mud I need help with is mud.lysator.liu.se port: 2000.
You have to toggle hpinfo also.
Reply with quote
ganmo
Beginner


Joined: 23 Oct 2008
Posts: 18

PostPosted: Mon Oct 18, 2010 10:57 pm   
 
nvm it works now
*cheers*

:)

I just wonder one more thing. Since I got GUI for hp/sp, is it possible to filter the hp/sp info out from the buffer?
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Tue Oct 19, 2010 4:24 am   
 
Yeah if you want your prompt (the line containing hp/sp info) to not show:
Open the package editor up.
Select your prompt trigger.
Go over to the script box input box and add #GAG in like I have below.
Code:
#var HP %1
#var HP_Max %2
#var SP %3
#var SP_Max %4

#gag

That will just give you a blank line where the prompt originally was. You could also do something like:
Code:
#var HP %1
#var HP_Max %2
#var SP %3
#var SP_Max %4

#sub >

Which would replace the prompt string with a single > if you wanted something to break up the text a little.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
ganmo
Beginner


Joined: 23 Oct 2008
Posts: 18

PostPosted: Tue Oct 19, 2010 5:03 pm   
 
works great now, thanks Very Happy
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