Menu

Pipmak_and_the_Lua_Editor

Anonymous Christian Walther
Attachments
Pipmakluaedit1.jpg (49926 bytes)
Pipmakluaedit2.jpg (63362 bytes)

Lua Editor

"What the heck do I need a Lua editing program for?"

To make your game work with Pipmak, you will need to edit the main.lua and node.lua files.

Why? Well because in the most simple terms the .lua files are telling the game engine, Pipmak, what to do!

If we open up the main.lua file in our editor, here is what you'll see:

This one is from the Pipmak Castle Demo. If you look at it, you can see where it's telling Pipmak what to do, basically scripting. (HEY! Yah! You in the back! I heard that groan! Don't worry. It's not as hard as it looks, and that's what tutorials are for. For those of you that have been using Blender and the PyPRP plugin to make "Ages" in Uru, you're going to feel right at home here!).

If you look, you'll see that certain lines start with "--", these are remark lines, and are for notes only. They are not commands. If I removed all those lines and leave only the command lines, this is what you'd see:

    version (0.27)
    title "Pipmak Castle Demo"
    startnode (99)
    onopenproject (
        function()
            state.trapDoorOpen = false
        end
    )

You don't have to put remark or notes in. The Castle Demo has them there to help you learn, or explain what the command line does.

When I look at this, the line that says "startnode (99)" jumps out at me. This line is telling Pipmak what folder (node) to start the game in. If you download the Castle Demo, you see that it has folders and one of them is marked "99". If you go and open up that folder, you'll see several files, including one called "node.lua" Let's open that one up:

If you look at the command lines here, you can see what we basically have is the game's "Main Menu". You can even see the line where you click to start the game:

       pipmak.gotonode(1)

As for what all is going on and what everything here means will be explained in other tutorials. For now, you can see why you need a program that can edit Lua files.


Return To: [Main_Page]


Related

Wiki: Main_Page