Duplicate lua files

Rob (R8XFT)

Ancient Briton
Retired Moderator
Joined
Aug 11, 2002
Messages
10,871
Location
Leeds (UK)
I confess I'm not great with lua. However, having created a "complete" version of Anno Domini all in one program, I can't help but notice that I have the same overrides in different folders - e.g. I've TopPanel.lua all over the place.

I've been given to understand that the system will actually only recognise one of each override and that having more than one could cause issues. I've deleted duplicate versions of certain lua documents to leave the one that would logically seem to be the ideal one to leave - and encountered success (in terms of "glitches" no longer happening).

My question is this: should I systemically go through the lua files and make it so there's one of each type? I would presume that I would need to look through the file and potentially add the part that's been changed to the version I'm keeping or just chose the one that works best with the game? An example would be the ReligionOverview.lua - I'm guessing that the one I need to keep is the one with the specific piety functionality that I want to use in the mod.
 
The game will load ALL of the Lua files. Duplicates will override each other, and the one that will be used will be whichever happened to load last - which may or may not be the one you want.

So yes, find and remove the duplicates - the mod will load fractionally faster and you'll know for sure which one you're actually using!
 
Does it load the vanilla lua file if you're making an InGame UI mod?

For example, I created a NewTurn.lua (with accompanying .xml) which redefines OnTurnStart, and ends with the line -

Events.ActivePlayerTurnStart.Add( OnTurnStart);​

But I'm still getting the vanilla display. I'm wondering whether it's still getting the vanilla handler.

My changes to UpdateData in TopPanel.lua are working as expected.
 
Top Bottom