|
Erasmus Wanderer
Joined: 04 Aug 2004 Posts: 82 Location: Philadelphia
|
Posted: Fri Jun 11, 2010 12:08 pm
Button Update/Flicker/Lag Issue |
I remember Zugg posted recently a lengthy post explaining why CMUD is lagging when buttons are updated, but I can't for the life of me find the post. I remember the issue has to do with buttons update when the value of the variable is changed which can cause a button to update several times if the variable is a database variable that has multiple changes at the same time.
Can anyone point me to this post?
Is it best practice to set each variable associated with a button as a "regular" variable, and not a string list or database record? If I have a gauge for health that displays current and max health, and the variable set with those values is a 2 key database variable will the gauge update 4 times, or just 2 if both values change? |
|
_________________ Erasmus |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Jun 11, 2010 1:57 pm |
Yes, you are remembering the gist of the post (I don't have a link to it offhand). And yes, it is best practice to use regular (single-value) variables for buttons, for exactly this reason.
In the situation you describe, the gauge would update two times if both values are changed independently. Each key/value pair is a single item in the db variable. If you add a key/value pair, it is one change. If you change the value of an existing key, it is one change. If you delete a key/value pair, it is one change. On the other hand, there is a way to make the variable update only one time. This would be done by copying the variable into a local variable, updating the all the keys in the local variable, then setting the global variable equal to the updated local variable. |
|
|
|
Martaigne Wanderer
Joined: 05 Jan 2002 Posts: 88 Location: Atlanta, GA
|
Posted: Fri Jun 11, 2010 6:15 pm |
Wow, this question helped me too. Thanks!
|
|
|
|
|
|
|
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
|
|