API:TomeGetTacticCounter
From RoR Wiki
UI Lua API · Tome functions
Version: WAR 1.4.8
Returns a Tome of Knowledge tactic counter: its name, the player's progress, and the tactics it unlocks.
name, progress, rewards = TomeGetTacticCounter(counterId)
Arguments
- counterId
number– Tactic counter id, for example therewardIdof a Tome reward of typeGameData.Tome.REWARD_ABILITY_COUNTER.
Returns
Nothing if the id is unknown. Otherwise:
- name
wstring– Name of the tactic line; empty if the name table is not loaded.- progress
number– The player's current count for this counter.- rewards
table– Array of exactly 3 tables, each withrewardId(number, the tactic, for TomeGetTacticCounterRewardData) andthreshold(number, the count needed).
Details
- The id must match a counter exactly.
- 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_interactionwindow/source/interactiontometraining.lua:
local tacticLineName, progress, rewardData = TomeGetTacticCounter( advanceData.requiredActionCounterID )
if (dependencyText == nil) and (progress < advanceData.requiredActionCounterCount)
then
dependencyText = GetStringFormatFromTable("TrainingStrings", StringTables.Training.LABEL_REQUIRES_DEPENDENT_COUNT_X_Y_Z, { tacticLineName, towstring(progress), towstring(advanceData.requiredActionCounterCount) } )
end
From default/ea_tomeofknowledge/source/tomewindow.lua, passing all three results to a tooltip builder:
BuildTacticCounterTooltip( TomeGetTacticCounter( rewardData.rewardId ) )
