Cutscene Script Commands

Comment
    Place a comment in the script. Ignores all text after on the same line.
PlayAnim(actorName, animationName, tweenTime)
    Plays an animation on a cutscene actor.

actorName     (name)    – The name of the cutscene actor
animationName (name)    – The name of the animation
tweenTime     (integer) – Unused. Just set to 0. Amount of time in ticks to blend to the animation.
PlaySpeech()
    Does nothing.
PlayTune(fadeOutTime, musicName, loop, volume)
    Plays music.

fadeOutTime (float)          – The time in seconds the current music playing will fade out.
musicName   (name)           – The name of the music track.
loop        (integer)        – If is less than 1 will loop the music.
volume      (integer 0..127) – Volume of music.
PositionActor(actorName, x, y, z, ax, ay, az)
    Sets a cutscene actors position and rotation.

actorName (name)  – The name of the cutscene actor.
x         (float) – The actors X Position.
y         (float) – The actors Y Position.
z         (float) – The actors Z Position.
ax        (float) – The actors X Rotation in degrees.
ay        (float) – The actors Y Rotation in degrees.
az        (float) – The actors Z Rotation in degrees.
DefineCamera(cameraID, x, y, z, ax, ay, az)
    Setup a cameras position and rotation. Make it the active camera with SetCamera command.

cameraID (integer 0..19) – The camera to setup it's position and rotation.
x        (float)         – The cameras X Position.
y        (float)         – The cameras Y Position.
z        (float)         – The cameras Z Position.
ax       (float)         – The cameras X Rotation in degrees.
ay       (float)         – The cameras Y Rotation in degrees.
az       (float)         – The cameras Z Rotation in degrees.
SetCamera(cameraID)
    Sets the camera to be active. You should have previously called the DefineCamera command with the same cameraID.

cameraID (integer 0..19) – The camera to set active.
SetCameraMode(CAMERAMODE_FIXED)
    The camera will not move.
SetCameraMode(CAMERAMODE_MOVING)
    The camera will move.
SetCameraMode(CAMERAMODE_LOOK_AT_ACTOR, actorName)
    The camera will look at the center of the actor.

actorName (name) – The name of the cutscene actor
SetCameraMode(CAMERAMODE_REL_ACTOR, actorName, x, y, z)
    The camera will look at the center of the actor with an offset.

actorName (name)  – The name of the cutscene actor
x         (float) – The X Offset
y         (float) – The Y Offset
z         (float) – The Z Offset
SetCameraMode(CAMERAMODE_FOLLOW_PATH, sourcePathIndex, destPathIndex, sourceSpeed, destSpeed, sourceFrame, destFrame)
    The camera will follow a path.

sourcePathIndex (integer) – The index value of the paths array stored for the current cutscene. (Hardcoded)
destPathIndex   (integer) – The index value of the paths array stored for the current cutscene. (Hardcoded)
sourceSpeed     (integer) – The speed of the source path (is divided by 100).
destSpeed       (integer) – The speed of the dest path (is divided by 100).
sourceFrame     (integer) – The start frame of the source path.
destFrame       (integer) – The start frame of the dest path.
SetScriptID(sceneID)
    Sets up the dialog from the scene id.

sceneID (integer) – This value should be set to the id of the scene to play as defined in the
                    "cutscene\speech\script.txt" file.
                    <TITLE_SCENE00> for example has an id value of 0. The last 2 numbers (00) is the scene id.
ShowSubtitle(dialogID)
    Shows the subtitles for the dialogID.

dialogID (integer) – This value should be set to the id of the dialog to display as defined in the
                     "cutscene\speech\script.txt" file.
                     STT0001S for example has an id value of 1. The last 2 numbers (01) is the dialog id.
SetTextColor(actorName, r, g, b)
    Sets the color of the cutscene actors subtitles.

actorName (name)           – The name of the cutscene actor.
r         (integer 0..255) – red color value
g         (integer 0..255) – green color value
b         (integer 0..255) – blue color value
DefineSubtitle()
    Does nothing.
WaitSubtitle()
    Waits until no subtitles are showing and no speech audio is playing then continues to execute script commands.
EndSubtitle()
    Stops showing current subtitle.
SetSector(sectorID)
    Sets the players current sector if it exists.

sectorID (integer) – The sector to set to the players current sector.
ChangeSector(sectorID)
    Sets the active camera sector if it exists.

sectorID (integer) – The sector to set to the active camera.
WaitTime(time)
    Waits until a certain amount of time has passed then executes the next cutscene script.

time (float) - The amount of time in ticks to wait until the next cutscene script is executed.
CameraDampingOff(time)
    Amount of time to stop damping the cameras position and rotation.

time (integer) - The amount of time in ticks to stop camera damping.
CameraPan(X, pan, panTime)
    Pans the camera on the x axis.

pan     (float) - The amount to pan the camera on the X axis.
panTime (float) - The amount of time in 1/4 ticks to Pan the cameras position.
CameraPan(Y, pan, panTime)
    Pans the camera on the y axis.

pan     (float) - The amount to pan the camera on the Y axis.
panTime (float) - The amount of time in 1/4 ticks to Pan the cameras position.
CameraPan(Z, pan, panTime)
    Pans the camera on the z axis.

pan     (float) - The amount to pan the camera on the Z axis.
panTime (float) - The amount of time in 1/4 ticks to Pan the cameras position.
ExitLevel(levelID)
    Changes the level. You should use the ExitLevelPos command instead.

levelID (integer) - The level to change to.
ExitLevelPos(levelName, cutsceneName)
    Changes the level and plays a starting cutscene.

levelName    (name) - The name of the level to change to.
cutsceneName (name) - The name of the cutscene in that level to play.
LoadFlashFrame(texture, buffer)
    Sets the flash frame texture.

texture (integer) - The texture to display.
                    1  = "flash/Victor.tga"
                    2  = "flash/Avery.tga"
                    3  = "flash/Marco.tga"
                    4  = "flash/Jack.tga"
                    5  = "flash/Milton.tga"
                    6  = "flash/Legion.tga"
                    7  = "flash/eclipse.TGA"
                    8  = "flash/luke.TGA"
                    9  = "flash/teddy.tga"
                    10 = "flash/secret.tga"
                    11 = "frontend/images/flash/000NOMIP.tga"
                    12 = "frontend/images/flash/001NOMIP.tga"
                    13 = "frontend/images/flash/002NOMIP.tga"
                    14 = "frontend/images/flash/003NOMIP.tga"
                    15 = "frontend/images/flash/004NOMIP.tga"
buffer  (integer) - Unused. Just set to 0.
FlashFrame(texture, x, y, lifeSpan)
    Sets the flash frame position and life span. Call the LoadFlashFrame command before this to set the texture.

texture  (integer) - Unused. Just set to 0.
x        (integer) - The X Position of the flash frame from the center of the screen.
y        (integer) - The Y Position of the flash frame from the center of the screen.
lifeSpan (integer) - The life time of the flash frame in ticks. If value is less than 200 then this value is ignored.
Fade(type, lifeSpan, r, g, b)
    Starts a screen fade.

type     (integer) - The type of fade.
                     0 = Fade to color
                     1 = Fade to scene
                     2 = Make fade no longer active
                     3 = Fade to image
                     4 = Fade to load screen
                     5 = Fade from load screen
lifespan (integer)        - Amount of time in ticks the fade is active.
r        (integer 0..255) - The red color value of the fade when fading to color or scene.
g        (integer 0..255) - The green color value of the fade when fading to color or scene.
b        (integer 0..255) - The blue color value of the fade when fading to color or scene.
WaitFade()
    Waits until the screen is no longer fading until executing the next cutscene script command.
InitMarkers(sceneID)
    Loads speech level scene audio file and sets up markers from it. Call this command near the start of your script,
    before using other marker commands.

sceneID (integer) – This value should be set to the id of the scene to play as defined in the
                    "cutscene\speech\script.txt" file.
                    <TITLE_SCENE00> for example has an id value of 0. The last 2 numbers (00) is the scene id.
WaitNextMarker()
    Waits until the next speech audio marker is reached until executing the next cutscene script command.
WaitSubmarker(subPos)
    Waits for a time between the previous and next markers until executing the next cutscene script command.
    If the last marker was at 1 second in the audio speech file and the next marker is at 2 seconds and
    you give a subPos of 0.5 then this will wait until the speech audio has played for 1.5 seconds.

subPos (float 0..1) - The amount from 0 to 1 to wait between the last marker and next marker.
AddItemToInventory(itemName)
    Adds an item to your inventory

itemName (name) - The name of the item to add.
CreateSomething(objectName, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
    Calls a function that will perform some action.

objectName (name)  - The name of the object to create. (The function to call)
args       (float) - All these args will function differently depending on the object created.
SetFlag(flagName)
    Sets the cutscene flag.

flagName (name) - The name of the cutscene flag.
SetCameraPosition(x, y, z)
    Sets the position of the camera.

x (float) - The X position of the camera.
y (float) - The Y position of the camera.
z (float) - The Z position of the camera.
SetCameraTarget(x, y, z)
    Sets the point the camera will look.

x (float) - The X position where the camera will look at.
y (float) - The Y position where the camera will look at.
z (float) - The Z position where the camera will look at.
MoveCameraPosition(x, y, z, time)
    Sets the position the camera will move to.

x    (float) - The X position.
y    (float) - The Y position.
z    (float) - The Z position.
time (float) - The amount of time it takes to move to the position in 1/2 ticks.
MoveCameraTarget(x, y, z, time)
    Sets the look point the camera will look to.

x    (float) - The X position where the camera will move to look at.
y    (float) - The Y position where the camera will move to look at.
z    (float) - The Z position where the camera will move to look at.
time (float) - The amount of time it takes to look to the point in 1/2 ticks.
SetActorSector(actorName, sectorID)
    Sets the cutscene actor to a sector.

actorName (name)    - The name of the cutscene actor.
sectorID  (integer) - The sector to assign to the actor.
SetActorsSector(actorName, sectorID)
    Sets the cutscene actor to a sector. (Same as SetActorSector)

actorName (name)    - The name of the cutscene actor.
sectorID  (integer) - The sector to assign to the actor.
TurnShadowManTo(x, y, z)
    Sets Shadow Man Yaw towards the point and runs toward the point.

x (float) - The X Position to turn towards.
y (float) - The Y Position to turn towards.
z (float) - The Z Position to turn towards.
SetCameraZoom(zoom)
    Sets the zoom amount for the camera.

zoom (float) - The amount to zoom in. 1.0 = no zoom.
SetSkipMode(mode)
    Re-enables or disables cutscene skipping.

mode (integer) - Set to 0 to disable skipping. Set to 1 to enable skipping of cutscenes (if you have a Stop command in the script).
ChangeGadTextures()
    Updates the Gad textures on shadow man.
SetObjectState(actorName, state)
    Sets the cutscene actors paramState value.

actorName (name)    – The name of the cutscene actor.
state     (integer) – The value to set to this actors paramState.
SetObjectForCreateSomething(actorName)
    Sets the cutscene actor for use with the CreateSomething command.

actorName (name) – The name of the cutscene actor.
LipsState(state)
    Enables or Disables mouth lip movements on cutscene actors.

state (integer) – Set this to a value of 1 to enable lip movements on cutscene actors.
CreateActor(actorName)
    If the actor doesn't already exist then will spawn them. Will also turn off the actors No Draw flag.
    The only actors that can spawn are: ACTOR_LEGION, ACTOR_JACK, ACTOR_AVERYMARX, ACTOR_BATRACHIAN,
    ACTOR_LUKE, ACTOR_NETTIE, ACTOR_MIDFORM

actorName (name) – The name of the cutscene actor to spawn and show.
DestroyActor(actorName)
    Removes the cutscene actor. Can only remove: ACTOR_NETTIE, ACTOR_LEGION, ACTOR_BATRACHIAN, ACTOR_TRUEFORM,
    ACTOR_MIDFORM, ACTOR_LUKE

actorName (name) – The name of the cutscene actor to remove.
NoCameraMoveFix()
    Disables fixed movement for the camera.
PlaySoundAbsolute(soundName, x, y, z)
    Plays a sound at a certain position.

soundName (name)  - The name of the sound to play.
x         (float) - The X Position to play the sound.
y         (float) - The Y Position to play the sound.
z         (float) - The Z Position to play the sound.
PlaySoundRelative(soundName, x, y, z)
    Plays a sound relative to the cameras position.

soundName (name)  - The name of the sound to play.
x         (float) - The X Position relative to the cameras X position.
y         (float) - The Y Position relative to the cameras Y position.
z         (float) - The Z Position relative to the cameras Z position.
PlaySound(soundName)
    Plays a sound at full volume.

soundName (name) - The name of the sound to play. if is SFS_INTRO_NSWAMPLOOP then it will loop.
PlaySoundOnActor(soundName, actorName)
    Plays a sound at the center of the actor.

soundName (name) - The name of the sound to play.
actorName (name) - The name of the cutscene actor to use as the position to play the sound.
ForceJoyPad(flags)
    Performs an action on the player. If flags is 0 then controls will no longer be overridden.

flags (integer) – The actions to perform on the player. Set to 0 to no longer override controls.
                  Combine multiple actions at once by adding the values. 129 = Forward + Jump
    Move Forward  = 1
    Move Backward = 2
    Move Left     = 4
    Move Right    = 8
    Walk (Unused) = 16
    Strafe        = 32
    Crouch        = 64
    Jump          = 128
    Hand Left     = 256
    Hand Right    = 512
    Use Action    = 1024
VaryAnimSpeed(speed)
    Changes the speed of all cutscene animations. can range from 3.5 to 35. 35 is normal speed. 3.5 is 0.1x speed.

speed (float) - Speed of all cutscene animations.
Stop()
    Allows the player to skip the cutscene with a button press and if it is skipped the script will continue to execute
    starting with the next command after this one. If the cutscene script reaches this command without the player
    skipping then the cutscene will end here and no more script commands will be executed.
End()
    Does nothing.

Names