Module SLOT_SCRIPT_INTERFACE

Extensions to the game's settlement slot object.

Functions

GetBuildingRotation () Building model 3D rotation step on the campaign map (0 to 5, in 60-degree increments: , 60°, 120°, 180°, 240°, 300°).
GetMemoryAddress () Memory address of the slot object in hexadecimal format.
Refresh () Forces an immediate visual refresh of settlement building 3D models on the campaign map.
SetBuildingRotation (rotation) Sets the building model 3D rotation step on the campaign map (0 to 5, representing 60-degree increments).


Functions

GetBuildingRotation ()
Building model 3D rotation step on the campaign map (0 to 5, in 60-degree increments: , 60°, 120°, 180°, 240°, 300°).

Returns:

    integer rotation index (0 to 5)

Usage:

    local rot = slot:GetBuildingRotation()
    -- rot is an integer 0..5 (0 = 0 deg, 1 = 60 deg, 2 = 120 deg, etc.)
GetMemoryAddress ()
Memory address of the slot object in hexadecimal format.

Returns:

    string memory address (e.g. "0x12345678")

Usage:

    local addr = slot:GetMemoryAddress()
Refresh ()
Forces an immediate visual refresh of settlement building 3D models on the campaign map.

Usage:

    slot:Refresh()
SetBuildingRotation (rotation)
Sets the building model 3D rotation step on the campaign map (0 to 5, representing 60-degree increments). Persisted across save/load. Call Refresh or twdll.campaign_ui.RefreshSettlements to immediately update the visual 3D asset in-game.

Parameters:

  • rotation integer new rotation index (0 to 5, modulo 6 applied automatically)

Usage:

    -- Rotate building by 180 degrees (step 3) and update visuals:
    slot:SetBuildingRotation(3)
    slot:Refresh()
generated by LDoc 1.5.0