LorelineAsset
Asset class for loading and managing Loreline script files.
Loreline is a scripting language for narrative content, dialogue trees, and interactive storytelling. This asset type handles:
- Loading Loreline script files (.lor, .loreline)
- Parsing scripts with import resolution
- Hot-reloading when script files change
- Managing script dependencies
Example usage:
assets.add('loreline:dialogue/intro');
assets.onceComplete(this, success -> {
var script = assets.loreline('dialogue/intro');
// Use the parsed Loreline script
});
See: loreline.Loreline
Instance Members
The parsed Loreline script object. Contains the dialogue nodes, conditions, and flow logic. Observable to track when the script is loaded or reloaded.
| Name | Type | Default |
|---|---|---|
name |
String | |
variant |
String | (optional) |
options |
Null<AssetOptions> | (optional) |
Private Members
List of imported file paths used by this script. Used for hot-reload detection of dependencies.
Event when lorelineScript field changes.
| Name | Type |
|---|---|
current |
loreline.Script |
previous |
loreline.Script |
Loads an imported Loreline file referenced by the main script.
| Name | Type | Description |
|---|---|---|
assets |
Assets | The assets instance to use for loading |
importPath |
String | Path to the imported file |
importCallback |
Function | Callback with the loaded text content |
loreline
assetFilesDidChange(newFiles: ReadOnlyMap<String, Float>, previousFiles: ReadOnlyMap<String, Float>): VoidHandles file change detection for hot-reloading. Monitors both the main script file and any imported files. Triggers a reload when any monitored file changes.
| Name | Type |
|---|---|
newFiles |
ReadOnlyMap<String, Float> |
previousFiles |
ReadOnlyMap<String, Float> |
Metadata
| Name | Parameters |
|---|---|
:build |
tracker.macros.EventsMacro.build() |
:autoBuild |
tracker.macros.EventsMacro.build() |
:build |
ceramic.macros.EntityMacro.buildForCompletion() |
:autoBuild |
ceramic.macros.EntityMacro.buildForCompletion() |
:build |
tracker.macros.ObservableMacro.build() |
:autoBuild |
tracker.macros.ObservableMacro.build() |