Question about modding leader traits

aspec100

Chieftain
Joined
Dec 12, 2010
Messages
8
Location
Canada
So I am trying to make a custom civilization, (just for myself, not going to upload it) but I can't quite figure out how to add the unique ability so it'll work correctly.

The Unique ability I was thinking of was +1 faith for a military unit garrisoned in a city, and +1 happiness for every religious building. How would I make this work?
 
If you're not modifying the .DLL to do so (i.e. creating new GameData tables), then you can use Lua to:

- Loop through the player's city; Get the plot of the city; Get units on plot; If there is a unit on the plot, increment a local variable (representing the number of garrisoned cities); add faith to the empire.

- Give the player free dummy (invisible) buildings that grants +1 Happiness, and add the building to the city for every Shrine/Temple/whatever that exists.
 
Do you know a website where I could learn Lua? I've never done any of this before (including XML)
 
Do you know a website where I could learn Lua? I've never done any of this before (including XML)

If you have never done any programming before, I would suggest taking a course or two in introductory computer science at your educational institution (most universities/colleges will offer some form of CS, high schools may or may not depending on the resources available to them, such as teachers and computer workstations).

That being said, here are some places to start:

http://modiki.civfanatics.com/index.php/Lua_and_UI_Reference_%28Civ5%29
http://www.lua.org/start.html
http://wiki.garrysmod.com/page/Main_Page


As for the XML:
http://modiki.civfanatics.com/index.php/Civ5_XML_Reference
http://kael.civfanatics.net/files/ModdersGuide.pdf (warning: some parts are outdated).
 
Back
Top Bottom