Where can I find Lua source code?

Galgus

Emperor
Joined
Aug 22, 2012
Messages
1,705
I'm considering trying to learn Lua coding, but I'm not exactly sure where to look.

Where can I find lua code used for things in-game for reference?

It was much easier for me to learn some XML code by looking at game code than by deciphering lists of code.
 
It's located in several different places, depending on the type of code (UI/map scripts/scenario scripts/etc.) To find all the .lua files, go to the folder where you have installed Civ5 (usually it's c:\program files (x86)\steam\steamapps\common\Sid Meier's Civilization V) and search for *.lua :)

Edit: As otaman1 suggested, you can also check the Lua code in existing mods.
 
This is the best place to look for examples of lua usage, since lua is what makes all the screens and buttons go:
C:\Program Files (x86)\Steam\SteamApps\common\sid meier's civilization v\Assets\UI

The lua api contains all the things that you can access and manipulate:

C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V SDK\CvGameCoreSource\CvGameCoreDLL_Expansion2\Lua
 
Back
Top Bottom