is the target being changed
is the receiver of the effect (beneficiary)
handle to alliance type
falseto stop sharing
Sets the given alliance setting on
Example, make it so red has vision of blue's units:
function ShowBlueToRed takes nothing returns nothing local player red = Player(0) local player blue = Player(1) // note the reversed order: "blue's vision is shared to red" call SetPlayerAlliance(blue, red, ALLIANCE_SHARED_VISION, true) endfunction
Players are not required to be allies. Tested in v1.07.
However in this case after sharing control, the player with control will see controllable enemy units colored in "green-ally" color when hovering over them. The minimap will still correctly show all of them as enemies (for all ally color modes, see
GetAllyColorFilterState). Enemy units will attack correctly.
ShareEverythingWithTeamwhich is a more limited version available from GUI.
- return type
- Source code
native SetPlayerAlliance takes player sourcePlayer, player otherPlayer, alliancetype whichAllianceSetting, boolean value returns nothing