Looking for references to help me out with LUA

Putmalk

Deity
Joined
Sep 26, 2010
Messages
2,652
Location
New York
I know what you're thinking - I can clearly google the LUA references on the Civ 5 wiki.

But that's not what I'm looking for. I'm looking for mods and stuff which utilize LUA to help me with:

- At the start of a scenario, Civilization X and Civilization Y are best buds and have a DoF signed already. However, Civilization X and Civilization Z are very mad at each other, have denounced each other, but have not yet declared war. However, war is likely between the two.

- After turn X has passed, Civilization Z is forced to declare war on Civilization X.

- After turn X has passed, the relationship between Civilization X and Civilization Y have soured and Civilization X is forced to denounce Civilization Y.

I'm really looking for someone's code; I learn a lot faster when I see something applied correctly, something which I can study off of. There isn't a tutorial for affecting diplomacy via LUA that I can find, so this will do.

Any help will be much appreciated.

(also my LUA files don't seem to want to work in-game, but I think I can fix that by just studying how someone else got the game to recognize the LUA file).
 
An often overlooked source of information are the TurnsRemaining.lua files in the DLC scenarios

Probably won't answer these specific questions but might give you pointers to similar events/methods which will get you to the final goal
 
I'm really looking for someone's code; I learn a lot faster when I see something applied correctly, something which I can study off of. There isn't a tutorial for affecting diplomacy via LUA that I can find, so this will do.

R.E.D. WWII Edition, look at the RedDiplomacy.lua file
 
Yeah, I looked through that + TurnsRemaining.lua for the scenarios...completely lost.

Not to mention, it seems the game isn't registering that my LUA files exist, even though I've imported them into VFS.

How would I simply make a positive modifier between two specific civs using GameEvents.GetScenarioDiploModifier1.Add()?
 
Not to mention, it seems the game isn't registering that my LUA files exist, even though I've imported them into VFS.

Assuming the code is self-contained, you don't set VFS=true (ie leave it false) but you do need to add an InGameUIAddin entry for the lua file
 
Back
Top Bottom