User Tools

Site Tools


def_editing:cutscenes

Cutscenes

Generally speaking cutscenes are non-playable sequences of events in a videogame. In Fable, they work the same way. Cutscenes are implemented using a simple scripting language, but more on that below.

Note! This is work in progress. Anything could change at any moment.

Basics

Fable's cutscene scripts are divided into two sections: main and skip. Main section defines the main part of the cutscene, where as skip defines what happens if the player presses ESC during it. So, the purpose of the skip part is to make sure that the situation after the cutscene is like it would be if the cutscene was not skipped. There is also a third section to the cutscenes, but it's not known what it does at this point.

Functions

  • Functions that have Synchronous in their remarks are functions that return once the action has been finished.
  • Parameters inside { } are optional.
  • FALSE is the same as false and TRUE is the same as true.

Camera

DoCameraPreloading

Unknown

UseCamera

Location:variable{,unknown:integer?{,unknown:unknown{,unknown:unknown{,unknown:unknown}}}}

Example: UseCamera SNAP

NoLoadUseCamera

Location:variable

Unknown

NoDialogCam

Unknown:boolean

Enables or disables the camera changes with the creature speaking functions.

CameraShake

Duration:float,Unknown:float

Does a camera shake. Duration is given in seconds.

Remarks: Synchronous

WaitForCamera

Assumption: Wait for the camera move to end.

WaitForMessageCamera

Unknown:variable

Unknown

Thing

This sections describes the various functions that handle Thing (houses, chests, creatures, etc.) specific actions.

SetGravityOnThing

Thing:variable,Unknown:boolean

PauseThing

Thing:variable,Pause:boolean

Pause or resume thing. Stop all animation, movement, etc.

DrawThing

Thing:variable

TeleportThing

Unknown:unknown,Location:variable

PlayObjectAnim

Object:variable,Unknown:unknown{,Unknown:boolean}

Play an object related animation.

SetThingConscious

Thing:variable,Conscious:boolean

Set thing conscious or unconscious.

Example: SetThingConscious FIGHTER,TRUE

FadeThingIn

Thing:variable

Fade thing in. Doesn't quite seem to work.

FadeThingOut

Thing:variable,Duration:float

Fade thing out.

Example: FadeThingOut HERO,2

Crowd

CrowdCreateMixed

ModelMale:enum,ModelFemale:enum,Marker:variable,Group:variable

Create a mixed crowd consisting of variations of ModelMale and ModelFemale characters at Marker. Marker refers to collections of markers in the TNG file with the same ScriptName.

Example: CrowdCreateMixed CREATURE_KN_VILLAGER_MALE, CREATURE_KN_VILLAGER_FEMALE, MK_EXAMPLE, CROWD

CrowdAcquire

Group:variable

CrowdLookTo

Group:variable,Thing:variable

Make the crowd look towards Thing.

CrowdTeleport

Group:variable,Unknown:variable

Unknown

CrowdClearActions

Group:variable

Unknown

CrowdAnimate

Group:variable,Animation:enum,Unknown:float,Unknown:float,Unknown:float,Unknown:boolean,Unknown:boolean,Unknown:number

Do a crowd animation.

Example: CrowdAnimate CROWD,SCRIPT_CHEER_3,0.5,0.05,0.05,TRUE,TRUE,2

CrowdCombatAnimate

Unknown

Example: CrowdCombatAnimate CROWDBANDITS, CS_WALK_BACKWARDS_01, 0.0,0.0,0.0,FALSE,TRUE,FALSE

CrowdRipplePosition

Group:variable,Unknown:unknown

Unknown

CrowdKill

Group:variable{,Unknown:float{,Unknown:boolean{Unknown:boolean}}}

Kill all characters associated with the crowd. When they die they leave loot behind.

Example: CrowdKill HHUndead,1.5,TRUE,TRUE

Hero

Hero specific functions.

GiveHero

Item:variable{,Unknown:unknown{,Unknown:unknown{,Unknown:boolean}}}

Give hero an item. Item is the item's enumerator, e.g. OBJECT_SWORD_OF_AEONS.

Example: GiveHero OBJECT_HERO_HAT_JOB_MASK,1,-1,TRUE

RemoveHeroClothes

Remove all clothes, only union jack underwear remain.

GiveHeroHealth

Unknown:unknown

Set hero's health.

Example: GiveHeroHealth MAX

GiveHeroMorality

Amount:number

Give hero Amount of “morality”. Negative numbers for evil, positive for good.

HeroTattoo

Object:enum

Sets hero tattoo.

Examples: HeroTattoo OBJECT_TATTOO_CARD_CHEST_01

HeroHair

Object:enum

Sets hair or beard for the hero.

Examples: HeroHair OBJECT_HERO_HAIR_YOUNG_01, HeroHair OBJECT_HERO_BEARD_TRAMP_01

PutInHeroHands

Object:enum

Puts something into hero's hands. NULL is for empty. Objects not weapons.

Example: PutInHeroHands NULL
See also: Creature.HoldInHand

SetHeroWeapon

Weapon:variable

Set the current weapon for the hero (the weapon on his back). Hero will not wield it.

RemoveHeroWeapons

Unknown:boolean

Unknown

TakeObjectFromHero

Object:variable

Take an object from the hero's inventory.

Example: TakeObjectFromHero OBJECT_TROPHY_JOB_MASK_01

HeroWear

Object:enum

Make the hero wear a hat. For no hat, use OBJECT_HERO_NO_HAT.

Example: HeroWear OBJECT_HERO_HAT_JOB_MASK

GiveGold

Amount:integer

Gives gold to hero.

Miscellaneous

This section contains all the functions that don't really belong into any specific category or if the category is just too small.

AnimationPause

Pause:boolean

Unknown

AnimationPhysics

On:boolean

Unknown

AskQuestion

Text:string

Ask a yes and no question. It's unknown how the handling of the answer is done.

Example: AskQuestion TEXT_QST_B04_GM_QUESTION_LEAVING_TO_GRAVEYARD

Remarks: Synchronous

AToSkip

Disabled:boolean

Disable cutscene skip if Disabled is true. Remember to call AToSkip FALSE at the end of the cutscene.

Create

Object:enum,Location:variable,Var:variable{,Unknown:boolean{,Unknown:variable}}

Creates a new object to use in the cutscene. Object is the object enumerator defined in game.bin, Location is the starting location marker defined a TNG file. Var is a name that you want use when referring to the object in the cutscene.

To delete the object use the Remove function.

Remove

Object:variable

Removes an object. Object can be a creature, house, chair, etc. It can either be created by the engine (in case of TNG objects) or created in the script with Create function.

PlayMysic

Music:enum{,Unknown:boolean}

Starts playing music. Music is an enumerator for an audio file. Using MUSIC_SET_NULL stops playing music.

See Also: MuteSounds, EnableSounds

FadeIn

{Duration:float{,Unknown:float}}

Do a screen fade in. Duration is given in seconds.

FadeOut

{Duration:float{,Unknown:float}}

Do a screen fade out. Duration is given in seconds.

StayFadedOut

Unknown

GamePause

Duration:float

Pauses the game for the given duration. Duration is given in seconds. Note that the function doesn't stop any cutscene actions like walking, talking, etc.

ScriptFrame

Unknown:boolean

Unknown

DoScriptFrame

Count:integer

Do script frames aka. proceed a number frames. Count specifies the frame count.

MuteSounds

Unknown:boolean

Unknown

EnableSounds

Unknown:boolean

You would assume that it allow sounds (or not) right? That doesn't seem to be the case though.

PlaySound

Target:enum,Sound:variable,Unknown:unknown

Assumption: Target specifies the world location of the sound. It can be NULL.

Example: PlaySound HERO,$SOUND,CRITERIA

PutUpYourSwords

{Unknown:boolean}

Makes people put away their weapons. At least the hero.

RemoveExtras

{Remove:boolean{,Location:variable{,Unknown:variable{,Unknown:unknown}}}}

Relocation of loaded extras (characters). Remove tells to remove or return. Location is the location where the engine should put the extras, it is one of values: LIMBO, RETURN.

WaitActiceDialog

Wait until currently active dialog ends.

Remarks: Synchronous

SetChestOpen

Chest:variable,Open:boolean

Open or close chests. Chest is a variable specified in the TNG files with the ScriptName attribute.

SetDoorOpen

Door:variable,Open:boolean

Open or close doors, gates, etc. Door is a variable specified in the TNG files with the ScriptName attribute.

Example: SetDoorOpen DragonGate

StartTimeCode

Unknown

KeepEntityMap

{Unknown:boolean}

Unknown

Get

Unknown:variable,Unknown:variable

Get a variable to a global object.

Example: Get Dragon,DRAGON

RegisterActor

Object:variable

Assumption: Registers a global object to the cutscene.

EnableBlackScreenSubtitles

Assumption: Show text even if the screen is black.

CreateEffect

Effect:enum,Target:variable,Var:variable{,Unknown:float{,Unknown:boolean}}

Assigns an effect to an object. Effect is the name of the effect. Target is the target location object/thing/creature of the effect. Var is the variable that is used to refer to the effect from the script.

Example: CreateEffect DG_SOUL_SWIRL,HERO
See also: RemoveEffect

DummyEffect

Unknown:enum,Object:variable,Unknown:unknown,Var:variable,Unknown:boolean

Object is the target for the effect. Var is the variable that is used to refer to the effect from the script.

Example: DummyEffect JACK_OF_BLADES_MASK_FINAL,HERO,WEAPON_FOCUS_01,MASKGLOW,TRUE

RemoveEffect

Effect:variable

Removes an effect. Effect is the variable used with the CreateEffect function.

SetTime

Unknown:unknown,Unknown:boolean

Unknown

RemoveAll

All:boolean

Unknown

TeleportFollowers

Unknown:boolean

Unknown

SetFlag

Flag:variable,Unknown:boolean,Unknown:boolean

Assumption: Set a quest script flag.

Example: SetFlag OPENCAGE,TRUE,TRUE

UseTheme

Theme:enum,unknown:unknown:unknown:boolean

CreditScreen

Credits:variable

Does a credit screen.

Collide

Collide:boolean{,Unknown:boolean}

Set object collision.

ClearCommands

Unknown:boolean

Clear commands.

Print

Text:string

Prints gray text on screen.

Exit Game

Returns to the main menu.

Fullscreen

Change cutscene mode to fullscreen – no black bars.

GameInfo

Message:string

Show the message Message at the center of the screen.

Example: GameInfo 'Hello!'

Remarks: Synchronous

PlayAVI

FileName:string

Play a video file in the data\Video folder.

Example: PlayAVI 6_Arena_Mothers_Story_Comp.xmv

Remarks: Synchronous

Classes

Classes are used for the different types of objects in the cutscenes. You can use these functions by using the syntax <Class variable>.<Function> e.g. Jack.Speak.

Object

Object is the base class of creatures, effects, etc. What that means is that creature variables and effects, etc. all have these functions as well.

SetAlpha

Alpha:float

Set object's alpha/transparency value. 1.0 is opaque, 0.0 is invisible.

FadeIn

{Duration:float{,Unknown:float}}

Fade in the character. Use SetAlpha to first make the object invisible.

FadeOut

{Duration:float{,Unknown:float}}

Fade out the object.

Creature

Creature class represents characters, etc. in the cutscenes.

Speak

Target:variable,Text:string{,Unknown:boolean{,Unknown:enum}}

Makes the specified character speak and turn towards the Target which refers to the listening creature. If NoDialogCam is off, camera is positioned relative to the Target. For example if the target is different from the speaking creature the camera will be placed slightly behind and above the target creature.

Text is the text that the character should say. It's usually an enumerator that's defined in text.big, but it can also be a normal string, like 'text'.

Example: THER.Speak THER,TEXT_QST_048_THERESA_INTRODUCTION_20
Example: VILL1.Speak HERO,'TEXT_CS_024_FAKE'

Remarks: Synchronous

InteractiveSpeak

Target:variable,Text:string

Allows speaking while doing something else, like walking.

DialogSpeak

Target:variable,Text:string

DialogadSpeak

Target:variable,Text:string{Unknown:unknown{,Unknown:unknown}

Something to do with additive dialog?

DataSpeak

Example: ORGANISER.DataSpeak $LINE,_10
Example: TRADER.DataSpeak TEXT_QST_B11_,_OUTRO_10,DATA

LookInDirection

Angle:integer

Look to specified direction – an angle given in degrees.

LookToThing

Thing:variable,unknown:unknown

Assumption: Makes the thing to look at a thing.

See also: LookAt,LookAtNothing

LookAt

Target:variable

Turn the creature towards the target, not just the head, but the whole body.

See also: LookAt,LookAtNothing

LookAtNothing

LookAtNothing:boolean

Makes the thing just look at nothing, aka. look just forward.

See also: LookAt,LookAtThing

Teleport

Location:variable

Instantly Teleport creature to a location. Location is a marker.

Example: VICTIM.Teleport M_COE_VictimTeleport

SlideTeleport

Location:variable,NewLocation:variable,Time:unknown,Unknown:boolean,Unknown:boolean

Slowly teleports the creature. This allows other commands to be played as the person moves into place.

Example: VICTIM.SlideTeleport M_COE_VictimTeleport,M_COE_VictimAltar,100,TRUE,TRUE

WalkTo

Location:variable{,unknown:integer{,unknown:boolean{,unknown:boolean{,unknown:boolean}}}}

Makes the creature walk to a location.

RunTo

Location:variable

Makes the creature run to a location.

SneakTo

Location:variable{,unknown:float{,unknown:unknown}}

Makes the creature walk to a location. The difference between this and WalkTo might be in “synchronicity”.

Remarks: Synchronous

PreLoadAnim

Animation:variable

Loads an animation into memory.

PlayAnimation

Animation:variable{,unknown:unknown{,unknown:unknown{,unknown:unknown{,unknown:unknown}}}}

Plays an animation.

PlayLoopingAnim

Animation:enum{,unknown:number{,unknown:boolean{,unknown:boolean{,unknown:boolean{,unknown:boolean{,unknown:boolean}}}}}}

Plays a looping animation.

Assumption: Variable Count tells the number of times it should be played, -1 is forever.

PlayLoopingAnimation

Animation:variable{,unknown:number{,unknown:boolean{,unknown:boolean{,unknown:boolean{,unknown:boolean{,unknown:boolean}}}}}}

Plays a looping animation.

PlayCombatAnim

PlayCombatAnimation

Animation:variable{,unknown:unknown{,unknown:unknown{,unknown:unknown{,unknown:unknown}}}}

WaitPlayAnimation

Animation:variable{,unknown:unknown{,unknown:unknown{,unknown:unknown{,unknown:unknown}}}}

Same as PlayAnimation but waits until the animation is finished.

Remarks: Synchronous

WaitTask

{Unknown:variable}

Waits for certain tasks to end, like walking or animations. Variable unknown is usually just a temporary variable with no particular meaning.

Example: HERO.WaitTask FOO

Remarks: Synchronous

Drawable

Drawable:boolean

Make the creature drawable or not.

ClearCommands

{Unknown:boolean{,Unknown:boolean}}

Clear all active creature commands, like animations and such.

AddScriptedMode

Mode:variable

Unknown

Example: HERO.AddScriptedMode CUTSCENE

RemoveScriptedMode

Mode:variable

Sheathe

Unknown:unknown

Assumption: Makes the creature to sheathe their weapon. The parameter can take values like TRUE and MELEE.

Example: HERO.Sheathe MELEE

EntitySetMaxWalkingSpeed

Speed:float

Set walking speed.

EntitySetMaxRunningSpeed

Speed:float

Set running speed. Value 1.05 is a good value.

SetAppearanceSeed

Seed:integer

Sets the appearance seed for a villager.

DoBossFight

Unknown:boolean,Unknown:boolean

Unknown

SetScared

Scared:boolean

Set creature scared or unscared depending on Scared.

Example: TRADERS.SetScared FALSE

Collide

Collide:boolean{,Unknown:boolean}

HoldInHand

Object:variable,Unknown:boolean

Puts an object into creature's hand. Weapon or an object. In case of weapons the results might differ according to character.

FightWith

Target:variable

Make a creature fight another. Doesn't work for Hero.

FightStop

Assumption: Make the fight stop that was previous started via FightWith.

SetDrunk

Drunk:boolean

Make the creature drunk.

ModifyHealth

Change:number

Change current health.

TurnInto

Target:enum

Changes a creature into another. In case of the hero the the target creature has to meet certain requirements. What they are, we don't know yet.

It seems that there are a few problems with this function when it comes to NPC creatures.

Example: HERO.TurnInto CREATURE_HERO_CHILD

FadeCross

Target:Variable,Time:Seconds

Fades one thing into another. Notice that Target is a variable. Not an enum, so you have to create the target object before doing the fade.

Example: TRADER.FadeCross BALV,0.5

SetAttackable

boolean

Makes the creature attackable/unattackable

Example: HERO.SetAttackable FALSE

SetDamageable

boolean

Makes the creature damageable/undamageable

Example: HERO.SetDamageable FALSE

SetBound

boolean

Unknown what this does.

Possibly enables the Bounding Box??

Example: PRIS.SetBound TRUE

SetFree

boolean

Looks to be hostage quest specific. Probably allows them to move.

Example: HOST1.SetFree TRUE

SetPushable

boolean

Disables Force push on creature

Example: JACK.SetPushable FALSE

SummonerAttack

Target:variable

Summoner Specific Attack

Example: SUM.SummonerAttack MK_AM_TARGET

WaitForAnimationEvent

Event:variable

Waits for the specified event to complete before moving on.

Example: Hero.WaitForAnimationEvent CUT_SCENE_HOH_HERO_STANDUP

Remarks: Synchronous

WaitForUnderRadius

Location:variable, Radius:Float

Waits for the creature to get within a certain radius of a location before continuing.

Example: Hero.WaitForUnderRadius OUTRO_MARKER_HERO,2.2

Remarks: Synchronous

Variables

In all cutscenes, by default, HERO (of class Creature) refers to the player character.

Examples

Turn the hero into a kid

CreateEffect BALVERINE_TRANSFORM_3,HERO,EFF1
EFF1.SetAlpha 0.0
EFF1.FadeIn 3
GamePause 3
HERO.ClearCommands TRUE,TRUE
HERO.TurnInto CREATURE_HERO_CHILD
HERO.WaitTask FOO
EFF1.FadeOut 3
GamePause 3
RemoveEffect EFF1
def_editing/cutscenes.txt · Last modified: 2007/03/23 13:52 (external edit)