Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:AttachTrophyToLocation

From RoR Wiki
Revision as of 19:40, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Item functions
Version: WAR 1.4.8

Asks the server to attach an equipped trophy to a different point on the character.

AttachTrophyToLocation(trophyPosition, trophyLocation, trophyLocIndex)

Arguments

trophyPosition
number – Which trophy slot, 1 to 5 (the index into the GetTrophyData table).
trophyLocation
number – Attachment point location (trophyLocation from GetLocationsForTrophies).
trophyLocIndex
number – Attachment point index (trophyLocIndex from the same table), starting at 1.

Returns

Nothing.

Details

  • The request is only sent when:
    • the trophy slot holds a trophy (GameData.ItemTypes.TROPHY);
    • the requested location or index differs from the one the trophy already has;
    • the requested location passes the client's check against the trophy's allowed locations.
Otherwise the call does nothing.
  • The client does not range-check trophyPosition. Use 1 to 5.
  • The function needs at least three arguments and only reads the last three.

Errors

None besides the generic Invalid Parameters message when an argument is not a number.

Example

Moving the selected trophy to the next free attachment point, from default/ea_characterwindow/source/characterwindowtrophies.lua:

local trophyData = CharacterWindow.trophyData[CharacterWindow.currentlySelectedTrophyPosition]

local startIndex = CharacterWindow.GetIndexForTrophyLoc( trophyData.trophyLocation, trophyData.trophyLocIndex )
local index, attachPointData = CharacterWindow.GetNextAvailableAttachmentPoint( trophyData, startIndex+1 )

if index ~= 0 then
    AttachTrophyToLocation( CharacterWindow.currentlySelectedTrophyPosition, attachPointData.trophyLocation, attachPointData.trophyLocIndex)
end

See also