API:NifDisplaySetTranslation
From RoR Wiki
UI Lua API · Interface functions
Version: WAR 1.4.8
Sets the translation (position offset) of the 3D model shown in a NifDisplay window.
NifDisplaySetTranslation(windowName, x, y, z)
Arguments
- windowName
string– Name of a NifDisplay window.- x, y, z
number– The translation along the three axes.
Returns
Nothing.
Details
- The three values are stored as the display's translation. They are not range-checked.
- The stock barber shop uses it to adjust the character shown in its "mirror", with different values for tall and short races (see the example). Its comment for orcs reads "need camera further back".
- The stock UI does not call it anywhere else.
- The function needs at least four arguments and only reads the last four.
Errors
These are written to the UI log; the call returns normally.
Error in function call 'NifDisplaySetTranslation': Window %s does not existError in function call 'NifDisplaySetTranslation': Window %s is not a NifDisplay
Example
From ea_barbershopwindow/source/barbershopwindow.lua:
-- For some characters, we need to tweak the NifDisplay to make sure they show up in the mirror appropriately
if ( ( ( GameData.Player.race.id == GameData.Races.HIGH_ELF ) or ( GameData.Player.race.id == GameData.Races.DARK_ELF ) ) and ( GameData.Player.gender == GameData.Gender.MALE ) )
then
-- Male high elves and dark elves are very tall
NifDisplaySetTranslation( mainWindowName.."CharacterNif", 0, -80, 66 )
...
elseif ( GameData.Player.race.id == GameData.Races.DWARF )
then
-- Dwarves are very short
NifDisplaySetTranslation( mainWindowName.."CharacterNif", 0, -110, 37 )
