SetDiplomacy¶
Request a relationship change with another player.
SetDiplomacy(targetPlayerId, stance) ·
SetDiplomacyTracked(targetPlayerId, stance)
Inputs: targetPlayerId is an existing non-Gaia player other than yourself.
stance is exactly "ally", "neutral", or "enemy".
Output: SetDiplomacy returns true for queue admission, otherwise false.
SetDiplomacyTracked returns accepted, receipt. A later relationship match does
not prove this command caused it.
Errors: Invalid Lua argument types or values raise argument errors. Team locks, game mode, changed players, or missing native state can reject a valid request; the tracked receipt gives the reason.
Example:
local accepted = SetDiplomacy(2, "ally")
if not accepted then LogWarn("Diplomacy request was not queued") end
Team locks and game mode can reject a request. Both admission and execution
check the originating player, target, native world mode, and team-lock setting.
Tracked rejection reasons include teams-locked,
team-lock-state-unavailable, diplomacy-target-unavailable,
originating-player-changed, and diplomacy-world-mode-disallowed.
The native replicated command leaves final relationship decisions to the game.
GetApiCapability(SetDiplomacy) checks native readiness, not target eligibility
or the current team lock.