|
inkcpp
|
Instantiated story with global variable storage and access, used to instantiate new threads. More...
#include <InkRuntime.h>
Public Member Functions | |
| UInkThread * | Start (TSubclassOf< UInkThread > type, FString path="", bool runImmediately=true) |
| Create a new Thread. | |
| UInkThread * | StartExisting (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. | |
| TFuture< FInkSnapshot > | MigratableSnapshot () |
| creates a snapshot the next time the story is in a stable state. | |
| void | LoadSnapshot (const FInkSnapshot &snapshot) |
| Loads a snapshot file, therefore 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. | |
| FInkHandle | RegisterTagFunction (FName functionName, const FTagFunctionDelegate &function) |
| register a "tag function" This function is executed if context or a tag in a special format appears. | |
| void | Unregister (const FInkHandle &handle) |
| Stop receiving variable-change notifications or unregister a tag function. | |
| 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. | |
| FInkHandle | ObserverVariable (const FString &variableName, const FVariableCallbackDelegate &callback) |
| Gets a ping if variable changes. | |
| FInkHandle | ObserverVariableEvent (const FString &variableName, const FVariableCallbackDelegateNewValue &callback) |
| On variable change provides new value. | |
| FInkHandle | ObserverVariableChange (const FString &variableName, const FVariableCallbackDelegateNewOldValue &callback) |
| On variable change provides old and new value. | |
Instantiated story with global variable storage and access, used to instantiate new threads.
| FInkVar AInkRuntime::GetGlobalVariable | ( | const FString & | name | ) |
Access a variable from the ink runtime.
variables are shared between all threads in the same runtime.
| name | of variable in ink script |
| void AInkRuntime::LoadSnapshot | ( | const FInkSnapshot & | snapshot | ) |
Loads a snapshot file, therefore deletes globals and invalidate all current Threads After this Start and StartExisting will load the corresponding Threads (on at a time).
| TFuture< FInkSnapshot > AInkRuntime::MigratableSnapshot | ( | ) |
creates a snapshot the next time the story is in a stable state.
for Blueprints please use snapshotAsync::UInkMigratableSnapshotAsync() This snapshot can be loaded with a new version of the same story. can be loaded with LoadSnapshot()
| FInkHandle AInkRuntime::ObserverVariable | ( | const FString & | variableName, |
| const FVariableCallbackDelegate & | callback ) |
Gets a ping if variable changes.
| FInkHandle AInkRuntime::ObserverVariableChange | ( | const FString & | variableName, |
| const FVariableCallbackDelegateNewOldValue & | callback ) |
On variable change provides old and new value.
| FInkHandle AInkRuntime::ObserverVariableEvent | ( | const FString & | variableName, |
| const FVariableCallbackDelegateNewValue & | callback ) |
On variable change provides new value.
| void AInkRuntime::PopExclusiveThread | ( | UInkThread * | Thread | ) |
| void AInkRuntime::PushExclusiveThread | ( | UInkThread * | Thread | ) |
Marks a thread as "exclusive".
As long as it is running, no other threads will update.
| FInkHandle AInkRuntime::RegisterTagFunction | ( | FName | functionName, |
| const FTagFunctionDelegate & | function ) |
register a "tag function" This function is executed if context or a tag in a special format appears.
| void AInkRuntime::SetGlobalVariable | ( | const FString & | name, |
| const FInkVar & | value ) |
Sets a global variable inside the ink runtime.
| name | of variable in ink script |
| value | new value for the variable |
| FInkSnapshot AInkRuntime::Snapshot | ( | ) |
creates a snapshot of the current runtime state.
can be loaded with LoadSnapshot()
make snapshot, if save? Return every time a thread chooses something yield this thread try to make snapshot, if save? fullfill promise and resume all threads
| 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
| UInkThread * AInkRuntime::StartExisting | ( | UInkThread * | thread, |
| FString | path = "", | ||
| bool | runImmediately = true ) |
Create a new Thread in existing memory, for more details.
|
inline |
Stop receiving variable-change notifications or unregister a tag function.
Prefer calling FInkHandle::Cancel() directly — that does not require the runtime.
| handle | the handle returned by ObserverVariable / ObserverVariableEvent / ObserverVariableChange / RegisterTagFunction |