Module twdll.battle

Battle lifecycle hooks for Total War: Attila.

Functions

GetBattleInfo () Returns live runtime telemetry and reinforcement structure about the current tactical battle.


Functions

GetBattleInfo ()
Returns live runtime telemetry and reinforcement structure about the current tactical battle. Returns nil while no battle is active (e.g. on the campaign map).

When inside a battle, returns a table with fields: - battle (string): hexadecimal memory address of the BATTLE object. - manager (string|nil): hexadecimal memory address of REINFORCEMENTS_MANAGER. - cap (integer|nil): active maximum units per army in battle. - size (integer|nil): number of reinforcing armies currently queued.

Returns:

    table or nil table containing battle state, or nil when not in a tactical battle

Usage:

    -- Example returned table:
    -- {
    --     ["battle"] = "0x2A4F8900",
    --     ["manager"] = "0x2A4F8B40",
    --     ["cap"] = 40,
    --     ["size"] = 2
    -- }
    
    local info = twdll.battle.GetBattleInfo()
    if info then
        if info.size and info.size > 0 then
            -- Reinforcements are queued to enter the battlefield
        end
    end
generated by LDoc 1.5.0