name: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (template:command argument fix)
(36 intermediate revisions by 17 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|NAME]]
{{Command|= Comments
[[Category:Scripting Commands OFP 1.97|NAME]]
____________________________________________________________________________________________
[[Category:Scripting Commands OFP 1.46|NAME]]
 
[[Category:Scripting Commands ArmA|NAME]]
| ofp |= Game name
 
|1.00|= Game version
____________________________________________________________________________________________
 
| 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.
 
<br><br>'''NOTE:''' In Arma 3 [[setName]] can be used on a person to set [[name]]. However in multiplayer [[name]] always returns [[profileName]]. |DESCRIPTION=
____________________________________________________________________________________________
 
| '''name''' object |SYNTAX=
 
|p1= object: [[Object]]|PARAMETER1=


| [[String]] |RETURNVALUE=


<h2 style="color:#000066">'''name ''object'''''</h2>
| s2= '''name''' location |SYNTAX=


|p21= location: [[Location]] |PARAMETER1=


'''Operand types:'''
| r2= [[String]] |RETURNVALUE=
____________________________________________________________________________________________
 
|x1= <code>_name = [[name]] [[player]];</code> |EXAMPLE1=
|x2= <code>_locationName = [[name]] myLocation;</code> |EXAMPLE2=
|x3= <code>[[name]] [[nearestLocation]] <nowiki>[</nowiki>[[position]] [[player]], "Hill"]; //""
[[text]] [[nearestLocation]] <nowiki>[</nowiki>[[position]] [[player]], "Hill"]; //"Lesnoy Khrebet"</code> |EXAMPLE3=
____________________________________________________________________________________________


'''object:''' [[Object]]
| [[profileName]], [[setName]], [[nameSound]], [[setNameSound]], [[createLocation]], [[deleteLocation]], [[drawLocation]], [[locationPosition]], [[locationNull]], [[nearestLocation]], [[nearestLocations]], [[nearestLocationWithDubbing]]|SEEALSO=


'''Type of returned value:'''
}}


[[String]]
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


'''Description:'''
<dt class="note">'''[[User:kju|kju]]'''
<dd class="note">[[Location]] variant appears to be only for the 3d editor.


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.
<!-- Note Section END -->
</dl>
<dl class="command_description">
<!-- Note Section BEGIN -->


If used on vehicle, name of first crew member (in order commander, driver, gunner).
<dd class="notedate">Posted on August 4, 2006 - 10:56
<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.


'''Example:'''
<dd class="notedate">Posted on December 15, 2006 - 05:27
<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]


_name = '''name''' [[vehicle]] [[player]]
<dd class="notedate">Posted on April 14, 2009
<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>


'''Comments:'''


'''name''' will return an error for units that have been dead for more than a few seconds.
[[Category:Scripting Commands|NAME]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|NAME]]
[[Category:Scripting Commands OFP 1.46|NAME]]
[[Category:Scripting Commands ArmA|NAME]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Object_Information|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Locations|{{uc:{{PAGENAME}}}}]]

Revision as of 15:44, 7 April 2019

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.

NOTE: In Arma 3 setName can be used on a person to set name. However in multiplayer name always returns profileName.
Groups:
Uncategorised

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

Notes

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

Bottom Section