OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: kju on 31 Aug 2010, 07:43:26

Title: How to change an unit's side?
Post by: kju on 31 Aug 2010, 07:43:26
From what I recall there is the trick to change a unit side:

# Group your unit with the another side's unit.
# Have the later be the leader.
# Remove the leader.
# The unit is now assigned to the other side.

Correct?

Are there any limits to this? MP? Human players?
Or what happens when you selectPlayer an unit from the other side?
Title: Re: How to change an unit's side?
Post by: nominesine on 31 Aug 2010, 23:11:21
The suggested method works in both MP and SP. As far as I know it can be used for human players as well (havent tried since OFP though). The unit will keep it's scripted FSM behaviour after the change, so a civilian unit grouped to a (non existing) East guy will take cover and hide like a civillian, even if you give him a rifle.

You may also change a units loyalty by editing it's side in the mission.sqm (opens with any text editor). No need to group the unit to a non exsting leader if you chose this method.
Title: Re: How to change an unit's side?
Post by: kju on 01 Sep 2010, 12:01:27
Thanks nominesine  :good:

To clarify I am mostly interested in dynamic changing of the units side.

Or in other words I use selectPlayer to change the player model.
Now it would be nice, if this is not limited to changing to units on your own side
and not messing up AI behavior. Therefore the original player side must be kept intact.
Title: Re: How to change an unit's side?
Post by: Pirin on 11 Sep 2010, 11:09:29
A current beta introduced side change on join!  :good:
Title: Re: How to change an unit's side?
Post by: kju on 12 Sep 2010, 11:47:08
Introduced? It disables it, right?

Code: [Select]
  [73204]  Fixed: Join group changes unit's side
 ???
Title: Re: How to change an unit's side?
Post by: ZapBrannigan on 12 Sep 2010, 14:40:49
you also can change a unit to the civilian side by setting him captive  ** setcaptive true