API:TomeGetTacticCounterRewardData
From RoR Wiki
UI Lua API · Tome functions
Version: WAR 1.4.8
Returns the tactic unlocked by a Tome of Knowledge tactic counter, and whether the player has unlocked it.
tacticData = TomeGetTacticCounterRewardData(rewardId)
Arguments
- rewardId
number– Reward id, as in therewardslist from TomeGetTacticCounter.
Returns
- tacticData
table– An ability data table for the tactic, plus the field below. Nothing is returned if the id is unknown or the player is not in the world.
| Key | Type | Meaning |
|---|---|---|
unlocked |
boolean |
Whether the player has unlocked this tactic. |
Details
- Unlike GetAbilityData, the table has no
isActivefield. - No error is logged for an unknown id.
- Exactly one argument must be passed.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
From default/ea_tomeofknowledge/source/tomewindow.lua:
for index, reward in ipairs( rewards )
do
local tactic = TomeGetTacticCounterRewardData( reward.rewardId )
local tacticText = GetFormatStringFromTable( "Default", StringTables.Default.TOOLTIP_X_REQUIRES_Y_FRAGMENTS, { tactic.name, reward.threshold } )
local texture, x, y = GetIconData( tactic.iconNum )
...
From default/ea_interactionwindow/source/interactiontometraining.lua:
local tacticData = TomeGetTacticCounterRewardData( advanceData.packageId )
if tacticData ~= nil
then
return tacticData.unlocked and (progress >= advanceData.requiredActionCounterCount)
