Skip to content

Store data on a Political World party

✅ Runtime verified — executed branchesWBML-0003PoliticalWorldAPI 1.14.0

Attach addon-owned state to one specific Political World party.

You need a real Kingdom kingdom and a real Political World party object/ID from that kingdom. The snippet belongs inside the feature that already selected that party; it is not a party-discovery example.

const string AddonId = "Example.PartyAddon";
const string Key = "conference_count";
bool written = PoliticalWorldAPI.SetPartyInt(
kingdom,
AddonId,
party.Id,
Key,
3
);
int count = PoliticalWorldAPI.GetPartyInt(
kingdom,
AddonId,
party.Id,
Key,
0
);

Use the stable party.Id. Do not persist a list index such as “second party”.

WBML-0003 verified that a missing party ID behaves safely:

GetPartyInt/String/Bool/Float → supplied fallback
SetPartyInt/String/Bool/Float → false

For the tested non-ruling party, typed data remained readable while the party was inactive and was still there after reactivation.

Same-kingdom party-to-party isolation was skipped in the tested save because the original target kingdom did not contain two suitable active parties. Do not silently promote that skipped branch to Verified.

Open the full party-private data reference for the exact scope.