Jump to content
Sign in to follow this  
XCess

Unit Switching

Recommended Posts

Giving the player the ability to switch units (known as team switch) is pretty simple in Armed Assault, and requires only a very basic knowledge of the scripting language.

Commands

There are several commands associated with this feature:

- enableTeamSwitch

- addSwitchableUnit

- teamSwitch

- teamSwitchEnabled

- selectPlayer

- setPlayable

- switchableUnits

- removeSwitchableUnit

addSwitchableUnit:

Adds a single unit to team switch

eg: addSwitchableUnit aP

enableTeamSwitch:

This turns team switch on.

eg: enableTeamSwitch true

teamSwitch

Forces the team switch dialog to appear.

eg: teamSwitch

teamSwitchEnabled

Check if team switch has been turned on.

eg: ?(teamSwitchEnabled) : teamSwitch

selectPlayer

Forces a player to switch to a specific unit.

eg: selectPlayer aP

setPlayable

Makes a unit playable, therefore, entering them into an array of switchable units.

eg: setPlayable aP

note: playable units can also be set in the editor, in the control drop down menu when placing a unit.

switchableUnits

Returns an array of all units eligible for teamswitch.

eg: _x = switchableUnits

removeSwitchableUnit

Removes a unit from the array of switchable units.

eg: removeSwitchableUnit ap

Possibilities

This new features adds quite a few possibilities to the game other than the obvious switching of roles when you die. This feature allows something that many mission creators

begged and wished for in Operation Flashpoint, the ability to change clothes in game.

Have you ever wished you could sneak through a town dressed as a civilian, and then pick up a gun and a uniform when you meet your comrades? Have you ever wished you could take that big, cumbersome ghillie suit off while in town? Have you ever wished you could steal the uniform of a dead foe and pretend to be one of their kind? Well, now you can, and, for all you realists out there, team switch can be disabled on death. So you don't have to worry about switching into other peoples bodies when you die.

Disabling Team Switch On Death

Team switch can be used purely as a role or uniform changing feature. If you wish to allow changing of uniforms or roles without giving the player the advantage of having multiple

lives, there is a simple trick to make this possible.

Create a trigger, change nothing other than the condition and onActivation fields.

In the condition field type: !(alive player)

In the onActivation field type: enableTeamSwitch false

Now you can switch clothes without switching lives.

**edit**

Thanks to Gaia for pointing out removeSwitchableUnit.

Thanks to Platoon_Patton for pointing out addSwitchableUnit

Share this post


Link to post
Share on other sites

There is also:addSwitchableUnit

-->  ?!alive player:addSwitchableUnit player

Another option is auto-balancing public servers when JIP is enabled.Like U play 7 vs 6 when someone joins,the server will put him in the outnumbered side and avoid 8 vs 6.

Share this post


Link to post
Share on other sites

Thanks for that Platoon_Patton, I've updated the first post. smile_o.gif

Share this post


Link to post
Share on other sites

Awsome, looking forward to playing this if only to produce a more varied MP mission.

Everyone is OPFOR bar one BLUFOR player, first OPFOR to kill the BLUFOR, replaces the blufor... repeat, in effect a game of OFP tag.

BA

Share this post


Link to post
Share on other sites

Very interesting.

Works great in SP. Any idea's about MP?.

I hosted with a mate, and both of us were switched into the unit. Me being local i got the control of the unit, and he just got to look through the eyes.

Possible to have it working properly on MP?>

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×