selectPlayer
Jump to navigation
Jump to search
Description
- Description:
- Switch player to given person. Switching to a Null-Object works, but provides a view which you cannot manipulate (neither move nor rotate) with regular input. This command has significant effects on locality. See notes beneath.
- Groups:
- Uncategorised
Syntax
Examples
- Example 1:
selectPlayer _aPerson
Additional Information
- See also:
- selectNoPlayerTeam_SwitchswitchCamera
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Notes
- SnowSky
-
Notes on locality issues with selectPlayer in multiplayer environments:
1) If you switch to a unit that's not local, control over movement will not be given to you immediately. For example, if you switch to an AI unit whose leader is a player, you will not be able to control the movement of your new avatar, as its control remains with the leader unit. You will however be able to look around while the unit walks automatically.
2) The identity of units are not transferred properly: If your old unit dies, this will count for your stats. Your old unit might remain identifiable as you (if you aim at the unit you see your own name). Your new unit will keep it's name, face and voice (face can be set dynamically, but name, voice and glasses have to be defined before mission start in the description.ext). When chatting, not the name of your original identity, but the identity of the transferred to person will show.
Those 2 Points were for ArmA I, I am currently analyzing the behaviour in ArmA II with version 1.08 + OA 1.57
So with ArmA II, you still have to keep an eye on locality (otherwise the AI will controll the unit you are), but there are cool possibilities now: if you do a "selectPlayer unitVarName",the unit takes your identity (with name, voice, face and glasses) - and your identity is also visible on other clients! But you have to remember that your old unit will stay with your Identity. Dies the old unit, the stats count it. An other thing you have to pay attention is the Death for your new unit - you have to register an EventHandler, otherwise you will stay in your dead unit, and also the MenuOption Respawn won't help you out! 3.Jan. 2011 3) If you do a selectPlayer call, join,joinSilent,joinAs,joinAsSilent wont work anymore correctly. Means: Your unit joins the other group AND your unit will be local to the other group. so at the moment you can use selectPlayer only as a single human player in a group. In the later day I will try what happens if both human players are units by selectPlayer, and both join the same group (till yet tried with one selectPlayer unit and one originUnit) 14.May 2011 - besselinksjm
- 3) After switching to a unit that's not local, the unit will remain local to you after switching back. For example, if we have units A and B, and a client starts as unit A and unit B is AI under server control. If you switch to unit B, it will take some time, but eventually you can control the movement of unit B (see (1) above). Now if you switch back to unit A, unit B will remain local to you, the player. Any server-side scripts which try to execute local arguments -- such as doMove -- will fail.
- kju
-
A working implementation can be found at A&S ProMode dev-heaven repo, acc guest, pw guest or at pastebin.
Be careful to learn all the pitfalls and things you need to take into consideration to have this working in MP.