User:DonQuich
From Civilization Modding Wiki
Jump to navigationJump to search
This page is a part of the Lua and UI Reference.
Parameters flagged with this pseudo-type are actually integers.
Pseudo-types do not exist in LUA, they only serve a documentation purpose on the wiki.
Integers labeled as 'PlotTypeID' corresponds to the constants defined in the PlotTypes LUA enumeration.
PlotTypes enumeration
A LUA enumeration is a just a regular table. It is commonly used to store constants, the keys being the constants' names and the pairs the corresponding values. Below are the values found in this enumeration.
Key | Value | |
---|---|---|
"NO_PLOT" | -1 | |
"PLOT_MOUNTAIN" | 0 | |
"PLOT_HILLS" | 1 | |
"PLOT_LAND" | 2 | |
"PLOT_OCEAN" | 3 | |
"NUM_PLOT_TYPES" | 4 |
Examples
Here is how to use the LUA enumeration to retrieve the ID from the 'type'. The variable 'id' will be assigned the value 4.
local id = PlotTypes.NUM_PLOT_TYPES local id = PlotTypes["NUM_PLOT_TYPES"]