setName: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " |game2= arma2 |version2= 1.00 |game3= arma2oa |version3= 1.51" to " |game2= arma2 |version2= 1.00 |game3= arma2oa |version3= 1.50") |
Lou Montana (talk | contribs) (Fix versions) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 24: | Line 24: | ||
|gr2= Locations | |gr2= Locations | ||
|descr= Sets the name of a location or a person | |descr= Sets the name of a location or a person (person only in single player). | ||
|s1= | |s1= thing [[setName]] name | ||
|p1= | |p1= thing: [[Location]] or {{GVI|arma3|1.02|size= 0.75}} [[Object]] | ||
|p2= name: [[String]] | |p2= name: [[String]] | ||
|r1=[[Nothing]] | |r1= [[Nothing]] | ||
|s2= unit | |s2= unit [[setName]] [name, firstName, lastName] | ||
|s2since= arma3 1.02 | |||
|p21= unit: [[Object]] | |p21= unit: [[Object]] | ||
Line 46: | Line 48: | ||
|r2= [[Nothing]] | |r2= [[Nothing]] | ||
| | |x1= <sqf>myLocation setName "My Location Name";</sqf> | ||
| | |x2= <sqf>player setName "New Name";</sqf> | ||
| | |x3= <sqf>player setName ["Ben Kerry","Ben","Kerry"];</sqf> | ||
| | |seealso= [[name]] [[nameSound]] [[setNameSound]] [[setIdentity]] | ||
}} | |||
| | {{Note | ||
|user= Pierre MGI | |||
|timestamp= 20140818221500 | |||
|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>. | |||
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> | |||
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 18:35, 20 April 2023
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 1.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:
- Example 3:
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
- 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.
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.08
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Unit Identity
- Command Group: Locations
- Scripting Commands: Local Effect