It looks impossible to make a unit playable with the setplayable command.
Description
Details
- Legacy ID
- 1111712412
- Severity
- None
- Resolution
- Open
- Reproducibility
- Always
- Category
- Editor
in the editor :
- Place a blufor unit as player
- Place a nonplayable unit
- Name it (let's say Newfriend1)
- Place a presence trigger activated by blufor and put this code in the Activation field : setplayable Newfriend1
Lunch the preview, enter into the trigger zone and try to switch unit to play Newfriend1.
Event Timeline
Just tried this command in my mission as I really wanted the mechanic.. and it doesn't work, disappointing.
Hoping BIS will see this.
Edit: It may be worth looking at the addSwitchableUnit command too, since that doesn't seem to work either
Just did some testing. setplayable does not set unit playable in a sense that it does not appear in playableUnits array. However it is still possible to switch to a unit with selectPlayer regardless.
If you use setPlayable command first then addSwitchableUnit command for the same unit it works
@dippysea: Do you mean in SP? Can you be a bit more specific? Just tried and it does not work in MP.
@devs: Any acknowledgement or possible workaround for this issue?
You need to add 'AddSwitchableUnit' too. Works for me also in MP.
SetPlayble = ["Unit1", "Unit2"]; addSwitchableUnit = ["Unit1", "Unit2"];
Are you sure it works in MP? I mean... does it add a new playable slot in the lobby for the created units? I'm on stable and cant get it to work here.
I have only used it with other AI, the AI becomes playable and switchable (last time I tried). No idea if it actually creates new slots in the lobby.
It doesn't work for me in MP either (addSwitchableUnit seems to work in SP) and I doubt that example mentioned by B00tsy could work in Arma 3. This is way how to define a global variable, both these commands (and basically all commands in Arma) use different syntax.
As usecase was requested:
Creating an "infinite" spectator slot for missions where respawns are disabled and people moved to spectator manually (some PvP events). If a user crashes while spectating, his slot is no longer available in the slot selection and thus he is "stuck". Creating a spectator slot and then a new one when the first one gets occupied will allow crashed players to join back in as spectator. Similarly, if someone dies due to a bug, our current respawn creates a unit and uses selectPlayer to give the affected player control. However, if he crashes/anything happens to this new unit, the player is out of luck.
Another use case could be adding slots for players in a mission based on mission progression. Let's say there's a task to rescue a pilot or engineer. If the mission is completed, a new playable slot can be unlocked, allowing players to take control of planes, helicopters, or faster repairs.