|
Psychic Newbie
Joined: 11 Oct 2002 Posts: 2 Location: United Kingdom
|
Posted: Fri Oct 11, 2002 10:33 pm
Temporarily Disabling Buttons |
I have a selection of buttons that cast spells when clicked & pop up by trigger when the spell runs out.
What I am trying to do, is have a different trigger set the button to down, but I dont want the Buttons command to work. Ie I dont want the spell cast again.
At the moment, I have it working by having all the buttons in a class, and disabling the class whilst I update the button variable, then re-enable the class. But doing this causes a lot of delay and flickering because it has to redraw all the buttons as the button is removed then put back. Can the button action be disabled without hiding the button whilst I update its state? |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Oct 11, 2002 10:49 pm |
Yes.
I would have to see you exact current script to figure how best to work around the default zMud behavior. |
|
|
|
Psychic Newbie
Joined: 11 Oct 2002 Posts: 2 Location: United Kingdom
|
Posted: Fri Oct 11, 2002 11:46 pm |
Thanks....
Ok, taking one as an example:
Toggle Button (Variable set to Sanc in Class Buttons)
Up State Value cast 'sanctuary'
Down State is Blank
So when pressed is casts Sanctuary
First Trigger:
Text: The white aura around your body fades.
Value @Sanc = 0
This Toggles the State of the Button to Up
That works fine.
Now, the new trigger is for when I being up spell effects in the mud.
Text: You are affected by the following spells:
Value: @Sanc = 0
This turns the button off by default is case the spell is down....
Text: Spell: sanctuary
Value:
#CLASS Buttons 0
@Sanc = 1
#CLASS Buttons 1
This is how I set the button to down again without triggering the spell to be cast.
Without the class/button disabled, when I set the Variable the button fires the spell.
But, by disabling the button/class, Zmud removes it from the screen, causing a flickering redraw, then again when the button/class is re-enabled.
Multiply this button by 20 spells and the whole thing is just a lot of lagging and flickering whilst the update happens.
I want to disable the script of the button whilst I update it, not disbale the button...just dont know how... |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Oct 12, 2002 3:16 am |
Replace the button commands with aliases. Make two sets of aliases and put them in separate classes. The first class will have the normal alias which casts the spell. The second class will have aliases that just do a #NOOP.
Toggle Button (Variable set to Sanc in Class Buttons)
Up State Value csanc
Down State is Blank
#CLASS normal
#AL csanc {cast 'sanctuary'}
#CLASS 0
#CLASS noops disable
#AL csanc {#NOOP}
#CLASS 0
Text: Spell: sanctuary
Value:
#T- normal;#T+ noops
@Sanc = 1
#T- noops;#T+ normal
LightBulb
Senior Member |
|
|
|
|
|