API:GetActiveObjectivesData
From RoR Wiki
UI Lua API · Game functions
Version: WAR 1.4.8
Returns the objectives the player is currently tracking: public quests, battlefield objectives, keeps and city objectives.
objectives = GetActiveObjectivesData()
Arguments
None.
Returns
- objectives
table– Array of objective tables, indexed from 1.
Each objective table has these fields:
| Key | Type | Meaning |
|---|---|---|
id |
number |
Objective id. |
name |
wstring |
Objective name. |
controllingRealm |
number |
Realm that holds the objective. |
curControlPoints |
number |
— (may be negative) |
isCapturePoint |
boolean |
— |
difficulty |
number |
Difficulty, used by the stock UI for the tracker's difficulty text. |
isBattlefieldObjective |
boolean |
— |
isKeep |
boolean |
— |
isFortress |
boolean |
— |
isPublicQuest |
boolean |
true when none of the other type flags are set.
|
isCityBoss |
boolean |
— |
optedOutForLoot |
number |
— |
forcedOutForLoot |
boolean |
— |
Quest |
table |
Array of the objective's quest stages, indexed from 1, at most 5 entries. See below. |
Each entry of Quest:
| Key | Type | Meaning |
|---|---|---|
influenceType |
number |
Same value for every entry of one objective. |
name |
wstring |
Stage name. |
desc |
wstring |
Stage description. |
complete |
boolean |
— |
timerName |
wstring |
— |
timerValue |
number |
— |
timerState |
number |
— |
isTimeToComplete |
boolean |
— |
availableRealm |
number |
— |
conditions |
table |
Array of conditions, indexed from 1. Each has name (wstring), curCounter (number), maxCounter (number) and failureCondition (boolean).
|
Details
isBattlefieldObjective,isKeep,isFortressandisCityBosscome from separate bits of one type value.isPublicQuestistrueonly when that value is 0.- A new table is built on every call. The stock UI stores it in
DataUtils.activeObjectivesDataand refreshes it from the objective tracker event handlers. - Unlike most data getters, this function does not check for a player object.
Errors
None.
Example
From easystem_utils/source/datautils.lua:
DataUtils.activeObjectivesData = GetActiveObjectivesData()
Using the difficulty, from ea_objectivetrackers/source/citytrackerwindow.lua:
local difficultyText = TrackerUtils.GetDifficultyText( objectiveData.difficulty )
