setName: Difference between revisions
Lou Montana (talk | contribs) (Fix versions) |
Lou Montana (talk | contribs) m (Text replacement - " ''via'' " to " via ") |
||
Line 63: | Line 63: | ||
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> | 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). | 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 | 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 12:44, 21 February 2025
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
- Syntax:
- unit setName [name, firstName, lastName]
- Parameters:
- unit: Object
- name: String
- firstName: String
- lastName: String
- Return Value:
- Nothing
Examples
- Example 1:
- CopymyLocation 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. cthis setName _myNameArray will display c_myNameArray select 2.
If setName is used with a string e.g cthis 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 cforEach 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