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
horks
Apprentice


Joined: 20 Jul 2001
Posts: 127
Location: USA

PostPosted: Thu Jul 31, 2003 3:46 am   

Changing Button Captions
 
Hey guys.

Small problem, I thought it'd be simple, but I'm stumped.

Basically, I have a button being used as a gauge for a skill. I want to open up my scripts to a few friends, but some skills they use are opposite to mine. For each skill there are only two options, so I want to be able to click on the button/gauge and change the caption and values of the gauge to the other skill.

for example:

one of the skills is Footsoldiery, the opposite is Horsemanship. I use footsoldiery, so I want the caption to read:
Code:

@fskl-F: @fskd (@fsk)

(variables just define different earnings of the skill. Just note they all start with an "F" for footsoldiery Smile )

I want to be able to click on the gauge, and have it switch the caption to:
Code:

@hskl-H: @hskd (@hsk)

This is as far as I got.
Code:

#if (@fhBtnState="foot") {
  #bu fhBtn {<font color="green"><i>switch cap & cur/max guage values</i></font id="green">}
  #var fhBtnState {horse}
}
{
    #bu fhBtn {<font color="green"><i>switch cap & cur/max guage values</i></font id="green">}
    #var fhBtnState {foot}
}



Can someone fill in the blanks for me? :)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jul 31, 2003 7:07 am   
 
The simple (and obvious) solution would be to tell your friends to use @fskl, @fskd, and @fsk for their horsemanship, even though it's the wrong letter...

Anyway, I'd recommend using %if in the appropriate fields instead of using the button to rescript itself. For instance, change the caption to:

%if( @fhBtnState = "foot", @fskl-F: @fskd (@fsk), @hskl-H: @hskd (@hsk))
Reply with quote
horks
Apprentice


Joined: 20 Jul 2001
Posts: 127
Location: USA

PostPosted: Thu Jul 31, 2003 8:24 pm   
 
Hey thanks lightbulb!! I didn't even think of putting an if statement in the caption. I can simulate the switch by clicking the gauge feature i was trying to get by making the button switch the @fhBtnState var.

But what about the gauge values? I don't want the gauge showing % to footsoldiery skill when it's got the horsemanship caption. Can I put an if statement in the value line for the guage?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jul 31, 2003 10:22 pm   
 
I would think so. Haven't you tried?
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