How do I load a modded Lua file?

rspeer

Spearman
Joined
Apr 5, 2006
Messages
101
I'm trying to make a tiny change to the game's interface Lua in Terra Incognita, so that after you load the mod it becomes the currently selected map script. One less step for users to go through.

The way to change this seems to be to modify UI\FrontEnd\GameSetup\GameSetupScreen.lua. I copied it into Lua\GameSetupScreen.lua in my mod, changed what I wanted, and... nothing.

I can put print statements, blatant errors, whatever I want into this script and it doesn't seem to change anything in the game or in FireTuner.

How do I tell the game to actually load my version of the script? Kael's guide doesn't say.
 
you shouldn't need to do anything.
are you going through Mods -> Single Player to run it or starting a game from the main menu? if you don't use the Single Player option from Mods menu you won't be loading any mod.
other than that, are you sure that there are no errors in LUA?
 
I am, in fact, loading the mod and running it correctly, as evidenced by the fact that the rest of the mod (which is just a map script) works fine. The Lua doesn't give an error, either, based on my experience of what a Lua error looks like: if I put an error in my map script, it will definitely show up on the FireTuner and probably crash the game for good measure.

But I can type nonsensical function calls into my UI script with no effect at all. That's why I conclude that the Lua code is simply not running.
 
Kind of. I didn't know whether it had to be in Content, and I have no idea what its type should be. So I kind of half-assed it and made up the type (InterfaceMod). If it's supposed to be in there with a particular type, that explains everything.
 
Actually I just removed it from mine and it still loaded. However, rereading your original post, I'm not sure we can override the game setup screens through lua. They may be loaded already by the time mods get loaded, so it may just be ignoring your file. Have you tried renaming the file to a unique name and putting a print statement at the top to see if that shows up in Tuner?
 
Top Bottom