Step 1: Hello World

Open Script Directory

First, launch the builder.
You will keep all lua files that your game uses in your Script Directory.
To access this directory, click Folders->Open Local Directory.

 

Create New File

To start, create a new file called examplePenguinScript.lua
Open this file in your favorite text editor (We recommend Notepad++).

 

Print Output

Inside this file, you'll want to create a new onSceneStart function.
This special function is always called when a game first starts.
For now, you'll just print out the text "Hello World".
The exact code is located below, at the bottom of Step 1.
Save this file, then go back to the builder.

 

Set Script

To specify that you want to use your new script file, open the Global Properties (the top button on the right).
Under the Script tab, you can see that the attached script is already set to a default.
Specify the name of your script. Be sure to include your username.
For example, "yourusername/examplePenguinScript.lua" (without the quotes).

 

Test

Now, to test this pocket, click Debug->Begin Test.
In the new window that pops up you can see your pocket as it runs, but you also have access to the Debug Console.
Click the Debug Console button on the right and you can view your pocket's output.
You should see the words "Hello World" near the bottom to indicate that your script is running.
Congrats, you've gotten everything set up.
From here on out, all you have to do is save changes to your script and click reload on the test page to see the changes.

( Wild Pockets Manual : More details about setting up your scripts. )


    -- onSceneStart is called first to start the game
function onSceneStart()
 
-- Output to the debug console
print ("Hello World")
end