Location variant appears to be only for the 3d editor.
Description
When argument is Object, the command returns the name given to a unit using the setIdentity instruction or selected randomly by the game engine if setIdentity has not been used on the unit. If used on vehicle, name of first crew member (in order commander, driver, gunner). If used on an object, "Error: No unit" is being returned.
Syntax
Syntax 1
name object
Parameters:
object: Object
Returns: String
Syntax 2
since arma1 1.08
name location
Parameters:
location: Location
Returns: String - the location's name. To get its textual value, use text (see #Example 3)
Syntax 3
since arma3 2.18
name namespace
Parameters:
namespace: Namespace
Returns: String - namespace's name. Possible values:
- "mission" - for missionNamespace
- "profile" - for profileNamespace
- "ui" - for uiNamespace
- "parsing" - for parsingNamespace
- "local" - for localNamespace
- "missionprofile" - for missionProfileNamespace
- "server" - for serverNamespace
- "" - for some unnamed namespaces like temporary or server config for example.
- "null" - null namespace (this should never happen)
Syntax 4
since arma3 2.22
name scriptHandle
Parameters:
scriptHandle: Script Handle
Returns: String - The name given to the script via scriptName or the name passed to spawn when creating a "Empty Handle"
Examples
Example 1
_name = name player;
Example 2
_locationName = name myLocation;
Example 3
name nearestLocation [position player, "Hill"]; // ""
text nearestLocation [position player, "Hill"]; // "Lesnoy Khrebet"
Example 4
_currentNamespace = name currentNamespace;
Multiplayer
name returns profileName, eventually suffixed by the server in the event of identical names, e.g username/username (2).
Problems
Important
If the provided unit is dead and has been removed from its group, its identity has then been purged to save memory and using name on it will result in a logged error.
See also
profileName · setName · setIdentity · nameSound · setNameSound · createLocation · deleteLocation · locationPosition · nearestLocation · nearestLocations · nearestLocationWithDubbing
Community notes
Will return Error: No vehicle for JIP players in init.sqf, if no sleep were performed.