|
Bluebear Beginner
Joined: 10 Oct 2007 Posts: 17
|
Posted: Mon Jan 28, 2008 6:06 pm
Events |
I have been looking at the use of events typically on my prompt, to replace lots of #if statements, as per the extended helpfiles available on line.
I use a series of toggle buttons at the bottom of my screen to turn on and off different modes, with the controlling variable in the correct field of the button. This is very helpful because I very easily see which of my modes is on and which is off without having to look through variables.
Is there a way to directly link the state of a button to the state of an event? Using #t- in the code section of the button can sometimes lead to unsyncing due to manually overriding one or other of the settings, or them not being synced when you first start a session. I have often wondered if classes may be controlled in this way to.
Thanks. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Jan 28, 2008 6:16 pm |
Unfortunately there's not an easy way. Were it me, I'd write a CheckEventStatus button that'd use MXP to print the status of each event with a link to enable or disable it, and use that instead of buttons. One thing you could do is have an EventStatus data record variable, and then a function ToggleEventStatus that does something like "#if (%db(@EventStatus,%1)) {#t- %1 event;#addkey EventStatus %1 0} {#t+ %1 event;#addkey EventStatus %1 1}" and then use @EventStatus.eventname as the controlling variable for your button.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Jan 29, 2008 5:25 pm |
I use events to set variables which control buttons and gauges. As you say, sometimes I do see buttons out of sync with game status, usually when first connecting. I have not come up with a perfect solution for this yet, but I keep looking, when I can.
I do also use events to turn certain classes on and off. |
|
|
|
|
|