setName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Appears to be only for the 3d editor.)
(Fix versions)
 
(72 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= arma1
|version1= 1.08


|1.08|= Game version
|game2= arma2
|version2= 1.00


|arg= |= Arguments in MP
|game3= arma2oa
|version3= 1.50


|eff= |= Effects in MP
|game4= tkoh
____________________________________________________________________________________________
|version4= 1.00


| Sets the name of a location|= Description
|game5= arma3
____________________________________________________________________________________________
|version5= 0.50


| location '''setName''' name |= Syntax
|arg= global


|p1= location: [[Location]] |= Parameter 1
|eff= local
|p2= name: [[String]] |= Parameter 2


| [[Nothing]] |= Return value
|gr1= Unit Identity
____________________________________________________________________________________________
 
|x1= <pre>myLocation setName "My Location Name"</pre> |= Example 1
____________________________________________________________________________________________


| [[name]] |= See also
|gr2= Locations


}}
|descr= Sets the name of a location or a person (person only in single player).
 
|s1= thing [[setName]] name
 
|p1= thing: [[Location]] or {{GVI|arma3|1.02|size= 0.75}} [[Object]]
 
|p2= name: [[String]]
 
|r1= [[Nothing]]
 
|s2= unit [[setName]] [name, firstName, lastName]
 
|s2since= arma3 1.02
 
|p21= unit: [[Object]]
 
|p22= name: [[String]]
 
|p23= firstName: [[String]]
 
|p24= lastName: [[String]]


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


<dt class="note">'''[[User:kju|kju]]'''</dt>
|x1= <sqf>myLocation setName "My Location Name";</sqf>
<dd class="note">Appears to be only for the 3d editor.</dd>


<!-- Note Section END -->
|x2= <sqf>player setName "New Name";</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|x3= <sqf>player setName ["Ben Kerry","Ben","Kerry"];</sqf>


|seealso= [[name]] [[nameSound]] [[setNameSound]] [[setIdentity]]
}}


[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
{{Note
[[Category:Scripting Commands ArmA|{{uc:{{PAGENAME}}}}]]
|user= Pierre MGI
[[Category:Command_Group:_Locations|{{uc:{{PAGENAME}}}}]]
|timestamp= 20140818221500
[[Category:Command_Group:_Editor_Control|{{uc:{{PAGENAME}}}}]]
|text= Only last name will appear in command bar i.e. <sqf inline>this setName _myNameArray</sqf> will display <sqf inline>_myNameArray select 2</sqf>.
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
If [[setName]] is used with a string e.g <sqf inline>this setName "blah"</sqf>, nothing occurs in the command bar and the default randomized name is displayed.<br><br>
[[Category:Scripting Commands VBS2|{{uc:{{PAGENAME}}}}]]
Dealing with the units' names in a script, _x (in a <sqf inline>forEach units _group</sqf>, for example) will return the "object" as {{hl|B ALFA 4-1:2}} or the name written in ai unit name field in editor (if exists).
This context is rather a "variable name" for each object (ai) than an "identity name" as given ''via'' the [[setName]] command.
}}

Latest revision as of 19:35, 20 April 2023

Hover & click on the images for description

Description

Description:
Sets the name of a location or a person (person only in single player).
Groups:
Unit IdentityLocations

Syntax

Syntax:
thing setName name
Parameters:
thing: Location or Arma 3 logo black.png1.02 Object
name: String
Return Value:
Nothing

Alternative Syntax

Syntax:
unit setName [name, firstName, lastName]
Parameters:
unit: Object
name: String
firstName: String
lastName: String
Return Value:
Nothing

Examples

Example 1:
myLocation setName "My Location Name";
Example 2:
player setName "New Name";
Example 3:
player setName ["Ben Kerry","Ben","Kerry"];

Additional Information

See also:
name nameSound setNameSound setIdentity

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
Pierre MGI - c
Posted on Aug 18, 2014 - 22:15 (UTC)
Only last name will appear in command bar i.e. this setName _myNameArray will display _myNameArray select 2. If setName is used with a string e.g this setName "blah", nothing occurs in the command bar and the default randomized name is displayed.

Dealing with the units' names in a script, _x (in a forEach units _group, for example) will return the "object" as B ALFA 4-1:2 or the name written in ai unit name field in editor (if exists). This context is rather a "variable name" for each object (ai) than an "identity name" as given via the setName command.