BIS fnc getName: Difference between revisions
Lou Montana (talk | contribs) m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ :\\\-\/|()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}") |
(More information from the function code) |
||
| (11 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
{{RV|type=function | {{RV|type=function | ||
| arma3 | |game1= arma3 | ||
|version1= 1.00 | |||
| | |gr1= Object Manipulation | ||
| | |descr= Returns name of a unit. Name of unit is stored in it is namespace so it can be retrieved later, mainly for when unit dies. Name is stored in the variable '''BIS_fnc_getName_name'''. | ||
If the unit is alive, this function does [[name]] and returns the result, and saves the result to the variable on the unit. If the unit is dead, the function tries to retrieve the saved name from the variable on the unit, and returns "" if none is saved, unless forcedWhenDead is set to [[true]]. | |||
| [object] call [[BIS_fnc_getName]] | |s1= [object] call [[BIS_fnc_getName]] | ||
|p1= object: [[Object]] - | |p1= object: [[Object]] - object whose name should be returned | ||
| [[ | |p2= forcedWhenDead: [[Boolean]] - (Optional, default [[false]]) forces the function to do [[name]] on the unit if it's dead and has no name saved in the variable. Might have inconsistent results. | ||
| | |p3= maxCharacters: [[Number]] - (Optional, default -1) the name returned will be limited to this length. -1 for no limit. The name saved to the variable is not limited. | ||
|r1= [[String]] - unit's name | |||
|x1= <sqf>[player] call BIS_fnc_getName;</sqf> | |||
|seealso= [[name]] | |seealso= [[name]] | ||
}} | }} | ||
Latest revision as of 02:54, 12 April 2026
Description
- Description:
- Returns name of a unit. Name of unit is stored in it is namespace so it can be retrieved later, mainly for when unit dies. Name is stored in the variable BIS_fnc_getName_name. If the unit is alive, this function does name and returns the result, and saves the result to the variable on the unit. If the unit is dead, the function tries to retrieve the saved name from the variable on the unit, and returns "" if none is saved, unless forcedWhenDead is set to true.
- Execution:
- call
- Groups:
- Object Manipulation
Syntax
- Syntax:
- [object] call BIS_fnc_getName
- Parameters:
- object: Object - object whose name should be returned
- forcedWhenDead: Boolean - (Optional, default false) forces the function to do name on the unit if it's dead and has no name saved in the variable. Might have inconsistent results.
- maxCharacters: Number - (Optional, default -1) the name returned will be limited to this length. -1 for no limit. The name saved to the variable is not limited.
- Return Value:
- String - unit's name
Examples
- Example 1:
Additional Information
- See also:
- name
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord.
Only post proven facts here! Add Note