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
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Fri May 01, 2020 10:46 am   

MultiState button
 
I want to set up a multistate button which affects the outcome of another button.

EG.,

A 'bash' button which (obviously) bashes a target.

Aardwolf has a bunch of (I think superfluous) trainable skills which all perform the same damage and often at the same level.

Level 1
kick
dirt kicking
black root

Level 4
trip

As you can see, there is little point in using the level 1 skill once a higher level skill has been learned.

Currently, I have a class set for each possible skill and it only activates once the trained level is 50% or above and this activates a premade button which I can click and perform that skill. However, the previous skills still exist as available buttons. So, given the redundancy in skills available/learned, I though that I could just use the class (when activated) to set a possible button state rather than a separate button. I just select which skill via button state selection and that populates a variable that the 'BASH' button uses.

Does this make sense so far?

So...the question is:

How to set a button state via script?
Reply with quote
shalimar
GURU


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

PostPosted: Fri May 01, 2020 12:56 pm   
 
That seems overly complicated to me.
Buttons are meant to be clicked, and only the most simple of clicks can be done via script (no selecting from an option list).
The #STATE command is meant to be used in #TRIGGERs and knows to target the current trigger firing.
As such, I'm not sure how to do it the way you suggest.

I would just use a #SWITCH in the body of the button, assuming you know which level you are, and which skills replace which.

#SWITCH (@level) (1) {kick} (4) {trip}
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Fri May 01, 2020 1:41 pm   
 
The problem is that skills are available at different levels for different class/race mix so I couldn't say for certain which skills would be for which level.
Reply with quote
shalimar
GURU


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

PostPosted: Sat May 02, 2020 3:15 am   
 
Well, you know the ones for the mixes you play at least, you just need more precise expressions in the #SWITCH, just make sure to order it properly, the first match is the one that fires.
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Sun May 03, 2020 5:46 pm   
 
It is working fine. It IS a shame that button states cannot be handled as other items that can be put into classes as it means there is no easy way to turn off unwanted states without turning off the entire button. IT would make the code a LOT easier.
Reply with quote
shalimar
GURU


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

PostPosted: Mon May 04, 2020 3:10 pm   
 
You could have multiple buttons that occupy the same real estate and make sure only one of them is enabled at a time.
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Thu May 07, 2020 2:20 am   
 
This may not be what you desire but If it was me I would make a simple #SWITCH for the skills list from highest level to lowest to prioritize the 'better' ones.
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Thu May 07, 2020 8:15 am   
 
Already tried something similar by having each button in a class that gets activated when the skills is practiced to a certain level, or if the skill is already practiced by a previous remort, re-activated when that skill/spell becomes available.

The problem is that the previous (weaker) skills/spells are still there unless I manually deactivate them.

As for 'stacking' buttons...that seems a bit messy really.
Reply with quote
shalimar
GURU


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

PostPosted: Thu May 07, 2020 11:53 am   
 
It is very much a mess, which is why I first suggested the #SWITCH
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Fri May 08, 2020 6:36 am   
 
Ah! But if only development was not stagnant/dead then modifications could be made. If classes can be switched on and off and button can be created destroyed then button states shouldn't create any headaches to offer the same facilities.

Maybe if you know the guy you could offer to work on it. You seem to be a competent sort of chap whose dedication to this software, and the people who bought it and use it, extends far beyond that of the guy still taking full price for it.
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