player: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "|version6= 1.00" to "|version6= 1.00 ") |
(some formatting) |
||
Line 23: | Line 23: | ||
|game6= arma3 | |game6= arma3 | ||
|version6= | |version6= 0.50 | ||
|gr1= Object Manipulation | |||
| | |descr= A person object controlled by user. In Intros and Outros this isn't set by default and must be assigned. | ||
| | |mp= In MP [[player]] is different on each computer and on dedicated server it is [[objNull]] by default ([https://www.youtube.com/watch?v{{=}}JzgJe9sXAiU however this doesn't mean there couldn't be one]). When user is joining dedicated server mission, at the moment of [[onPlayerConnected]] the [[player]] object is remote to the joining client, as the [[player]] unit is created on the server, but once control of the unit is passed to the user moments later, the [[player]] objects becomes [[local]] to the client and stays local. | ||
In MP [[player]] is different on each computer and on dedicated server it is [[objNull]] by default ([https://www.youtube.com/watch?v{{=}}JzgJe9sXAiU however this doesn't mean there couldn't be one]). When user is joining dedicated server mission, at the moment of [[onPlayerConnected]] the [[player]] object is remote to the joining client, as the [[player]] unit is created on the server, but once control of the unit is passed to the user moments later, the [[player]] objects becomes [[local]] to the client and stays local. | |||
See [[Multiplayer Scripting#General information about locality|Multiplayer Scripting's player topic]] for additional helpful information. | See [[Multiplayer Scripting#General information about locality|Multiplayer Scripting's player topic]] for additional helpful information. | ||
Line 78: | Line 78: | ||
[[Category:Scripting Commands OFP 1.96|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands OFP 1.96|{{uc:{{PAGENAME}}}}]] | ||
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]] | [[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]] | ||
Revision as of 17:36, 1 March 2021
Description
- Description:
- A person object controlled by user. In Intros and Outros this isn't set by default and must be assigned.
- Multiplayer:
- In MP player is different on each computer and on dedicated server it is objNull by default (however this doesn't mean there couldn't be one). When user is joining dedicated server mission, at the moment of onPlayerConnected the player object is remote to the joining client, as the player unit is created on the server, but once control of the unit is passed to the user moments later, the player objects becomes local to the client and stays local. See Multiplayer Scripting's player topic for additional helpful information.
- Problems:
- In MP the command is not initialised in functions called by initline or init eventhandlers.
- Groups:
- Object Manipulation
Syntax
Examples
Additional Information
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
- Posted on 20 Jul, 2010
- GalZohar
- Before you use the player object (usually to avoid JIP issues) all you need is to run:
waitUntil { not isNull player };
Anything else you see in other scripts is equivalent and/or redundant. Of course JIP players may need more than just the player to point at the actual JIP player unit, but that's script/mission-specific. - Posted on 27 Jan, 2008
- Dr_Eyeball
isNull player
is true for JIP players on their client during initialization.
After initialization, it will be set, making it valid again.
To cater for this, some people use code similar to the following in their spawned scripts:if (!isServer && (player != player)) then { waitUntil { player == player }; waitUntil { time > 10 }; }; // 'player' will now be valid _action = player addAction ["heal", "heal.sqf", [], -1, false, false, ""];
- Posted on June 26, 2014 - 18:49 (UTC)
- Killzone Kid
- player can actually be REMOTE object on player's PC: http://www.youtube.com/watch?v=m6IILtfa3cQ
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Object Manipulation
- Scripting Commands OFP 1.46
- Scripting Commands OFP 1.96
- Scripting Commands OFP 1.99