setName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{Command " to "{{RV|type=command ")
(Fix versions)
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma1
|game1= arma1
|version1= 1.08


|1.08
|game2= arma2
|version2= 1.00
 
|game3= arma2oa
|version3= 1.50
 
|game4= tkoh
|version4= 1.00
 
|game5= arma3
|version5= 0.50


|arg= global
|arg= global
Line 11: Line 22:
|gr1= Unit Identity
|gr1= Unit Identity


| Sets the name of a location or a person. In Arma 3 this can be used to set [[name]] of a person but only in single player.
|gr2= Locations


| object '''setName''' name
|descr= Sets the name of a location or a person (person only in single player).


|p1= object: [[Object]]
|s1= thing [[setName]] name
|p2= name: [[String]]


|[[Nothing]]
|p1= thing: [[Location]] or {{GVI|arma3|1.02|size= 0.75}} [[Object]]


|s2= unit '''setName''' [name, firstName, lastName]
|p2= name: [[String]]
 
|p21= unit: [[Object]] |PARAMETER21=
|p22= [name, firstName, lastName]: [[Array]] |PARAMETER22=
|p23= name: [[String]] |PARAMETER23=
|p24= firstName: [[String]] |PARAMETER24=
|p25= lastName: [[String]] |PARAMETER25=


|r2= [[Nothing]]
|r1= [[Nothing]]


|s3= location '''setName''' name
|s2= unit [[setName]] [name, firstName, lastName]


|p31= location: [[Location]] |PARAMETER31=
|s2since= arma3 1.02
|p32= name: [[String]] |PARAMETER32=


|r3=[[Nothing]]
|p21= unit: [[Object]]
 
|x1= <code>myLocation [[setName]] "My Location Name";</code>
|x2= <code>[[player]] [[setName]] "New Name";</code>
|x3= <code>[[player]] [[setName]] ["Ben Kerry","Ben","Kerry"];</code>


| [[name]], [[nameSound]], [[setNameSound]], [[setIdentity]]
|p22= name: [[String]]
}}


<dl class="command_description">
|p23= firstName: [[String]]
<!-- Note Section BEGIN -->


<dd class="notedate">Posted on July 9, 2010‎
|p24= lastName: [[String]]
<dt class="note">[[User:kju|kju]]
<dd class="note">Appears to be only for the 3d editor.


<dd class="notedate">Posted on September 19, 2013‎
|r2= [[Nothing]]
<dt class="note">[[User:Druid|Druid]]
<dd class="note">Support of a person as the first parameter from Arma 3 v. 1.02.


<dd class="notedate">Posted on April 12, 2014
|x1= <sqf>myLocation setName "My Location Name";</sqf>
<dt class="note">[[User:Waffle SS.|Waffle SS.]]
<dd class="note">Seems to have no effect on players in Multiplayer. (Arma 3 v1.00)


<dd class="notedate">Posted on August 18, 2014
|x2= <sqf>player setName "New Name";</sqf>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]
<dd class="note">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 : this setname "blah", nothing occurs in command bar and default randomized name is displayed.
<br><br>
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 setname function.
<BR><BR>


<!-- Note Section END -->
|x3= <sqf>player setName ["Ben Kerry","Ben","Kerry"];</sqf>
</dl>


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


 
{{Note
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
|user= Pierre MGI
{{GameCategory|arma1|Scripting Commands}}
|timestamp= 20140818221500
{{GameCategory|arma2|Scripting Commands}}
|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>.
{{GameCategory|arma3|Scripting Commands}}
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>
{{GameCategory|tkoh|Scripting Commands}}
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).
{{GameCategory|arma3|New Scripting Commands}}
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 18: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.