setName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<!-- Note Section [A-Z]+ --> " to "")
(page overhaul)
Line 1: Line 1:
{{RV|type=command
{{RV|type=command


| arma1
|game1= arma1


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


|arg= global
|arg= global
Line 11: Line 27:
|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. In Arma 3 this can be used to set [[name]] of a person but only in single player.
 
|s1= unit '''setName''' name
 
|p1= unit: [[Object]]


|p1= object: [[Object]]
|p2= name: [[String]]
|p2= name: [[String]]


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


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


|p21= unit: [[Object]]
|p21= unit: [[Object]]
|p22= [name, firstName, lastName]: [[Array]]
 
|p23= name: [[String]]
|p22= name: [[String]]
|p24= firstName: [[String]]
 
|p25= lastName: [[String]]
|p23= firstName: [[String]]
 
|p24= lastName: [[String]]


|r2= [[Nothing]]
|r2= [[Nothing]]
Line 32: Line 53:
|s3= location '''setName''' name
|s3= location '''setName''' name


|p31= location: [[Location]]
|p41= location: [[Location]]
|p32= name: [[String]]
 
|p42= name: [[String]]


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


Line 45: Line 69:


<dl class="command_description">
<dl class="command_description">
<dt><dt>
<dd class="notedate">Posted on July 9, 2010‎</dd>
<dt class="note">[[User:kju|kju]]</dt>
<dd class="note">Appears to be only for the 3d editor.
<dt><dt>
<dd class="notedate">Posted on September 19, 2013‎</dd>
<dd class="notedate">Posted on September 19, 2013‎</dd>
<dt class="note">[[User:Druid|Druid]]</dt>
<dt class="note">[[User:Druid|Druid]]</dt>
Line 64: Line 83:
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.
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>
<BR><BR>
</dl>
</dl>
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
{{GameCategory|arma3|New Scripting Commands}}

Revision as of 08:36, 26 May 2021

Hover & click on the images for description

Description

Description:
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.
Groups:
Unit IdentityLocations

Syntax 1

Syntax:
unit setName name
Parameters:
unit: Object
name: String
Return Value:
Nothing

Syntax 2

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

Syntax 3

Syntax:
location setName name
Parameters:
location: Location
name: 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:
namenameSoundsetNameSoundsetIdentity

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 September 19, 2013‎
Druid
Support of a person as the first parameter from Arma 3 v. 1.02.
Posted on April 12, 2014
Waffle SS.
Seems to have no effect on players in Multiplayer. (Arma 3 v1.00)
Posted on August 18, 2014
Pierre MGI
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.

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.