setName: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<h3 style="display:none">Bottom Section</h3> " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma1 |Game name=
| arma1


|1.08|Game version=
|1.08


|arg= global |Multiplayer Arguments=
|arg= global


|eff= local |Multiplayer Effects=
|eff= local


|gr1= Unit Identity |GROUP1=
|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. |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.


| object '''setName''' name |SYNTAX=
| object '''setName''' name


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


|[[Nothing]] |RETURNVALUE=
|[[Nothing]]


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


|p21= unit: [[Object]] |PARAMETER21=
|p21= unit: [[Object]] |PARAMETER21=
Line 28: Line 28:
|p25= lastName: [[String]] |PARAMETER25=
|p25= lastName: [[String]] |PARAMETER25=


|r2= [[Nothing]] |RETURNVALUE2=
|r2= [[Nothing]]


|s3= location '''setName''' name |SYNTAX3=
|s3= location '''setName''' name


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


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


| [[name]], [[nameSound]], [[setNameSound]], [[setIdentity]] |SEEALSO=
| [[name]], [[nameSound]], [[setNameSound]], [[setIdentity]]


}}
}}

Revision as of 12:11, 18 January 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 Identity

Syntax 1

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

Syntax 2

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

Syntax 3

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

Notes

Posted on July 9, 2010‎
kju
Appears to be only for the 3d editor.
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.