|
Vesence Beginner
Joined: 12 Mar 2006 Posts: 22
|
Posted: 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 |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
Vesence Beginner
Joined: 12 Mar 2006 Posts: 22
|
Posted: Mon Dec 03, 2007 8:32 pm |
Got it, and fixed that.
Thanks for enlightening me. |
|
_________________ Achaea |
|
|
|
|
|