MissionType (Civ5 Type)

From Civilization Modding Wiki
Revision as of 14:49, 19 September 2012 by DonQuich (talk | contribs) (Bot update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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


ID.png The MissionType pseudo-type is actually a regular integer. Pseudo-types do not exist in Lua, they only serve a documentation purpose on the wiki!
  • DB.png Integers labeled as MissionType corresponds to the ID column of the Missions XML table.
  • Lua.png The standard (unmodded) values in the ID and Type columns are also stored in the MissionTypes Lua enumeration.


Lua: the MissionTypes enumeration

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

  • This specific enumeration contains data from the Missions data table.
  • They are stored as key/value pairs: the keys are the strings from the Type column and the values are the integers from the ID column.

Radioactive.png Be careful: this enumeration do not reflect the changes, additions and deletions made by mods. As a result it is advised to rely on GameInfo instead.


Below are the values found in this enumeration.

Key Value
0 "MISSION_MOVE_TO"
1 "MISSION_ROUTE_TO"
2 "MISSION_MOVE_TO_UNIT"
3 "MISSION_SWAP_UNITS"
4 "MISSION_SKIP"
5 "MISSION_SLEEP"
6 "MISSION_ALERT"
7 "MISSION_FORTIFY"
8 "MISSION_GARRISON"
9 "MISSION_SET_UP_FOR_RANGED_ATTACK"
10 "MISSION_EMBARK"
11 "MISSION_DISEMBARK"
12 "MISSION_AIRPATROL"
13 "MISSION_HEAL"
14 "MISSION_AIRLIFT"
15 "MISSION_NUKE"
16 "MISSION_PARADROP"
17 "MISSION_AIR_SWEEP"
18 "MISSION_REBASE"
19 "MISSION_RANGE_ATTACK"
20 "MISSION_PILLAGE"
21 "MISSION_FOUND"
22 "MISSION_JOIN"
23 "MISSION_CONSTRUCT"
24 "MISSION_DISCOVER"
25 "MISSION_HURRY"
26 "MISSION_TRADE"
27 "MISSION_SPACESHIP"
28 "MISSION_CULTURE_BOMB"
29 "MISSION_GOLDEN_AGE"
30 "MISSION_BUILD"
31 "MISSION_LEAD"
32 "MISSION_DIE_ANIMATION"
33 "MISSION_BEGIN_COMBAT"
34 "MISSION_END_COMBAT"
35 "MISSION_AIRSTRIKE"
36 "MISSION_SURRENDER"
37 "MISSION_CAPTURED"
38 "MISSION_IDLE"
39 "MISSION_DIE"
40 "MISSION_DAMAGE"
41 "MISSION_MULTI_SELECT"
42 "MISSION_MULTI_DESELECT"
43 "MISSION_WAIT_FOR"
44 "MISSION_MULTI_DESELECT"
45 "MISSION_WAIT_FOR"
46 "MISSION_SPREAD_RELIGION"
47 "MISSION_ENHANCE_RELIGION"
48 "MISSION_REMOVE_HERESY"
"NO_MISSION" -1
"MISSION_MOVE_TO" 0
"MISSION_ROUTE_TO" 1
"MISSION_MOVE_TO_UNIT" 2
"MISSION_SWAP_UNITS" 3
"MISSION_SKIP" 4
"MISSION_SLEEP" 5
"MISSION_ALERT" 6
"MISSION_FORTIFY" 7
"MISSION_GARRISON" 8
"MISSION_SET_UP_FOR_RANGED_ATTACK" 9
"MISSION_EMBARK" 10
"MISSION_DISEMBARK" 11
"MISSION_AIRPATROL" 12
"MISSION_HEAL" 13
"MISSION_AIRLIFT" 14
"MISSION_NUKE" 15
"MISSION_PARADROP" 16
"MISSION_AIR_SWEEP" 17
"MISSION_REBASE" 18
"MISSION_RANGE_ATTACK" 19
"MISSION_PILLAGE" 20
"MISSION_FOUND" 21
"MISSION_JOIN" 22
"MISSION_CONSTRUCT" 23
"MISSION_DISCOVER" 24
"MISSION_HURRY" 25
"MISSION_TRADE" 26
"MISSION_REPAIR_FLEET" 27
"MISSION_SPACESHIP" 27
"MISSION_CULTURE_BOMB" 28
"MISSION_GOLDEN_AGE" 29
"MISSION_BUILD" 30
"MISSION_FOUND_RELIGION" 30
"MISSION_LEAD" 31
"MISSION_DIE_ANIMATION" 32
"MISSION_BEGIN_COMBAT" 33
"MISSION_END_COMBAT" 34
"MISSION_AIRSTRIKE" 35
"MISSION_SURRENDER" 36
"MISSION_CAPTURED" 37
"MISSION_IDLE" 38
"MISSION_DIE" 39
"MISSION_DAMAGE" 40
"MISSION_MULTI_SELECT" 41
"MISSION_MULTI_DESELECT" 42
"MISSION_WAIT_FOR" 43
"NUM_MISSION_TYPES" 44
"MISSION_SPREAD_RELIGION" 46
"MISSION_ENHANCE_RELIGION" 47
"MISSION_REMOVE_HERESY" 48


XML: the Missions table

Here are the ID and Type columns found in this table.

ID Type
0 MISSION_MOVE_TO
1 MISSION_ROUTE_TO
2 MISSION_MOVE_TO_UNIT
3 MISSION_SWAP_UNITS
4 MISSION_SKIP
5 MISSION_SLEEP
6 MISSION_ALERT
7 MISSION_FORTIFY
8 MISSION_GARRISON
9 MISSION_SET_UP_FOR_RANGED_ATTACK
10 MISSION_EMBARK
11 MISSION_DISEMBARK
12 MISSION_AIRPATROL
13 MISSION_HEAL
14 MISSION_AIRLIFT
15 MISSION_NUKE
16 MISSION_PARADROP
17 MISSION_AIR_SWEEP
18 MISSION_REBASE
19 MISSION_RANGE_ATTACK
20 MISSION_PILLAGE
21 MISSION_FOUND
22 MISSION_JOIN
23 MISSION_CONSTRUCT
24 MISSION_DISCOVER
25 MISSION_HURRY
26 MISSION_TRADE
27 MISSION_SPACESHIP
27 MISSION_REPAIR_FLEET
28 MISSION_CULTURE_BOMB
29 MISSION_GOLDEN_AGE
30 MISSION_BUILD
30 MISSION_FOUND_RELIGION
31 MISSION_LEAD
32 MISSION_DIE_ANIMATION
33 MISSION_BEGIN_COMBAT
34 MISSION_END_COMBAT
35 MISSION_AIRSTRIKE
36 MISSION_SURRENDER
37 MISSION_CAPTURED
38 MISSION_IDLE
39 MISSION_DIE
40 MISSION_DAMAGE
41 MISSION_MULTI_SELECT
42 MISSION_MULTI_DESELECT
43 MISSION_WAIT_FOR
46 MISSION_SPREAD_RELIGION
47 MISSION_ENHANCE_RELIGION
48 MISSION_REMOVE_HERESY


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 = MissionTypes.MISSION_MOVE_TO
local id = MissionTypes["MISSION_MOVE_TO"]

Here is how to use the LUA enumeration to retrieve one of string values from its index. Those examples will return and assign the string value MISSION_MOVE_TO.

local str = MissionTypes[0]


Used by

Unit:PushMission(MissionType mission, int data1 = -1, int data2 = -1, int flags = 0, bool append = false, bool manual = fa;se, MissionType missionAI = NO_MISSIONAI, Plot missionAIPlot = nil, Unit missionAIUnit = nil)



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.