Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ActivateTactics

From RoR Wiki

UI Lua API · Tactics functions
Version: WAR 1.4.8

Asks the server to make a given list of tactics the player's active tactics.

ActivateTactics(tacticIds)

Arguments

tacticIds
number-table – Array of tactic ability IDs, starting at index 1.

Returns

Nothing.

Details

  • Sends a "set active tactics" request to the server with every ID in the table, in table order.
  • An empty table sends an empty list, which asks for no active tactics.
  • A table with 255 or more entries sends nothing.
  • The client does not check the IDs or the number of tactic slots the player has. The server decides what is applied.
  • Does nothing if the player object does not exist yet.
  • Exactly one argument must be passed. Every value in the table must be a number.

Errors

  • Error in function call 'ActivateTactics': Incorrect parameters

Example

From default/ea_tacticswindow/source/tacticswindow.lua:

function TacticsButtons:SaveAndActivate()
    TacticsSetMenu:SaveSet ();
    ActivateTactics (self:GetList ());
    TacticsEditor.NeedsTacticsGuess = false;
end

TacticsButtons:GetList() builds an array of the non-zero, unique tactic IDs on the tactic buttons.

See also