API:SaveTacticsSet
From RoR Wiki
UI Lua API · Tactics functions
Version: WAR 1.4.8
Stores a list of tactics in one of the player's saved tactic sets and sends the saved set to the server.
SaveTacticsSet(setIndex, tacticIds)
Arguments
- setIndex
number– Index of the set,0to4. Note that this is 0-based.- tacticIds
number-table– Array of tactic ability IDs, starting at index 1.
Returns
Nothing.
Details
- The set is cleared, then filled with the IDs from
tacticIdsin table order. IDs equal to0are skipped. Only the first 7 non-zero IDs are kept. - The updated set is sent to the server. The stock tactics window reads saved sets with
GetTacticsSet(setIndex). - This only saves the set. It does not change the active tactics; use ActivateTactics for that.
- A
setIndexof 5 or higher is ignored. - Does nothing if the player object does not exist yet.
- The function needs at least two arguments and only reads the last two.
Errors
Error in function call 'SaveTacticsSet': Incorrect parameters
Example
From default/ea_tacticswindow/source/tacticswindow.lua:
if (self.currentSet < MAX_TACTICS_SETS) then -- is this needed?
SaveTacticsSet (self.currentSet, self.buttonManager:GetList ());
end
Overwriting set 0 with the active tactics, from the same file:
SaveTacticsSet (0, GetActiveTactics());
