The Quillscript Function Library is a dedicated collection of utility functions designed to enhance the functionality and ease of use of the Quillscript Plugin in Unreal Engine.
This library offers a set of specialized tools and features for Quillscript Plugin users, enabling efficient coding, automation, and customization within your Quillscript-powered projects.
Script
Play Script
Initiate the execution of a Quillscript asset.
Parameters
WorldContextObject:refScript:ref[QuillscriptAsset](Omittable) StartingLabel:Name(Omittable) Target:ref// Object referenced by this Script as {&Target}
// Get a script reference.
$ ^Quillscript.Quill.GetScriptById MyScriptId
// Play script.
$ ^Quillscript.Quill.PlayScript {&ReturnValue}
// End current script. (Optional)
$ End
Notice that this process produces the same result as the $ Travel built-in function and is useful only if you need extra control of the code behavior or order.
Play the given script using a custom set of settings passed as a parameter to this function. It allows you to fine-tune the behavior of the script execution according to your specific requirements.
Parameters
WorldContextObject:refScript:ref[QuillscriptAsset]Settings:ScriptSettings(Omittable) StartingLabel:Name(Omittable) Target:ref// Object referenced by this Script as {&Target}
#include"Utils/Quill.h"...// Configure custom settings.FScriptSettings Settings;Settings.EnableInputDuring = EPicker::No;Settings.ShowMouseCursorAfter = EPicker::Yes;// Play script using custom settings.UQuill::PlayScriptUsingCustomSettings( WorldContextObject, UQuill::GetScriptById("MyScriptId"), Settings);
Start Script
Same as Play Script but clears any previous script history to ensure a fresh start.
Parameters
WorldContextObject:refScript:ref[QuillscriptAsset](Omittable) StartingLabel:Name(Omittable) Target:ref// Object referenced by this Script as {&Target}
// Get a script reference.
$ ^Quillscript.Quill.GetScriptById MyScriptId
// Start script.
$ ^Quillscript.Quill.StartScript {&ReturnValue}
// End current script. (Optional)
$ End
WorldContextObject:refScript:ref[QuillscriptAsset]Settings:ScriptSettings(Omittable) StartingLabel:Name(Omittable) Target:ref// Object referenced by this Script as {&Target}
Continue the execution of a Quillscript from the last saved state entry in the script's history. It enables you to pick up the script where it left off, making it useful for scenarios where you need to maintain script continuity or when the game was saved during a script play and need to continue from that point.
// Get a script reference.
$ ^Quillscript.Quill.GetScriptById MyScriptId
// Play script.
$ ^Quillscript.Quill.ResumeScript {&ReturnValue}
// End current script. (Optional)
$ End
Takes a Quillscript language valid string as input and converts it into a Quillscript asset. This is particularly useful when you need to dynamically create or modify scripts at runtime, or when you allow modders or user to create their own scripts.
You can also specify a permission mode to control the script's behavior. See Permissions for more details.
Parameters
Text: string(Omittable) Permission:PermissionMode [ All, Safe, Sandbox ]
// Get a valid Quillscript language string.
$ :QuillscriptLanguageValidString := '$ x = 1'
// Create script object reference.
$ ^Quillscript.Quill.ParseScript {:QuillscriptLanguageValidString}
// Play created script.
$ ^Quillscript.Quill.PlayScript {&ReturnValue}
// End current script. (Optional)
$ End
Retrieves a list of all available Quillscript script assets within your project. This can be useful when you need to access and manage multiple scripts programmatically.
Retrieve a specific Quillscript asset by providing its path within your project. This function simplifies script asset retrieval, making it easy to access the script you need for execution or manipulation.
Parameters
Path: string
// Get a script reference.
$ ^Quillscript.Quill.GetScriptByPath /Game/Path/To/MyScript.MyScript
// Play script.
$ ^Quillscript.Quill.PlayScript {&ReturnValue}
// End current script. (Optional)
$ End
Retrieve a Quillscript asset by its unique identifier (Id). Keep in mind that this function may have performance implications in projects with a large number of assets. Use it when you need to specifically locate a script by its Id.
Parameters
Id: name
// Get a script reference.
$ ^Quillscript.Quill.GetScriptById MyScriptId
// Play script.
$ ^Quillscript.Quill.PlayScript {&ReturnValue}
// End current script. (Optional)
$ End
Generates a list of script permissions based on the specified permission mode. This function is helpful when you need to create a list of permissions for your scripts programmatically, allowing you to control the behavior of the scripts according to your permission requirements.
Check the existence of a Quillscript variable with a specified name. This function is particularly useful when you need to determine whether a specific variable is defined.
Parameters
WorldContextObject:refVariableName: name
// Store result in {$ReturnValue}.
$ ^Quillscript.Quill.QuillscriptVariableExists VariableName
#include"Utils/Quill.h"...// Macro (Only inside an UObject method)FString VariableValue{ VAR("VariableName") };// Function call.FString VariableValue{ UQuill::GetQuillscriptVariable(WorldContextObject,FName("VariableName")) };
Register Variable Modifier
Register a variable modifier.
When a Quillscript variable value is requested, the delegate event is played before retrieving the value, allowing the code to modify the variable value beforehand or to play some required code.
This function behaves the same as the native LoadGameFromSlot, but additionally extracts Quillscript data from the save game file and update Quillscript subsystem with the extracted data.
Returns a Save Game object containing the loaded data.
Parameters
WorldContextObject: ref
SlotName: string
UserIndex: number
// Load game and Quillscript data from 'MySlot'.
$ ^Quillscript.Quill.LoadGameAndStoryFromSlot "MySlot" 0