Loading and running a LUA script in a mod using Modbuddy

Kebnoa

Chieftain
Joined
Mar 31, 2016
Messages
33
Location
Barcelona, Spain
Okay,

So, I know this should be basic, but I can't seem to find the right set-up to run the lua in my mod.

I have ModBuddy and FireTuner installed and working. I've created the MOD and it is installed (That is, I see it in Mods.sqlite with the appropriate information).

I have added a lua file with a single print statement. I have also added and In-Game action ImportFiles and selected this script. I have tried using AddGamePlayScripts with now luck. I'm expecting to see this output of the print statement in the lua.log file.

What am I missing?

Thanks
kebnoa
 
Last edited:
just to be sure, you're looking at the logs after starting a game with the mod activated or just after activating the mod in the menu ?

for In-Game action you need to refer to a XML file here, it can be empty but must have the same name as the lua script (without the extension)

but Gameplay script should output what's in your print on loading/starting a game.
 
Hi Gedemon, thank you for the quick reply.

Yep, this is post load of the game. I am using the AddGameplatScripts only and when I look in the mods.sqlite post game start it reflects the file etc, so pretty sure this part is as it should be.

I have disabled all other mods except those provided by R&F expansions and DLC.

Any other suggestions?
 
I feel very foolish, but I did find the cause.

I had the "Affects Saved Games" checkbox checked and the Mod was simply not firing when I was opening the saved game. At least I am pretty sure this is the case as I unchecked it and now all is good. Makes sense as well.

Thanks for the help Gedemon. (The clear statement about "AddGameplayScripts" made a big difference!)
 
just to be sure, you're looking at the logs after starting a game with the mod activated or just after activating the mod in the menu ?

for In-Game action you need to refer to a XML file here, it can be empty but must have the same name as the lua script (without the extension)

but Gameplay script should output what's in your print on loading/starting a game.
It is not necessary for an AddGameplayScripts type of Action to have an XML file. He needs to not attempt "importing" and instead simply use an AddGameplayScripts so long as he is not attempting to introduce a new User Interface, and is not attempting to re-write one of the game's original UI files.

The Affects Saved Games is needed for any script that makes actual game-changes, but it also as OP found does not allow the mod to actually be enabled unless an entirely new game is started.
 
Back
Top Bottom