Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Vesence
Beginner


Joined: 12 Mar 2006
Posts: 22

PostPosted: Mon Dec 03, 2007 1:10 am   

[2.14a Pro] Status Window not Immediately Updating on Database Variable change
 
So I have two events, Afflict and Unafflict
Afflict adds %1 to a string list contained within a database variable
so #show @Plant_afflictions.Current_afflictions displays: Addiction|Insomnia

One of my status window's displays
Plants: @Plant_afflictions.Current_afflictions

The problem is that whenever I call #raise Afflict Insomnia (or Addiction or whatever) the variable changes immediately, but the status window doesn't update until either a new line is received from the MUD or I change another variable that is displayed in the status window.

The other variable that has to get changed is one that is plain number like #var Current_Health 4.

I can get you more info if it's needed.
_________________
Achaea
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Dec 03, 2007 6:14 pm   
 
The status bar can only track updates of direct variable values. A database variable is only supposed to contain string values. When you start nesting string lists within database variables (or string lists within other string lists), then CMUD cannot track automatic status bar updates. You need to create a main-level variable that you update to force the status bar to refresh. The status bar just can't look recursively for deep-level changes like this or else it would be tremendously slow.

What many people do is to create a variable called @UpdateBar (for example) and just increment this variable whenever you want the status bar to update. Then in your status bar you can have %if(@UpdateBar,,) in it. This will cause the status bar to update whenever the @UpdateBar variable is changed.
Reply with quote
Vesence
Beginner


Joined: 12 Mar 2006
Posts: 22

PostPosted: Mon Dec 03, 2007 8:32 pm   
 
Got it, and fixed that.

Thanks for enlightening me.
_________________
Achaea
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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