What is LUA and what does it do?

varus

Prince
Joined
Nov 3, 2005
Messages
130
What is the LUA and what is its function in the game? I see that it is a scripting language and I have found this which is very helpful. But how can I apply what I learn in those tutorials to Civ V?

When I open up a LUA file in ModBuddy, they look so foreign to me even after having browsed some of the tutorials. What exactly does the LUA do to the game? Is it capable of running real time or detecting events in the game?

If it can, then wow, I need to learn how to use it.
One of the things I would like to accomplish is to add collateral effects to units. For instance, each enemy unit in my territory causes -1 happy or each City Guard unit in a city adding +1 culture.

For that sort of thing to work the game would need to react every time I move a unit, or the AI moves a unit into my territory. Is this achievable with LUA?

Can it be done in a mod at all?

How can I learn to do it?
 
To learn how to use Lua the way it is used in the game,you should either look in each Lua file of the game (and read the comments,they're useful),or wait until Firaxis release more info on it
There is a reference available somewhere in the game files (or maybe in sdk)but it's very unuseful because it's uncompletely documented
 
i think the easiest and simplest thing to start off with explaining as to what lua can do, is enabling it to get extra information from your games. when you get more complex lua can affect objects in your game (from units to the numbers being displayed)

and i don't believe we'll ever get full documentation on it, ever. it's not that hard to figure out though :)
 
Back
Top Bottom