TaskType (Civ5 Type)

From Civilization Modding Wiki
Jump to: navigation, search

This page is a part of the Lua and UI Reference (Civ5).


ID.png The TaskType pseudo-type is actually a regular integer. Pseudo-types do not exist in Lua, they only serve a documentation purpose on the wiki!
  • Lua.png Integers labeled as TaskType corresponds to the constants defined in the TaskTypes Lua enumeration.


Lua: the TaskTypes enumeration

Firaxis provides a Lua enumeration named TaskTypes. This is just a regular global table. Its keys are the constants' names and the pairs the corresponding values.


Below are the values found in this enumeration.

Key Value
"TASK_RAZE" 0
"TASK_UNRAZE" 1
"TASK_DISBAND" 2
"TASK_GIFT" 3
"TASK_SET_AUTOMATED_CITIZENS" 4
"TASK_SET_AUTOMATED_PRODUCTION" 5
"TASK_SET_EMPHASIZE" 6
"TASK_NO_AUTO_ASSIGN_SPECIALISTS" 7
"TASK_ADD_SPECIALIST" 8
"TASK_REMOVE_SPECIALIST" 9
"TASK_CHANGE_WORKING_PLOT" 10
"TASK_CLEAR_WORKING_OVERRIDE" 11
"TASK_HURRY" 12
"TASK_CONSCRIPT" 13
"TASK_CLEAR_ORDERS" 14
"TASK_RALLY_PLOT" 15
"TASK_CLEAR_RALLY_PLOT" 16
"TASK_RANGED_ATTACK" 17
"TASK_CREATE_PUPPET" 18
"TASK_ANNEX_PUPPET" 19
"NUM_TASK_TYPES" 20


Examples

Here is how to use the LUA enumeration to retrieve the ID from the type. Those examples will return and assign the integer value 0.

local id = TaskTypes.TASK_RAZE
local id = TaskTypes["TASK_RAZE"]


Used by

City:DoTask(TaskType task, int data1, int data2, bool option)
Game.DoMinorGiftTileImprovement(PlayerID fromPlayer, TaskType toPlayer, int plotX, int plotY)
Game.SelectedCitiesGameNetMessage(GameMessageType message, TaskType data2, int data3, BuildingType data4, bool option, bool alt, bool shift, bool ctrl)
Network.SendDoTask(CityID cityID, TaskType task, int plotIndex, int arg3, bool arg4, bool alt, bool shift, bool ctrl)
Network.SendSetCityAIFocus(CityID arg0, TaskType focus)
TaskType UI.GetInterfaceModeValue()
bool Unit:CanDistanceGift(TaskType toPlayer)



The initial version of this page was created by the Civ5 API Bot, see the Civ5 API Reference FAQ. Some of the texts come from the 2kgames' wiki and most of code samples are copyrighted to Firaxis.
Functions' signatures were either copied from the 2kgames' wiki, or infered from the Lua source files and the binaries. Errors are possible.
Contributors may find help in the Contributors guide to the Civ5 API.