Weirdness with states: help please!

Pazyryk

Deity
Joined
Jun 13, 2008
Messages
3,584
I have some functions in MyModUtils.lua. This file is included in MyModMain.lua and MyModPopups.lua and everything is great. When I go in the tuner I see a single state for MyModMain and MyModPopups as expected (these are both UIInGameAddins and don't include each other).

However, I have started to modify LeaderHeadRoot.lua/.xml. Perhaps relevant here, I included MyModUtils.lua in LeaderHeadRoot.lua (it has functions I will need to call from here). Now when I run tuner, I see only one LeaderHeadRoot state but a total of 8 MyModMain states and 8 MyModPopups states.

Can someone tell me if the above scenario sounds like it should work, without the state proliferation, or if I caused the problem through stupid programming? (I only have a weak grasp on this state/thread business, but I thought I was doing pretty good up to now.)
 
are you using InGameUIAddin and VFS = true on the same file ?
 
yes. Is that bad? I always set VFS=true for everything. MyModMain and MyModPopups are both InGameUIAddin. Should these be VFS=false?
 
yes. Is that bad? I always set VFS=true for everything. MyModMain and MyModPopups are both InGameUIAddin. Should these be VFS=false?

Exactly, don't use VFS = true for files you're adding directly (like UIAddin, UpdateDatabase, etc...)
 
Thanks! That fixed the problem.

The reason I didn't understand this is that I was doing it wrongly and getting away with it. You can set VFS=true for everything (as I was doing) and it works fine up to a point, then causes problems. Hope others can learn from my mistake.
 
Back
Top Bottom