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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Zener
Wanderer


Joined: 31 May 2004
Posts: 54
Location: USA

PostPosted: Wed Jun 16, 2004 8:26 am   

Prompt -> Guage + Gagging
 
What I am looking to accomplish is to make a Guage that keeps track of how much EXP I need to level. I am assuming the easiest way is to make it work off my prompt, but I do not want to "see" the EXP part in my prompt, I would like it gagged if possible, but still able to keep the guage to work.

Magic-User prompt: 1126/1126Hp 1435/1435Mana 610Mv $233,172,900 {1000} New Darkhaven - 6,557,252Exp

Vampire prompt: 1126/1126Hp 45/60BP 610Mv $233,172,900 {1000} New Darkhaven - 6,557,252Exp

The colors are not accurate due to visibility issues, but all the values that are seen are in place. But as I said above, I don't want to see the EXP value in my prompt.

Now that I think of it, if the following is possible, I'd love to have them as well.

A Guage showing my current Gold.
A Guage showing my current Alignment. (Not shown in prompt, range from -2500 to 2500)
*A Guage showing my current Geography. (Shown as New Darkhaven in above prompts)

*Would a Guage be right for this?

Note: I don't like having such a long prompt, but if the gagging works correctly, will it also gag other instances not related to my prompt? If so, how can this be avoided while still making my guages and what not possible?

Any help appreciated.

~Zener
Reply with quote
Zorprime
Newbie


Joined: 01 Feb 2003
Posts: 4
Location: USA

PostPosted: Wed Jun 16, 2004 3:02 pm   
 
How about this?

#TRIGGER {(%d)~/(%d)Hp (%d)~/(%d)Mana (%d)Mv $(%d) ~{(%d)~} (*) - (%d)Exp}{
#GAG
#VAR hps %1
#VAR maxhps %2
#VAR mana %3
#VAR maxmana %4
#VAR mov %5
#VAR cash %6
#VAR alignment %7
#VAR location %8
#VAR experience %9
#SHOW HP: @hps~/@maxhps MANA: @mana~/@maxmana MV: @mov ~$@cash
}

#BUTTON 1 {Cash: @gold} {} {} {} {@cash} {} {} {} {} {} {} {} {} {} {} {} {} "" {} {Cash: @gold} {cashguage}
#BUTTON 2 {Alignment: @alignment} {} {} {} {@alignment} {} {} {} {} {} {} {} {} {} {} {} {} "" {} {Alignment: @alignment} {alignguage}
#BUTTON 3 {Geography: @location} {} {} {} {@location} {} {} {} {} {} {} {} {} {} {} {} {} "" {} {Geography: @location} {locateguage}
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Wed Jun 16, 2004 3:10 pm   
 
First question I have is, is the 6,557,252 how much exp you need for next level, or how much you have already? If the latter, then you'd have to add a calculation to figure the next part.

I would use something along the lines of:
quote:

#TR {^&%d{HP}/&%d{MaxHP}Hp &%d{MP}/&%d{MaxMP}Mana &%d{MV}Mv ~$&%d{Gold} ~{&%d{Alignment}~} &Location - &%d{Exp}Exp} {#GAG;#SH @Location ~>}


I would then create my gauges for HP, MP, Alignment, and maybe Exp. For gold and location, I'd set regular buttons with @Gold and @Location as their captions, since they're not on any actual scale.

Easiest way to create the gauges is manually (this example for HP)... in the Settings, create a New Button. In the Edit Button dialogue (Button States tab), change Kind from Push (default) to Gauge. Put your caption however you want - "HP: @HP" perhaps. Change to the Gauge tab. Fill the fields appropriately: Value = @HP, Gauge Max = @MaxHP, Gauge Low = %eval(100*@MaxHP/50). This %eval will make your gauge turn color if you drop below 50% health. You could set it for a particular value of HP, but then you'd have to change it again when you level up and stuff.

I hope this helps.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Jun 16, 2004 6:11 pm   
 
#GAG is a line-command, meaning it gags an entire line not just a part of it. There is no command to gag a portion of a line, the closest you can come is to substitute a null-string for the undesired portion. Because #SUBSTITUTION triggers are handled differently from other triggers, I'd recommend one trigger to do the substitution and another trigger to set variables.

#TR {(%n)/(%d)Hp (%n)/(%d)Mana (%n)Mv ~$(%n) ~{(%n)~} (*) - (%n)Exp} {
#VAR hp {%1}
#VAR maxhp {%2}
#VAR mana {%3}
#VAR maxmana {%4}
#VAR mv {%5}
#VAR gold {%6}
#VAR UnknownNumber {%7}
#VAR Geography {%8}
#VAR exp {%9}
} {} {prompt}
#TR {%nExp} {#SUB ""} {} {nocr|prompt}

You may have noticed that I used %n for some numbers and %d for others. I use %n for numbers which may contain commas or might go below zero, since %d won't match these. I use %d for numbers which I am sure won't go below zero and won't contain commas. I used @UnknownNumber for %7, {1000}, because I can't guess what it is. I would have thought it was alignment except you told us that alignment isn't in the prompt.

You might also notice that in the first trigger I only used the 'prompt' option but in the second I also used the 'nocr' option. The first trigger only sets variables and it doesn't matter if it fires twice and repeats its commands. The second trigger alters the display so it could be important to make sure it doesn't fire twice, hence the 'nocr'.

What Zorprime recommended is gagging your entire prompt, then recreating the parts of it you want using #SHOW. I'd recommend against using his trigger because it doesn't include any options to make it a prompt trigger. Instead of firing when the prompt is received, it will fire when a newline is received and blank the entire line, including anything on the same line following the prompt. Geniusclown's trigger also has this problem. If you prefer either of their triggers, I'd recommend setting the options to 'nocr|prompt' (that's Newline off and Prompt on, if you're using the Settings Editor) and replacing #SHOW with #SHOWPROMPT.

Note to geniusclown: Gauge Low is intended to return a value, so it already evaluates its expression. Using %eval won't hurt anything but it isn't necessary. The same is true of the Gauge tab's Value and Gauge Max fields.
Reply with quote
Zener
Wanderer


Joined: 31 May 2004
Posts: 54
Location: USA

PostPosted: Wed Jun 16, 2004 10:08 pm   
 
First off, I currently have gauges for my hp mana/bp and movement points. But I do *NOT* want to "see" my prompt, ever. Unfortunately if this is not possible, then I will have to deal with it being on. I am not sure what I was thinking when I posted that. 1000 to -1000 is the Alignment range, and it IS infact in the above prompts, sorry.

I will make a test character and try out all 3, then I'll give y'all some feed back...

~Zener
Reply with quote
bozo
Beginner


Joined: 15 Jun 2004
Posts: 11

PostPosted: Wed Jun 16, 2004 10:16 pm   
 
for my 2penneth worth my MUD is set up as Zorprime and Lightbulb suggest but the variables are then used in button guages which turn red if the percentage drops below given limits, which then fires other triggers to try to rectify the situation.

I gag the ebtire line im not interested in seeing it (Im just interesetred in the guages)

The command to get the status information obviously needs to be called to update the guages. This can be done either in the timer or when moving rooms or in "fight mode", when you will be using mp hp and sp etc, or a combination of all 3
Reply with quote
Zener
Wanderer


Joined: 31 May 2004
Posts: 54
Location: USA

PostPosted: Wed Jun 16, 2004 10:56 pm   
 
Ok LightBulb, yours worked beautifully after I made the guages manually. The thing is, I still don't want to see my prompt. If it's possible to maybe capture and/or replace it with blank space or send it to a different window that I can't see, that would be awesome.

~Zener
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed Jun 16, 2004 11:12 pm   
 
#HELP GAG

Delete Lightbulbs 2nd trigger and edit the first one like this

#TR {(%n)/(%d)Hp (%n)/(%d)Mana (%n)Mv ~$(%n) ~{(%n)~} (*) - (%n)Exp} {
#VAR hp {%1}
#VAR maxhp {%2}
#VAR mana {%3}
#VAR maxmana {%4}
#VAR mv {%5}
#VAR gold {%6}
#VAR UnknownNumber {%7}
#VAR Geography {%8}
#VAR exp {%9}
#GAG
} {} {prompt}
Reply with quote
Zener
Wanderer


Joined: 31 May 2004
Posts: 54
Location: USA

PostPosted: Wed Jun 16, 2004 11:21 pm   
 
Heheh before I read your post Nexela, I already deleted the 2nd Trigger and added #GAG ;) Strange...

~Zener
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jun 17, 2004 3:56 am   
 
Yes, in your first post you said you didn't want to see the EXP part in your prompt. If you don't want to see any of the prompt, #GAG is the command to do it and you don't need the #SUB trigger.

With the #GAG command added to the trigger, you should probably add the 'nocr' option or turn off the Newline option in the Settings Editor.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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