Built-In Functions

List all built-in functions available in script

Flow

Restart

Go back to the beginning of the script.

Example
$ Restart
Next

Go to next Statement.

Example
$ Next
Rollback

Go to previous executed Statement.

Example
$ Rollback
Repeat

Restart current label statement.

Example
$ Repeat
Done

Advance to next label statement.

Example
$ Done
Return

Go back to last executed Router statement.

Example
$ Return
End

End this script.

Example
$ End
Kill

Same as $ End, but does not apply Script Settings After.

Example
$ Kill
Restore

Allows this scene to proceed.

Example
$ Restore
Stop

Prevents this scene from proceeding.

Example
$ Stop
Wait

Stop script for a few seconds.

Parameters
Duration: float
Example
$ Wait 3
$ Wait 0.25
Timer

Execute the given command after the given time.

Parameters
Duration: float
Command: string
(Omittable) Async: bool
Example
$ Timer 5 "^Quillscript.Tools.Print '5 seconds passed'"
$ Timer 1.5 "&GameInstance.MyFunction 36" true
Travel

End current Script and play a new script from start or from label.

Parameters
TargetScript: string | ref
(Omittable) StartingLabel: string
Example by Id
$ Travel @Intro            // Travel and play from start
$ Travel @Act1 Chapter2    // Travel and play from label 'Chapter2'
Example by Script Reference
$ Travel {&/Game/Scripts/Intro.Intro}                // Travel and play from start
$ Travel {&/Plugin/Screenplay/Act1.Act1} Chapter2    // Travel and play from label 'Chapter2'
TravelPass

End current Script and play a new script from start or from label.

It is the same as $ Travel, but instead of a new clean Interpreter, it makes a copy of the current Interpreter, keeping settings and changes. Also, it uses the same Script settings as the current Script object and passes them to the given script.

Parameters
TargetScript: string | ref
(Omittable) StartingLabel: string
Example by Id
$ TravelPass @Intro            // Travel pass and play from start
$ TravelPass @Act1 Chapter2    // Travel pass and play from label 'Chapter2'
Example by Script Reference
$ TravelPass {&/Game/Scripts/Intro.Intro}                // Travel pass and play from start
$ TravelPass {&/Plugin/Screenplay/Act1.Act1} Chapter2    // Travel pass and play from label 'Chapter2'

State

Print

Debugger function to print the given Quillscript variable's value.

Parameters
VariableName: string
Example
$ Print myVariable
Delete

Delete the given Quillscript variable.

Parameters
VariableName: string
Example
$ Delete myVariable
Notify

Notify all registered observers in 'UQuillscriptSubsystem::OnNotified(FString)'.

Parameters
Message: string
Example
$ Notify 72
$ Notify 'Boss defeated'

Input

Set Input Mode

Change the game input mode.

Parameters
InputMode: InputMode                        [ GameOnly, GameAndUI, UIOnly ]
(Omittable) MouseLockMode: MouseLockMode    [ DoNotLock, LockOnCapture, LockAlways, LockInFullscreen ]
(Omittable) HideCursorDuringCapture: bool
(Omittable) WidgetToFocus: ref
Example
$ SetInputMode GameOnly
$ SetInputMode GameAndUI LockAlways
$ SetInputMode UIOnly LockOnCapture true {&MyWidget}
Input Enable

Enable input, move input, and look input.

Example
$ InputEnable
Input Disable

Disable input, move input, and look input.

Example
$ InputDisable
Show Mouse Cursor

Show mouse cursor.

Example
$ ShowMouseCursor
Hide Mouse Cursor

Hide mouse cursor.

Example
$ HideMouseCursor

User Interface

Use

Use the specified class or keyword for Dialog Box, Selection Box and Background Box.

By Keywords:

  • Default: Reset all boxes classes to default.

  • DialogBox: Reset Dialog Box class to default.

  • SelectionBox: Reset Selection Box class to default.

  • BackgroundBox: Reset Background Box class to default.

By Class Path:

  • C++ Class: /Script/Module.DialogBoxClass

  • Blueprint Class: /Game/Path/To/Folder/MyDialogBox.MyDialogBox

Parameters
WidgetClassPath: string
Example
$ Use Default
$ Use DialogBox
$ Use /Script/Quillscript.DialogBox
$ Use /Game/MyFolder/MyDialogBox.MyDialogBox
Show Dialog Box

Add Dialog Box to viewport.

Example
$ ShowDialogBox
Show Selection Box

Add Selection Box to viewport.

Example
$ ShowSelectionBox
Show Background Box

Add Background Box to viewport.

Example
$ ShowBackgroundBox
Remove Dialog Box

Remove Dialog Box from viewport.

Example
$ RemoveDialogBox
Remove Selection Box

Remove Selection Box from viewport.

Example
$ RemoveSelectionBox
Remove Background Box

Remove Background Box from viewport.

Example
$ RemoveBackgroundBox
Show

Show Dialog Box and Selection Box.

Example
$ Show
Hide

Hide Dialog Box and Selection Box.

Example
$ Hide
Background

Change the background image on screen with a transition animation.

Parameters
Image: ref
(Omittable) Transition: string [ none, fade, dissolve, scrollup, shake ]
(Omittable) Duration: float
Example
$ Background {&/Game/Scenarios/School.School}
$ Background {&MyRef} dissolve 1
Bg

An alias function for $ Background.

Parameters
Image: ref
(Omittable) Transition: string [ none, fade, dissolve, scrollup, shake ]
(Omittable) Duration: float
Example
$ Bg {&/Game/Scenarios/School.School}
$ Bg {&MyRef} dissolve 1
Sprite

Create a User Interface object to display an image on screen from the default SpriteBox class and set a Script Reference for the created object.

It is most useful to display, animate and handle character images and illustrations during dialogues.

Parameters
Name: name
(Omittable) Class: class
Example
$ Sprite Alice

// Or define another class instead of the default one.
// $ Sprite Alice {&/Game/Path/To/SpriteBoxClass.SpriteBoxClass_C}

// left, center, right for slots; 0.5:0.5 for screen percentage; 100,100 for pixels;
$ &Alice.Position  left    

// Animation name, start at time, num loops, play mode, playback speed, destroy on end.
$ &Alice.Animate   fade 0 1 Forward 1 false

$ &Alice.Layer     10
$ &Alice.Rotate    180
$ &Alice.Scale     2 2

// Script path reference to an asset.
$ &Alice.Show 	   {&/Game/Assets/Alice_Happy.Alice_Happy}

Media

Play Sound

Play a sound asset.

Parameters
Sound: ref
(Omittable) Channel: string
(Omittable) Volume: float
(Omittable) FadeDuration: float
Example
$ PlaySound {&/Game/Voices/Line33.Line33}
$ PlaySound {&/Game/SFXs/Explosion.Explosion} SFX 2
$ PlaySound {&/Game/Musics/Piano.Piano} BackgroundMusic 0.5 0.5
Voice

Play a sound asset.

Same as: PlaySound {&/Path} 'voice' volume 0

Parameters
Sound: ref
(Omittable) Volume: float
Example
$ Voice {&/Game/Voices/Line33.Line33}
$ Voice {&/Game/Character/Greetings.Greetings} 1
Music

Play a sound asset.

Same as: PlaySound {&/Path} 'music' volume 0

Parameters
Sound: ref
(Omittable) Volume: float
(Omittable) FadeDuration: float
Example
$ Music {&/Game/Musics/Piano.Piano}
$ Music {&/Game/Environment/Wind.Wind} 0.75
$ Music {&/Game/Environment/Birds.Birds} 0.5 1
SFX

Play a sound asset.

Same as: PlaySound {&/Path} 'sfx' volume 0

Parameters
Sound: ref
(Omittable) Volume: float
Example
$ SFX {&/Game/Car/Engine.Engine}
$ SFX {&/Game/SFXs/Explosion.Explosion} 2
Stop Sound

Stop the sound asset playing.

Parameters
(Omittable) Channel: string
(Omittable) FadeDuration: float
Example
$ StopSound
$ StopSound voice
$ StopSound music 0.5
Stop All Sounds

Stop all sound assets from all channels.

Parameters
(Omittable) FadeDuration: float
Example
$ StopAllSounds
$ StopAllSounds 0.5
Play Animation

Play animation on target skeletal mesh.

Parameters
SkeletalMeshComponent: ref
AnimationReference: ref
(Omittable) Loop: bool
Example
$ PlayAnimation {&Mesh} {&/Game/Animations/Idle.Idle}
$ PlayAnimation {&Mesh} {&/Game/Animations/Running.Running} true

Helper

Roll

Roll a die. Select a random number in range.

Parameters
DieSides: integer
Example
$ Roll 2    // heads or tails
$ Roll 6    // d6
$ Roll 20   // d20
$ Roll 100
$ Roll 17

Last updated