User Tools

Site Tools


arma:missions:teamswitch

TeamSwitch

TeamSwitch gives the player the ability to switch units is pretty simple, and requires only a very basic knowledge of the scripting language. Teamswitch does not work in multiplayer.

There are several commands associated with this feature:

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: if (teamSwitchEnabled) then { 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

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.

arma/missions/teamswitch.txt · Last modified: 2008-05-07 13:02 by snakeman