Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetCampaignZoneData

From RoR Wiki

UI Lua API · RvR functions
Version: WAR 1.4.8

Returns the RvR campaign state of one zone: its tier, pairing, realms, lock state and control points.

zoneData = GetCampaignZoneData(zoneId)

Arguments

zoneId
number – Zone id, for example GameData.Player.zone.

Returns

zoneData
table – Zone table (see below), or nothing if the zone is not a campaign zone.
Key Type Meaning
zoneId number Zone id.
tierId number Tier of the zone. The client adds 1 to the stored value.
pairingId number Campaign pairing the zone belongs to. Pass it to GetCampaignPairingData.
initialRealm number –
controllingRealm number Realm that controls the zone.
isLocked boolean Whether the zone is locked.
controlPoints table Three numbers keyed 0, 1 and 2. The stock UI reads controlPoints[GameData.Realm.ORDER] and controlPoints[GameData.Realm.DESTRUCTION].

Details

  • The function returns nothing when the client has no campaign data at all, or when zoneId is not one of its campaign zones. No error is raised in either case, unlike GetZoneObjectivesData.
  • controlPoints starts at key 0, so ipairs and # skip the first value.
  • A new table is built on every call.
  • The function takes exactly one argument.

Errors

None besides the generic Invalid Parameters message when the argument is missing or not a number.

Example

From default/ea_objectivetrackers/source/battlefieldobjectivetracker.lua:

local zoneData = GetCampaignZoneData( GameData.Player.zone )

if( (zoneData ~= nil) and (zoneData.isLocked) )
then
    local pairingData = GetCampaignPairingData( zoneData.pairingId )

Reading the control points, from default/easystem_threepartbar/source/ea_threepartbar.lua:

barData.leftValue  = zoneData.controlPoints[ GameData.Realm.ORDER ]
barData.rightValue = zoneData.controlPoints[ GameData.Realm.DESTRUCTION ]

See also