Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:TomeSetActivePlayerTitle

From RoR Wiki

UI Lua API · Tome functions
Version: WAR 1.4.8

Asks the server to make a title the player's displayed title, or to clear it.

TomeSetActivePlayerTitle(titleId)

Arguments

titleId
number – Id of an unlocked title, or 0 to show no title.

Returns

Nothing.

Details

  • The title must exist and be unlocked; otherwise an error is logged and nothing is sent.
  • The client sends the request to the server. The current title is published in GameData.Player.activeTitle, which the stock UI reads.
  • 0 always clears the title.

Errors

These are written to the UI log; the call returns normally.

  • Error in function call 'TomeSetActivePlayerTitle': %d is not a valid title id.
  • Error in function call 'TomeSetActivePlayerTitle': title %d is not yet unlocked.

Example

From ea_tomeofknowledge/source/tomewindow_rewards.lua, choosing a title from the list (the entry windows' ids are title ids):

local windowId = WindowGetId( SystemData.ActiveWindow.name )

if( TomeWindow.Rewards.currentState == STATE_TITLES )
then
    TomeSetActivePlayerTitle( windowId )
end

Clearing the title, from the same file:

if( GameData.Player.activeTitle ~= 0 )
then
    TomeSetActivePlayerTitle( 0 )
end

See also