API:GetNameForObject
From RoR Wiki
UI Lua API · Target functions
Version: WAR 1.4.8
Returns the name of a nearby world object.
name = GetNameForObject(objectId)
Arguments
- objectId
number– Object id of the world object.
Returns
- name
wstring– Name of the object, orL"".
Details
L""is returned when the object is not known to the client, when there is no player object, when the object does not accept the player's realm (Order or Destruction), or when it is more than 180 units away from the player.- The stock interaction windows use it for the name of the NPC the player is talking to and check for
L"".
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
From ea_interactionwindow/source/interactionquestwindow.lua:
local targetName = GetNameForObject(sourceID)
local displayName = L" "
if (targetName ~= L"")
then
displayName = GetStringFormat( StringTables.Default.INTERACTOR_NAME_FORMAT, { targetName } )
end
