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
HollyC
Novice


Joined: 10 Apr 2003
Posts: 45
Location: USA

PostPosted: Wed Jun 22, 2005 3:34 am   

Creating buttons
 
I'd like to create some buttons for the MUD Achaea. Although the buttons would be used for Achaea, I believe the concept is generic enough that it could apply to any game.

The main function of the button would be a push-type button, which executes a game command when pushed. However, I would also like the button to have two different colors, depending on whether or not a certain variable is at or greater than a set number.

For example, say the variable's name is GAUGE, with no default value. Other commands in the game would raise and lower the value of gauge depending on the situation (for those familiar with how the game Achaea works, the variable would keep track of the number of fashions on a specific vodun doll--- fashion commands raising it and using vodun skills lowering it by the appropriate number of fashions required to use the skill).

Now there are several buttons, let's call them BTN1, BTN2, BTN3, and BTN4. Each of them would have a default color of black text and no background color.

If the value of GAUGE is 10 or greater, the color of the BTN1 button would change to yellow text on a dark blue background. Pushing (clicking on) the BTN1 button would execute a specific command (for those familiar with how Achaea works, let's say it executes the CONFUSE command in Vodun. The color of the button, changing according to the value of the GAUGE variable, would tell me if I have the minimum number of fashions to use the command).

If the value of GAUGE is 15 or greater, the colors of both the BTN1 and BTN3 buttons would change to yellow text on a dark blue background. BTN1's script would say #IF (@gauge >= 10) and BTN3's script would say #IF (@gauge >=15). Etc. Each button would change color depending on what the value of the GAUGE variable. If appropriate commands lower the value of GAUGE from 15 down to 12, BTN3 would revert to black text and no background color. If it went down from 15 to 8, then both BTN3 and BTN1 would revert back to the first color.

Is it possible or feasible to script this? Can the MULTISTATE button state (as opposed to PUSH or TOGGLE) accomplish this? Or am I asking too much of ZMud's scripting abilities?

Holly
_________________
Reply with quote
demoneyoungblood
Apprentice


Joined: 16 Dec 2002
Posts: 114
Location: USA

PostPosted: Wed Jun 22, 2005 8:13 am   
 
It is possible using btncol, but I have not played with that function enough to help you, reading up on it, you might be able to figure it out, as far as the variables changing and whatnot, you will have to set triggers based on the text recieved, perform the math, and have the trigger do the appropriate btncol routines. You are basically looking at a more sophisticated form of a "stats guage". anyways, the following is the reference page for btncol:
http://forums.zuggsoft.com/modules/mx_kb/kb.php?mode=doc&index=%25btncol&page=3&refpage=3
_________________
-Demone YoungBlood
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Jun 22, 2005 9:16 am   
 
I would suggest setting up the buttons as actual guages first. You can then put command text in the button to use for when you push it. This will provide a better visual display of your variables.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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