Skip to content
AEOWUN
Docs Menu

Getting started

Write and run your first AeoScript file.

Your first AeoScript

AeoScript is Worldkiln's scripting language for adding gameplay behavior to a project. Scripts can react to events, control objects, update interfaces, and coordinate game systems.

For this first exercise, you'll create a script that writes a message to Output when you start Play. You only need an open Worldkiln project.

Create the script

  1. Open Worldkiln and create a project from Home, or open one you already have.
  2. Open the Script workspace. Use New Script to create a project script.
  3. Name the file hello.aeo and keep it in the project's scripts/ folder.
  4. Enter the following code and save the script.
debug.log("Hello from AeoScript")

The debug.log() function writes a message to Output. The text between quotation marks is a string. You can replace it with your own message.

This is a standalone script: its top-level statements run when the script starts. You don't need to attach it to an Actor or Entity.

Run the script

  1. Start Play.
  2. Open Output from the lower dock. If it is hidden, open it from View.
  3. Look for the message Hello from AeoScript.
  4. Stop Play to return to the editor.

Seeing the message confirms that Worldkiln loaded and ran your script.

Try one small change

Change the message, save the script, and start Play again:

debug.log("My first Worldkiln script works!")

You should see the new message in Output. This edit–save–Play cycle is a useful way to test a small piece of behavior before building something larger.

If the message doesn't appear

Check that hello.aeo is saved under scripts/, that the script is enabled, and that you're in Play. Then inspect the first error in Output or Problems. Correct that error and try again.

Where to go next

The First Script tutorial shows how to add and call a function. Continue with Variables, Functions, or Events when you're ready to add behavior.

Script location matters as your project grows: use standalone scripts for game-wide behavior, Actor-attached Modules for behavior belonging to an Actor, and Entity scripts for the Entity lifecycle. The API reference lists the calls available to each system.