name: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) (Add specifics about identical names) |
||
Line 26: | Line 26: | ||
|gr2= Locations | |gr2= Locations | ||
|descr= When argument is [[Object]], the command returns the name given to a unit using the [[setIdentity]] instruction or selected randomly by the game engine if [[setIdentity]] has not been used on the unit. If used on vehicle, name of first crew member (in order commander, driver, gunner). If used on an object, "Error: No unit" is being returned. | |descr= When argument is [[Object]], the command returns the name given to a unit using the [[setIdentity]] instruction or selected randomly by the game engine if [[setIdentity]] has not been used on the unit. | ||
If used on vehicle, name of first crew member (in order commander, driver, gunner). If used on an object, "Error: No unit" is being returned. | |||
|mp= [[name]] returns [[profileName]], eventually suffixed by the server in the event of identical names, e.g {{hl|username}}/{{hl|username (2)}}. | |||
|pr= {{Feature|important|If the provided unit is dead and has been removed from its group, its identity has then been purged to save memory and using [[name]] on it will result in a logged error.}} | |||
|s1= [[name]] object | |s1= [[name]] object | ||
Line 36: | Line 40: | ||
|s2= [[name]] location | |s2= [[name]] location | ||
|s2since= arma1 1.08 | |||
|p21= location: [[Location]] | |p21= location: [[Location]] | ||
|r2= [[String]] | |r2= [[String]] - the location's ''name''. To get its textual value, use [[text]] (see {{Link|#Example 3}}) | ||
|x1= <sqf>_name = name player;</sqf> | |x1= <sqf>_name = name player;</sqf> | ||
Line 50: | Line 56: | ||
</sqf> | </sqf> | ||
|seealso= [[profileName]] [[setName]] [[nameSound]] [[setNameSound]] [[createLocation]] [[deleteLocation | |seealso= [[profileName]] [[setName]] [[setIdentity]] [[nameSound]] [[setNameSound]] [[createLocation]] [[deleteLocation]] [[locationPosition]] [[nearestLocation]] [[nearestLocations]] [[nearestLocationWithDubbing]] | ||
}} | }} | ||
{{Note | |||
|user= Kju | |||
|timestamp= 20170130194200 | |||
|text= [[Location]] variant appears to be only for the 3d editor. | |||
}} | |||
{{Note | |||
|user= Alef | |||
|timestamp= 20090414014100 | |||
|text= Will return {{hl|Error: No vehicle}} for [[Multiplayer Scripting#Join In Progress|JIP]] players in [[init.sqf]], if no [[sleep]] were performed. | |||
}} | |||
Revision as of 18:45, 20 April 2023
Description
- Description:
- When argument is Object, the command returns the name given to a unit using the setIdentity instruction or selected randomly by the game engine if setIdentity has not been used on the unit. If used on vehicle, name of first crew member (in order commander, driver, gunner). If used on an object, "Error: No unit" is being returned.
- Multiplayer:
- name returns profileName, eventually suffixed by the server in the event of identical names, e.g username/username (2).
- Problems:
- Groups:
- Unit IdentityLocations
Syntax
Alternative Syntax
- Syntax:
- name location
- Parameters:
- location: Location
- Return Value:
- String - the location's name. To get its textual value, use text (see Example 3)
Examples
- Example 1:
- Example 2:
- Example 3:
- name nearestLocation [position player, "Hill"]; // "" text nearestLocation [position player, "Hill"]; // "Lesnoy Khrebet"
Additional Information
- See also:
- profileName setName setIdentity nameSound setNameSound createLocation deleteLocation locationPosition nearestLocation nearestLocations nearestLocationWithDubbing
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 Jan 30, 2017 - 19:42 (UTC)
- Location variant appears to be only for the 3d editor.
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: Unit Identity
- Command Group: Locations