inkcpp
Loading...
Searching...
No Matches
AInkRuntime Class Reference

Instanciated story with global variable storage and access, used to instanciate new threads. More...

#include <InkRuntime.h>

Inheritance diagram for AInkRuntime:

Public Member Functions

UInkThreadStart (TSubclassOf< UInkThread > type, FString path="", bool runImmediately=true)
 Create a new Thread.
 
UInkThreadStartExisting (UInkThread *thread, FString path="", bool runImmediately=true)
 Create a new Thread in existing memory, for more details.
 
FInkSnapshot Snapshot ()
 creates a snapshot of the current runtime state.
 
void LoadSnapshot (const FInkSnapshot &snapshot)
 Loads a snapshot file, therfore deletes globals and invalidate all current Threads After this Start and StartExisting will load the corresponding Threads (on at a time)
 
void PushExclusiveThread (UInkThread *Thread)
 Marks a thread as "exclusive".
 
void PopExclusiveThread (UInkThread *Thread)
 Removes a thread from the exclusive stack.
 
void RegisterTagFunction (FName functionName, const FTagFunctionDelegate &function)
 register a "tag function" This function is executed if context or a tag in a special format apears
 
FInkVar GetGlobalVariable (const FString &name)
 Access a variable from the ink runtime.
 
void SetGlobalVariable (const FString &name, const FInkVar &value)
 Sets a global variable inside the ink runtime.
 
void ObserverVariable (const FString &variableName, const FVariableCallbackDelegate &callback)
 Gets a ping if variable changes.
 
void ObserverVariableEvent (const FString &variableName, const FVariableCallbackDelegateNewValue &callback)
 On variable change provides new value.
 
void ObserverVariableChange (const FString &variableName, const FVariableCallbackDelegateNewOldValue &callback)
 On variable change provides old and new value.
 

Protected Member Functions

virtual void BeginPlay () override
 Called when the game starts or when spawned.
 

Detailed Description

Instanciated story with global variable storage and access, used to instanciate new threads.

Member Function Documentation

◆ GetGlobalVariable()

FInkVar AInkRuntime::GetGlobalVariable ( const FString & name)

Access a variable from the ink runtime.

variables are shared between all threads in the same runtime.

Parameters
nameof variable in ink script

Get Global Variable
Target
Name
Return Value

◆ LoadSnapshot()

void AInkRuntime::LoadSnapshot ( const FInkSnapshot & snapshot)

Loads a snapshot file, therfore deletes globals and invalidate all current Threads After this Start and StartExisting will load the corresponding Threads (on at a time)

Load Snapshot
Target
Snapshot

◆ ObserverVariable()

void AInkRuntime::ObserverVariable ( const FString & variableName,
const FVariableCallbackDelegate & callback )

Gets a ping if variable changes.

See also
ObserverVariableEvent() ObserverVariableChange()

Observer Variable
Target
Variable Name
Callback

◆ ObserverVariableChange()

void AInkRuntime::ObserverVariableChange ( const FString & variableName,
const FVariableCallbackDelegateNewOldValue & callback )

On variable change provides old and new value.

See also
ObserverVariableEvent() ObserverVariable()
Attention
if the varibale set for the firs time, the old value has value type EInkVarType::None

Observer Variable Change
Target
Variable Name
Callback

◆ ObserverVariableEvent()

void AInkRuntime::ObserverVariableEvent ( const FString & variableName,
const FVariableCallbackDelegateNewValue & callback )

On variable change provides new value.

See also
ObserverVariable() ObserverVariableChange()

Observer Variable Event
Target
Variable Name
Callback

◆ PopExclusiveThread()

void AInkRuntime::PopExclusiveThread ( UInkThread * Thread)

Removes a thread from the exclusive stack.

See also
PushExclusiveThread()

Pop Exclusive Thread
Target
Thread

◆ PushExclusiveThread()

void AInkRuntime::PushExclusiveThread ( UInkThread * Thread)

Marks a thread as "exclusive".

As long as it is running, no other threads will update.

See also
PopExclusiveThread()

Push Exclusive Thread
Target
Thread

◆ RegisterTagFunction()

void AInkRuntime::RegisterTagFunction ( FName functionName,
const FTagFunctionDelegate & function )

register a "tag function" This function is executed if context or a tag in a special format apears

See also
TagFunction

Register Tag Function
Target
Function Name
Function

◆ SetGlobalVariable()

void AInkRuntime::SetGlobalVariable ( const FString & name,
const FInkVar & value )

Sets a global variable inside the ink runtime.

Parameters
nameof variable in ink script
valuenew value for the variable

Set Global Variable
Target
Name
Value

◆ Snapshot()

FInkSnapshot AInkRuntime::Snapshot ( )

creates a snapshot of the current runtime state.

can be loladed with LoadSnapshot()

Snapshot
Target
Return Value

◆ Start()

UInkThread * AInkRuntime::Start ( TSubclassOf< UInkThread > type,
FString path = "",
bool runImmediately = true )

Create a new Thread.

If a Snapshot is set/loaded create Threads like there was before if you want to create a fresh Thread despite an existing LoadedSnapshot enter the starting path

Start
Target
Type
Path
Run Immediately
Return Value

◆ StartExisting()

UInkThread * AInkRuntime::StartExisting ( UInkThread * thread,
FString path = "",
bool runImmediately = true )

Create a new Thread in existing memory, for more details.

See also
AInkRuntime::Start()

Start Existing
Target
Thread
Path
Run Immediately
Return Value


The documentation for this class was generated from the following file: