GetObjectName
- Parameters
-
objectId integer
- comment
-
Returns localized value for field "name" for the given object type ID (unit, item, ability). In WorldEdit this is "Text - Name".
If the object ID is invalid, returns literal
Default string
in any locale.Example (Lua):
GetObjectName( FourCC("hfoo") ) --> "Footman"
- note
-
See:
UnitId2String
. - pure
- This function is pure. For the same values passed to it, it will always return the same value.
- async
- This function is asynchronous. The values it returns are not guaranteed to be the same for each player. If you attempt to use it in an synchronous manner it may cause a desync.
- bug
-
Do not use this in a global initialisation (on map init) as it crashes the game there.
- patch
-
1.13
- Source
- common.j (suggest an edit or discuss on Github)
- return type
-
string
- Source code
-
constant native GetObjectName takes integer objectId returns string