Scripts:Off-center camera

From OHRRPGCE-Wiki
Jump to navigation Jump to search

This script causes the camera to follow the party leader, but places them off-center on the screen. It uses the camera follows slice command to focus the camera on an invisible slice which is attached to the hero but to the side of it. Set this as your new-game and load-game script:

global variable (1, camera sl)

plotscript, offcenter camera, begin
  if (not(slice is valid(camera sl))) then (
    camera sl := create container
  )
  set parent (camera sl, get hero slice (0))
  put slice (camera sl, 60, 0)  # 60 pixels right, 0 down
  camera follows slice (camera sl)
end

However, any time you or the player swaps which hero is the party leader (including when the leader is removed from the party) the camera is reset to follow the new leader, so you need to correct the camera by re-running the script. There's no script trigger available to do so automatically, so you'll have to run the script after the player uses the Team/Order menu, by replacing those menu options with scripts that show the menu and then run 'offcenter camera'.