API:GetAreaData
From RoR Wiki
UI Lua API · Game functions
Version: WAR 1.4.8
Returns the map areas the player is currently in, with their influence ids.
areas = GetAreaData()
Arguments
None.
Returns
- areas
table– Array of area tables, indexed from 1.
Each area table has these fields:
| Key | Type | Meaning |
|---|---|---|
areaName |
wstring |
Name of the area. |
areaNumber |
number |
Area number. |
areaID |
number |
Area id. Always equal to areaNumber in the result.
|
influenceID |
number |
Influence id of the area, or 0 if it has none. Use it with GetInfluenceData. |
hasPQButNoInfluence |
boolean |
— |
Details
- The client skips areas whose area number and area id differ, so only entries where both match are returned.
- If the zone tracker is not set up, or there is no player object, or the Lua state is not available, the function returns nothing. The stock UI checks the result for
nil.
Errors
None.
Example
Finding the influence id of the current area, from ea_objectivetrackers/source/publicquesttrackerwindow.lua:
local areaData = GetAreaData()
if( areaData == nil )
then
return nil, false
end
local hasPQButNoInfluence = false
for key, value in ipairs( areaData )
do
if (value.influenceID ~= 0)
then
-- Return whatever value.hasPQButNoInfluence is
return value.influenceID, value.hasPQButNoInfluence
elseif( value.hasPQButNoInfluence )
then
hasPQButNoInfluence = true
end
end
