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
Bluebear
Beginner


Joined: 10 Oct 2007
Posts: 17

PostPosted: 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.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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.
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