Actors and Modules
Look up actors and modules calls and properties.
proj.find(name)
Find one authored Actor in the project hierarchy.
- Arguments
name: Actor name string. A folder such asproj.Dungeoncan replaceproj.- Returns
An Actor handle, or
nil.- Works with
Authored Actors in the selected folder and its descendants.
- Missing values and errors
Does not find Cells. No match returns
niland warns. Multiple matches warn and return the first. Wrong argument counts or types report an error.
Also available as: folder.find.
const door = proj.find("Door")
if door != nil {
door.visible = false
}proj.find.all(name)
Find every matching Actor in the selected scope.
- Arguments
name: Actor name string. A project folder can narrow the search.- Returns
A basket of Actor handles; empty if none matches.
- Works with
Authored Actors, not Cells or Player Modules.
- Missing values and errors
Wrong argument count or a non-string name reports an error.
Also available as: folder.find.all.
const enemies = proj.find.all("Enemy")
for enemy in enemies {
debug.log(enemy.id)
}player.find(name)
Find one Player-attached Module.
- Arguments
name: Module filename without.aeo; matching ignores case. Only enabled Player Modules are searched.- Returns
A Module, or
nil.- Works with
Modules attached to the Player Actor.
- Missing values and errors
Does not search Cells or arbitrary Actors. Multiple matches warn and return the first. Wrong argument counts or types report an error.
const modules = player.find("Inventory")
debug.log(modules)player.find.all(name)
Find all matching Player-attached Modules.
- Arguments
name: Module filename without.aeo; matching ignores case. Only enabled Player Modules are searched.- Returns
A basket of Modules; empty if none matches.
- Works with
Modules attached to the Player Actor.
- Missing values and errors
Does not search Cells or arbitrary Actors. Wrong argument counts or types report an error.
const modules = player.find.all("Inventory")
debug.log(modules)scripts.<path>.aeo
Load a reusable script Module.
- Arguments
A path beneath
scripts/, written as members.- Returns
The Module instance for that path.
- Works with
Project
.aeoModule files.- Missing values and errors
Missing files or functions report an error. A standalone Module has no Actor parent.
// Define add(a, b) in scripts/math_helpers.aeo first.
const helper = scripts.math_helpers.aeo
debug.log(helper.add(10, 20))self.parent
Read the Actor that owns this Module.
- Arguments
No arguments. Read inside an attached Module.
- Returns
The parent Actor handle.
- Works with
Actor-attached and Player-attached Modules.
- Missing values and errors
A standalone Module has no parent; reading this property reports an error.
// Run this in an Actor-attached Module.
const actor = self.parent
debug.log(actor.id)player.controller
Read the enabled Player Module named controller.
- Arguments
No arguments. Read this member.
- Returns
The enabled Module named controller.
- Works with
The enabled primary controller attached to the Player.
- Missing values and errors
If no enabled controller.aeo Module is attached, this member is unavailable and reports an error.
debug.log(player.controller)object.get_children()
Read the children exposed by the engine host.
- Arguments
No arguments.
- Returns
A basket of handles. Empty when no children are exposed.
- Works with
Engine object handles; the host determines available relationships.
- Missing values and errors
This is a handle relationship query. It does not search the project hierarchy by name.
const object = proj.find("Guard")
if object != nil {
debug.log(object.get_children())
}object.get_parent()
Read the parent exposed by the engine host.
- Arguments
No arguments.
- Returns
A handle, or nil when no parent is exposed.
- Works with
Engine object handles; the host determines available relationships.
- Missing values and errors
This is a handle relationship query. It does not search the project hierarchy by name.
const object = proj.find("Guard")
if object != nil {
debug.log(object.get_parent())
}[BETA] marks features newer than the current public release. Current release: 0.8.0.