selectPlayer: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Control is not returned to server after selectplayer in MP.)
No edit summary
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Switch player to given person. Switching to a [[objNull|Null-Object]] works, but provides an view which you cannot manipulate with regular input (similar to a camera). |= Description
| Switch player to given person. Switching to a [[objNull|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_in_Multiplayer|locality]]. See notes beneath.'''|= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 27: Line 29:
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
Notes on selectPlayer in multiplayer environments:
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.
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) After switching to a unit, the unit will remain local to you after switching back. For example, if we have unit a and b, and a client start as unit a and the unit b is AI under server control. If you switch to unit b, it will take some time before you can control the movement of the unit, due to the above statement (1). Now if you switch back to unit a, the server is not in control over the unit b anymore. Any serverside scripts trying to doMove on unit b, will fail.
2) 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.


3) 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.
3) 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.
Further versions then 1.16 (I did the experiments with 1.16beta) may crash while using in Multiplayer!
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>

Revision as of 16:33, 17 June 2010

-wrong parameter ("Arma") defined!-1.00
Hover & click on the images for description

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

Syntax:
selectPlayer unitName
Parameters:
unitName: Object
Return Value:
Nothing

Examples

Example 1:
selectPlayer _aPerson

Additional Information

See also:
switchCamera

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

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) 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. 3) 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.

Bottom Section