iElden
Chieftain
- Joined
- Oct 23, 2021
- Messages
- 3
Hello,
I have a huge trouble with my FrontEnd modding.
The include() function seem to work as expected but once a game have started, and then I return to the mainmenu, my mainmenu.lua is correctly loaded but now the include() function seem to have no result.
Exemple:
I have two file, mainmenu.lua and MyImportedData.lua.
let's assume the MyImportedData.lua contains following code :
On my MainMenu (and other many file), I have this code:
Before I ran any games, I always get "true" as result, and once I got into a game and return to the mainMenu, the result is "false" and the print statement inside MyImportedData.lua is never executed.
On the modInfo, I import the files as the following :
I wonder how can I fix it since I really need the use of the "include" statement, putting all into the
The include() function seem to work fine after a return to the main menu for Firaxis file, but not for my included file.
If anyone has any insight to give me on how the "include" function works, I would be very grateful and happy - I've been racking my brains over it for several hours.
Thank you very much.
I have a huge trouble with my FrontEnd modding.
The include() function seem to work as expected but once a game have started, and then I return to the mainmenu, my mainmenu.lua is correctly loaded but now the include() function seem to have no result.
Exemple:
I have two file, mainmenu.lua and MyImportedData.lua.
let's assume the MyImportedData.lua contains following code :
Code:
print("MyData loaded");
ExposedMembers.myDataIsInit = false;
function InitializeMyData()
...
ExposedMembers.myDataIsInit = true;
end
InitializeMyData();
On my MainMenu (and other many file), I have this code:
Code:
function OnShow()
ExposedMembers.myDataIsInit = false;
include("MyImportedData");
print("result=", tostring(ExposedMembers.myDataIsInit))
...
Before I ran any games, I always get "true" as result, and once I got into a game and return to the mainMenu, the result is "false" and the print statement inside MyImportedData.lua is never executed.
On the modInfo, I import the files as the following :
Code:
<FrontEndActions>
<ImportFiles id="FrontEnd">
<File>MyImportedData.lua</File>
<File>ui/mainmenu.lua</File>
<File>ui/mainmenu.xml</File>
</ImportFiles>
</FrontEndActions>
I wonder how can I fix it since I really need the use of the "include" statement, putting all into the
ExposedMembers
won't work.The include() function seem to work fine after a return to the main menu for Firaxis file, but not for my included file.
If anyone has any insight to give me on how the "include" function works, I would be very grateful and happy - I've been racking my brains over it for several hours.
Thank you very much.