Lua Game Objects: Difference between revisions
From Civilization Modding Wiki
Jump to navigationJump to search
Killmeplease (talk | contribs) |
Killmeplease (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
Up: [[Lua and UI Reference]] | |||
This page contains list of known objects available. Each object has it's own page with function list and documentation. | This page contains list of known objects available. Each object has it's own page with function list and documentation. | ||
Latest revision as of 11:14, 14 February 2012
This page contains list of known objects available. Each object has it's own page with function list and documentation.
Static Methods
Objects that have single instance.
- DB -- Generic database routines
- Events -- Contains various events which are routed through the engine, principally those with UI relevance
- Game -- Methods related to the currently active CvGame instance
- GameEvents -- Similar to Events, but related to the game rules engine, rather than the UI
- GameInfo -- All game database is exposed over this object
- Locale -- Methods related to Localization
- LuaEvents -- Dynamically created events which are sent to and from arbitrary Lua states
- Map -- Methods related to the currently active CvMap instance
- Modding -- Modding and mod package management
- Network -- TCP/IP and HTTP methods
- Path -- Utilities for parsing standard paths
- PreGame -- Used to setup a game
- Steam -- Steam overlay
- UI -- User interface
Lua "Classes", or Scoped Methods
Classes can have many instances. They are usually returned as function results.
- Lua Game Objects/Area
- Lua Game Objects/City
- Lua Game Objects/Plot
- Lua Game Objects/Player
- Lua Game Objects/Team
- Lua Game Objects/TeamTech
- Lua Game Objects/Deal
- Lua Game Objects/Unit
Lua Enums
- Lua Game Objects/ActionSubTypes
- Lua Game Objects/ActivityTypes
- Lua Game Objects/AICityStrategies
- Lua Game Objects/ButtonPopupTypes
- Lua Game Objects/ButtonStates
- Lua Game Objects/CityUpdateTypes
- Lua Game Objects/CommandTypes
- Lua Game Objects/DiploUIStateTypes
- Lua Game Objects/DirectionTypes
- Lua Game Objects/DomainTypes
- Lua Game Objects/EndTurnBlockingTypes
- Lua Game Objects/FeatureTypes
- Lua Game Objects/FlowDirectionTypes
- Lua Game Objects/FogOfWarModeTypes
- Lua Game Objects/FromUIDiploEventTypes
- Lua Game Objects/GameDefines -- Similar to GameInfo.Defines but indexed by GameDefines.Name.
- Lua Game Objects/GameMessageTypes
- Lua Game Objects/InterfaceDirtyBits
- Lua Game Objects/InterfaceModeTypes
- Lua Game Objects/KeyEvents
- Lua Game Objects/Keys
- Lua Game Objects/LeaderheadAnimationTypes
- Lua Game Objects/MajorCivApproachTypes
- Lua Game Objects/MinorCivPersonalityTypes
- Lua Game Objects/MinorCivQuestTypes
- Lua Game Objects/MinorCivTraitTypes
- Lua Game Objects/MissionTypes
- Lua Game Objects/Mouse
- Lua Game Objects/MouseEvents
- Lua Game Objects/NotificationTypes
- Lua Game Objects/OrderTypes
- Lua Game Objects/PlotTypes
- Lua Game Objects/PolicyBranchTypes
- Lua Game Objects/ResourceUsageTypes
- Lua Game Objects/TaskTypes
- Lua Game Objects/TerrainTypes
- Lua Game Objects/TradeableItems
- Lua Game Objects/YieldDisplayTypes
- Lua Game Objects/YieldTypes
How to get function names for other game objects
These lists are available in ModBuddy/Help/Civ5LuaAPI.html.
Alternatively, object metatable can be obtained by calling getmetatable on non-nil object pointer. Then it is possible to iterate over all values stored in __index variable.
Example:
local plot = Map.GetPlot(0, 0) print("Attributes:") for k, v in pairs(getmetatable(plot).__index) do print(k) end print("End attributes.");