API:GetCareerResource
From RoR Wiki
UI Lua API · Game functions
Version: WAR 1.4.8
Returns the current value of the player's career resource.
value = GetCareerResource(targetType)
Arguments
- targetType
number– Whose resource to read. The stock UI passesGameData.BuffTargetType.SELF.
Returns
- value
number– The current resource value, or0.
Details
- The number is converted to an integer. Only the value 6 reads a resource; every other value, including anything above 8, returns
0. The stock UI calls the function only withGameData.BuffTargetType.SELF. - If there is no player object, the function returns
0. - If the Lua state is not available, the function returns nothing.
Errors
None.
Example
From ea_careerresourceswindow/source/careerresourcedata.lua:
function CareerResourceData:GetCurrent ()
local current = GetCareerResource (GameData.BuffTargetType.SELF)
