hazel16
Chieftain
- Joined
- May 5, 2014
- Messages
- 64
First, thanks to all for the wonderful modding posts and tutorials. There's a reason this is the first time I've had to post a question here.
I'm making a mod for BNW that does not use the tourism system, so I'm trying to hide tourism from the TopPanel. I've successfully done this by modifying TopPanel.lua but would like to avoid this method so I can preserve compatibility with other mods (like IGE).
The following works elegantly in FireTuner (with state set to InGame):
But returns a "attempt to index a nil value" error when I include it in my mod's lua files. I've tried many variations, including
- above command alone in its own Lua file
- command changed to:
- command in a function called on ActivePlayerTurnStart
- setting Lua file as InGameUIAddin
- setting VFS true/false
And always get the nil value error.
My code currently looks like this:
What am I missing?
Thanks in advance!
I'm making a mod for BNW that does not use the tourism system, so I'm trying to hide tourism from the TopPanel. I've successfully done this by modifying TopPanel.lua but would like to avoid this method so I can preserve compatibility with other mods (like IGE).
The following works elegantly in FireTuner (with state set to InGame):
Code:
ContextPtr:LookUpControl("/InGame/TopPanel/TourismString"):SetHide(true)
But returns a "attempt to index a nil value" error when I include it in my mod's lua files. I've tried many variations, including
- above command alone in its own Lua file
- command changed to:
Code:
ContextPtr:LookUpControl("../TourismString"):SetHide(true)
- setting Lua file as InGameUIAddin
- setting VFS true/false
And always get the nil value error.
My code currently looks like this:
Code:
print("H_Hide_Tourism.lua loaded!!!!!!!!");
function C_HideTourism ()
ContextPtr:LookUpControl("/InGame/TopPanel/TourismString"):SetHide(true);
end
Events.ActivePlayerTurnStart.Add(C_HideTourism());
What am I missing?
Thanks in advance!