Module CAMPAIGN_POLITICAL_PARTY_SCRIPT_INTERFACE

Political party userdata handed out by faction:GetPoliticalPartyList().

Functions

GetKey () Database record key string of the political party from political_parties_tables (e.g.
GetPower () Current political power of the party as a normalized proportion (e.g.
GetSenators () Number of senators currently supporting this political party.
IsPrimary () Checks whether this political party is the faction's primary (ruling) party.
SetPrimary () Sets this party as the faction's primary (ruling) party.


Functions

GetKey ()
Database record key string of the political party from political_parties_tables (e.g. "att_politics_hunni_ruler").

Returns:

    string party record key

Usage:

    local key = party:GetKey()
GetPower ()
Current political power of the party as a normalized proportion (e.g. 0.70 for 70% senate dominance).

Returns:

    number political power proportion (0.0 to 1.0)

Usage:

    local power_pct = party:GetPower() * 100
    if power_pct >= 60.0 then
        -- Ruling party enjoys high political dominance
    end
GetSenators ()
Number of senators currently supporting this political party.

Returns:

    integer number of senators

Usage:

    local senators = party:GetSenators()
IsPrimary ()
Checks whether this political party is the faction's primary (ruling) party.

Returns:

    boolean true if this is the primary ruling party, false otherwise

Usage:

    if party:IsPrimary() then
        -- Party is the head of the faction
    end
SetPrimary ()
Sets this party as the faction's primary (ruling) party.

NOTE: This method directly assigns the ruling political party of the faction. It does not automatically cascade allegiance changes to existing family members or the faction leader. To avoid visual conflicts in the Clan / Family Tree UI (where family members belonging to other parties appear under 'Other Houses'), reassign characters using CHARACTER_SCRIPT_INTERFACE:SetPoliticalParty.

Returns:

    boolean true if successfully set, false otherwise

Usage:

    local opposition = faction:GetPoliticalParty("att_politics_hunni_council")
    if opposition and not opposition:IsPrimary() then
        opposition:SetPrimary()
    end
generated by LDoc 1.5.0