Difference between revisions of "name"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " \| *(game[0-9]|version[0-9]|gr[0-9]|serverExec|mp|pr|descr|s[0-9]|p[0-9]{1,3}|r[0-9]|x1?[0-9]|seealso) *= +" to " |$1= ")
 
(58 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Command|= Comments
+
{{RV|type=command
____________________________________________________________________________________________
 
  
| ofp |= Game name
+
|game1= ofp
 +
|version1= 1.00
  
|1.00|= Game version
+
|game2= ofpe
____________________________________________________________________________________________
+
|version2= 1.00
  
| 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.
+
|game3= arma1
 +
|version3= 1.00
  
If used on vehicle, name of first crew member (in order commander, driver, gunner).
+
|game4= arma2
 +
|version4= 1.00
  
If used on an object, "Error: No unit" is being returned. |= Description
+
|game5= arma2oa
____________________________________________________________________________________________
+
|version5= 1.50
  
| [[String]] <nowiki>=</nowiki> '''name''' object |= Syntax
+
|game6= tkoh
 +
|version6= 1.00
  
|p1= object: [[Object]] |= Parameter 1
+
|game7= arma3
 +
|version7= 0.50
  
| [[String]] |= Return value
+
|gr1= Unit Identity
____________________________________________________________________________________________
 
 
 
|x1= <code>_name <nowiki>=</nowiki> '''name''' [[vehicle]] [[player]]</code> |= Example 1
 
____________________________________________________________________________________________
 
  
| |= See also
+
|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.<br>
 +
When argument is [[Location]], the location's name is returned. To return the textual value of a location use [[text]] command instead.{{Feature | arma3 | [[setName]] can be used on a person to set [[name]]. However in multiplayer [[name]] always returns [[profileName]].}}
 +
 
 +
|s1= [[name]] object
 +
 
 +
|p1= object: [[Object]]
 +
 
 +
|r1= [[String]]
 +
 
 +
|s2= [[name]] location
 +
 
 +
|p21= location: [[Location]]
 +
 
 +
|r2= [[String]]
  
<h3 style="display:none">Notes</h3>
+
|x1= <code>_name = [[name]] [[player]];</code>
<dl class="command_description">
 
<!-- Note Section BEGIN -->
 
  
<dd class="notedate">Posted on August 4, 2006 - 10:56
+
|x2= <code>_locationName = [[name]] myLocation;</code>
<dt class="note">'''[[User:Hardrock|hardrock]]'''<dd class="note">''Notes from before the conversion:''
 
  
Name will return an error for units that have been dead for more than a few seconds.
+
|x3= <code>[[name]] [[nearestLocation]] [<nowiki/>[[position]] [[player]], "Hill"]; {{cc|""}}
 +
[[text]] [[nearestLocation]] [<nowiki/>[[position]] [[player]], "Hill"]; {{cc|"Lesnoy Khrebet"}}</code>
  
<dd class="notedate">Posted on December 15, 2006 - 05:27
+
|seealso= [[profileName]], [[setName]], [[nameSound]], [[setNameSound]], [[createLocation]], [[deleteLocation]], [[drawLocation]], [[locationPosition]], [[locationNull]], [[nearestLocation]], [[nearestLocations]], [[nearestLocationWithDubbing]]
<dt class="note">'''[[User:Kronzky|Kronzky]]'''<dd class="note">To return the name of the unit that was given in the editor's "name" field, call up the unit's object in a format statement:
+
}}
hint format["Unit's name: %1",_unitobject]
 
  
<dd class="notedate">Posted on April 14, 2009
+
<dl class="command_description">
<dt class="note">'''[[User:Alef|alef]]'''
 
<dd class="note">Will return
 
Error: No vehicle
 
for JIP players in init.sqf, if no [[sleep]] were performed
 
<!-- Note Section END -->
 
</dl>
 
  
<h3 style="display:none">Bottom Section</h3>
+
<dt class="note">[[User:kju|kju]]</dt>
 +
<dd class="note">[[Location]] variant appears to be only for the 3d editor.
  
 +
<dt><dt>
 +
<dd class="notedate">Posted on August 4, 2006 - 10:56</dd>
 +
<dt class="note">[[User:Hardrock|hardrock]]</dt>
 +
<dd class="note">''Notes from before the conversion:''
  
[[Category:Scripting Commands|NAME]]
+
Name will return an error for units that have been dead for more than a few seconds.
[[Category:Scripting Commands OFP 1.96|NAME]]
+
<dt><dt>
[[Category:Scripting Commands OFP 1.46|NAME]]
+
<dd class="notedate">Posted on December 15, 2006 - 05:27</dd>
[[Category:Scripting Commands ArmA|NAME]]
+
<dt class="note">[[User:Kronzky|Kronzky]]</dt>
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
+
<dd class="note">To return the name of the unit that was given in the editor's "name" field, call up the unit's object in a format statement:
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
+
<code>[[hint]] [[format]] ["Unit's name: %1", _unitobject];</code>
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
+
<dt><dt>
[[Category:Command_Group:_Object_Information|{{uc:{{PAGENAME}}}}]]
+
<dd class="notedate">Posted on April 14, 2009</dd>
 +
<dt class="note">[[User:Alef|alef]]</dt>
 +
<dd class="note">Will return <tt>Error: No vehicle</tt> for [[Multiplayer Scripting#Join In Progress|JIP]] players in [[init.sqf]], if no [[sleep]] were performed
 +
</dl>

Latest revision as of 23:17, 19 June 2021

Hover & click on the images for description

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.
When argument is Location, the location's name is returned. To return the textual value of a location use text command instead.
Arma 3
setName can be used on a person to set name. However in multiplayer name always returns profileName.
Groups:
Unit IdentityLocations

Syntax

Syntax:
name object
Parameters:
object: Object
Return Value:
String

Alternative Syntax

Syntax:
name location
Parameters:
location: Location
Return Value:
String

Examples

Example 1:
_name = name player;
Example 2:
_locationName = name myLocation;
Example 3:
name nearestLocation [position player, "Hill"]; // "" text nearestLocation [position player, "Hill"]; // "Lesnoy Khrebet"

Additional Information

See also:
profileNamesetNamenameSoundsetNameSoundcreateLocationdeleteLocationdrawLocationlocationPositionlocationNullnearestLocationnearestLocationsnearestLocationWithDubbing

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
kju
Location variant appears to be only for the 3d editor.
Posted on August 4, 2006 - 10:56
hardrock
Notes from before the conversion: Name will return an error for units that have been dead for more than a few seconds.
Posted on December 15, 2006 - 05:27
Kronzky
To return the name of the unit that was given in the editor's "name" field, call up the unit's object in a format statement: hint format ["Unit's name: %1", _unitobject];
Posted on April 14, 2009
alef
Will return Error: No vehicle for JIP players in init.sqf, if no sleep were performed