player: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \[\[Category:Scripting Commands OFP 1.[4-9]{2}(\|(\{\{uc:\{\{PAGENAME\}\}\}\}|#|[A-Z0-9]+))?\]\]" to "") |
Lou Montana (talk | contribs) m (Fix) |
||
(16 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
|game1= ofp | |game1= ofp | ||
|version1= 1.00 | |version1= 1.00 | ||
|game2= | |game2= ofpe | ||
|version2= 1.00 | |version2= 1.00 | ||
|game3= | |game3= arma1 | ||
|version3= 1.00 | |version3= 1.00 | ||
|game4= | |game4= arma2 | ||
|version4= 1.00 | |||
|version4= 1. | |||
|game5= | |game5= arma2oa | ||
|version5= 1.50 | |||
| | |game6= tkoh | ||
|version6= 1.00 | |||
| | |game7= arma3 | ||
|version7= 0.50 | |||
| | |||
|gr1= Object Manipulation | |gr1= Object Manipulation | ||
Line 29: | Line 26: | ||
|descr= A person object controlled by user. In Intros and Outros this isn't set by default and must be assigned. | |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 ( | |mp= In MP [[player]] is different on each computer and on dedicated server it is [[objNull]] by default ({{Link|https://www.youtube.com/watch?v{{=}}JzgJe9sXAiU|unless scripted}}). | ||
When user is joining a 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 and remains [[Multiplayer Scripting#Locality|local]] to the client. | |||
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. | ||
|pr= In multiplayer, the command is not initialised in functions called by initline or init eventhandlers. | |||
|s1= [[player]] | |s1= [[player]] | ||
|r1= [[Object]] | |r1= [[Object]] | ||
| | |x1= <sqf>player addRating 500;</sqf> | ||
|seealso= [[Multiplayer Scripting]] | |seealso= [[Multiplayer Scripting]] [[isPlayer]] [[playableUnits]] [[selectPlayer]] | ||
}} | }} | ||
{{Note | |||
|user= Galzohar | |||
|timestamp= 20100620031100 | |||
|text= Before you use the '''player''' object in init scripts, to avoid JIP issues all you need is to run: | |||
<sqf>waitUntil { not isNull player };</sqf> | |||
< | Anything else you see in other scripts is equivalent and/or redundant. (but you may need to add other conditions too, such as checking [[hasInterface]] before initiating that loop)<br> | ||
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. | ||
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. | }} | ||
{{Note | |||
|user= Killzone_Kid | |||
|timestamp= 20140626184900 | |||
|text= [[player]] can actually be REMOTE object on player's PC: {{Link|http://www.youtube.com/watch?v{{=}}m6IILtfa3cQ}} | |||
}} | |||
{ | |||
Latest revision as of 22:56, 24 April 2024
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 (unless scripted). When user is joining a 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 and remains local to the client. See Multiplayer Scripting's player topic for additional helpful information.
- Problems:
- In multiplayer, the command is not initialised in functions called by initline or init eventhandlers.
- Groups:
- Object Manipulation
Syntax
Examples
- Example 1:
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 Jun 20, 2010 - 03:11 (UTC)
-
Before you use the player object in init scripts, to avoid JIP issues all you need is to run:
Anything else you see in other scripts is equivalent and/or redundant. (but you may need to add other conditions too, such as checking hasInterface before initiating that loop)
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.
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Operation Flashpoint: Elite: 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