Camera

From Ashes of the Singularity
Jump to: navigation, search

The Camera command moves the player's view to a specific area.

Arguments

  • Position - Where the camera will be looking.
  • Snap - Set to 1 to move the camera instantly, instead of panning
  • Speed - Scalar for how fast the camera will move, compared to clicking on the minimap. 0.5 for half speed, 2 for double, etc.
  • Unit - Follow a specific script-spawned unit. Do not use Position if you use this.
  • Building - Follow a specific script-spawned building. Do not use Position if you use this.
  • Save - Save the current camera settings. Useful if you want to show the player something and then move the camera back to whatever they were looking at.
  • Load - Load the last saved camera settings. Use with Save. May cause a crash if you haven't previously saved a camera position.
  • RTP - Distance, rotation and pitch of the camera.
    • The first number is distance. 1000 is a fairly tight shot, 2500 is a fairly typical gameplay zoom
    • Second number is rotation. 0 points the camera north, 90 east, 180 south, 270 west.
    • Third number is pitch. 40-50 are typical gameplay angles. 90 would be straight down. Note that anything lower than 40 can cause the engine to load a lot more terrain and models than it's designed to, so use with caution.

Common Usage

  • Showing the player something interesting or relevant to ongoing dialog

Limitations

  • Stealing camera control away from the player is jarring and should be used sparingly
  • Setting the pitch too low can cause performance issues and even crashes if the engine tries to render too many things at once

Example

 <Trigger Name="CameraFix" Type="Timer" Timer="0" >
  <SpawnUnit Name="Bomber" Template="PHC_A_Hades" Player="1" Position="-4150,1479,0" NoDeath="1" />
  <AttackAttackMove Name="Bomber" Position="-3900,4500,0"/>
  <Camera Position="-2300,0" RTP="3800,180,150" Snap="1" />   
  <LetterBox Enable="1" Snap="1" />
  <HidePanel HidePlayer="1" HideRank="1" HideResource="1"/>
  <ActivateTrigger Target="SetupBattle" />
 </Trigger>

This sets up a very specific shot to start the Kepler mission of Imminent Crisis. Using it in combination with LetterBox means that the player must advance through the dialog called by subsequent triggers before gaining control of the camera.