API:GameData.GetObjectiveData
From RoR Wiki
UI Lua API · RvR functions
Version: WAR 1.4.8
Returns the id, name and controlling realm of one objective.
objectiveData = GameData.GetObjectiveData(objectiveId)
Arguments
- objectiveId
number– Objective id, for example theidof an objective map point.
Returns
- objectiveData
table– Objective table (see below), or nothing if the client has no objective with that id.
| Key | Type | Meaning |
|---|---|---|
id |
number |
Objective id. |
name |
wstring |
Objective name. |
controllingRealm |
number |
Realm that holds the objective. The stock tooltip compares it with GameData.Realm.ORDER, DESTRUCTION and NONE.
|
Details
- The table has only these three fields. For the full objective fields see GetGameDataObjectives.
- An unknown id is not an error; the function simply returns nothing.
- The function needs at least one argument and only reads the last one.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
From default/easystem_tooltips/source/maptooltips.lua:
local objectiveId = ptData.id
local objectiveData = GameData.GetObjectiveData(objectiveId)
if ( objectiveData ~= nil ) then
if ( objectiveData.controllingRealm == GameData.Realm.ORDER ) then
textValues[currentLabel] = GetStringFromTable( "MapSystem", StringTables.MapSystem.TEXT_OBJECTIVE_CONTROLLED_BY_ORDER )
...
