name: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Add specifics about identical names)
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 46: Line 46:


|r2= [[String]] - the location's ''name''. To get its textual value, use [[text]] (see {{Link|#Example 3}})
|r2= [[String]] - the location's ''name''. To get its textual value, use [[text]] (see {{Link|#Example 3}})
|s3= [[name]] namespace
|s3since= arma3 2.18
|p41= namespace: [[Namespace]]
|r3= [[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)


|x1= <sqf>_name = name player;</sqf>
|x1= <sqf>_name = name player;</sqf>
Line 55: Line 72:
text nearestLocation [position player, "Hill"]; // "Lesnoy Khrebet"
text nearestLocation [position player, "Hill"]; // "Lesnoy Khrebet"
</sqf>
</sqf>
|x4= <sqf>_currentNamespace = name currentNamespace;</sqf>


|seealso= [[profileName]] [[setName]] [[setIdentity]] [[nameSound]] [[setNameSound]] [[createLocation]] [[deleteLocation]] [[locationPosition]] [[nearestLocation]] [[nearestLocations]] [[nearestLocationWithDubbing]]
|seealso= [[profileName]] [[setName]] [[setIdentity]] [[nameSound]] [[setNameSound]] [[createLocation]] [[deleteLocation]] [[locationPosition]] [[nearestLocation]] [[nearestLocations]] [[nearestLocationWithDubbing]]

Latest revision as of 23:20, 3 July 2024

Hover & click on the images for description

Description

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.
Multiplayer:
name returns profileName, eventually suffixed by the server in the event of identical names, e.g username/username (2).
Problems:
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.
Groups:
Unit IdentityLocations

Syntax 1

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

Syntax 2

Syntax:
name location
Parameters:
location: Location
Return Value:
String - the location's name. To get its textual value, use text (see Example 3)

Syntax 3

Syntax:
name namespace
Parameters:
namespace: Namespace
Return Value:
String - namespace's name. Possible values:

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;

Additional Information

See also:
profileName setName setIdentity nameSound setNameSound createLocation deleteLocation locationPosition nearestLocation nearestLocations nearestLocationWithDubbing

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
Kju - c
Posted on Jan 30, 2017 - 19:42 (UTC)
Location variant appears to be only for the 3d editor.
Alef - c
Posted on Apr 14, 2009 - 01:41 (UTC)
Will return Error: No vehicle for JIP players in init.sqf, if no sleep were performed.