Tutorial 0 ~ General Concepts

From LuaSTG Wiki
Jump to navigation Jump to search

Introduction[edit | edit source]

Welcome to my LuaSTG tutorials page! This page will be used as a reference in many of the other tutorials, so bookmark it so you can take a look back at it in case you don't understand some terms used in the following tutorials. This is made this way to make the tutorial workflow to be better, so that I don't have to re-explain the same terms every time.
As you can see, I'm classifying these as "remade", and the previous ones as "legacy", that is because I'm not very fond of the formatting I used for those, and maybe the explanation on those aren't as good as these new ones, so I don't recommend using those to learn the engine.
The engine is still moderately unknown, and even I don't know every capability it has, but I'll make sure to teach everything I know.
I'd like to thank Sparen of Iria for allowing me to use his guide format to make these tutorials. But before anything, you have to know something: don't try to make a big game right off the bat, take your time and learn the engine carefully, so it doesn't end in burning out or turning into a disaster.

Terms[edit | edit source]

Point of Origin[edit | edit source]

The point of origin in LuaSTG is the middle of the playing area, not the top left corner.

Management Field[edit | edit source]

Example of a management field with various nodes

This is the name I adopt to describe the area that you utilize to insert any type of node inside the editor.

Nodes[edit | edit source]

Nodes are the names I adopt for every type of thing you can insert in the editor. Example: tasks, repeat, insert object, shoot simple bullet, etc.

Node parameters[edit | edit source]

On the left side of the screen, once you click a node, it will usually show a list of changes that can be made to them. For example, on Create Simple Bullet, many options regarding it's sprite, color, velocity, etc can be changed.

Inserting Nodes[edit | edit source]

Term Name Function Example
Up.png Insert Before Inserts a node before the current node selected N/A
Down.png Insert After Inserts a node after the current node selected N/A
Child.png Insert as Child Inserts a node as a child from the current node selected Childex.png

Local/Global Variables[edit | edit source]

If you utilize the Define Variable node to, well, define a variable, that variable will be local. If you desire to make a global variable, utilize the Code node, and follow this syntax: var = 1
Make sure that if you utilize a local variable, see if the node that is gonna use it is also inside the same Code Block or Task that the variable was defined.

Common Errors[edit | edit source]

The LuaSTG editor usually warns you about possible errors or mistakes you made before actually launching the game, but sometimes it fails to do that and a crash occurs during testing. Here are some common mistakes users do and how to fix them.

Infinite objects/bullets[edit | edit source]

Infinite objects/bullets

If this error appears, you might have forgotten to make a frame interval between creating the object/bullet. You can fix this by adding at least 1 Wait node, or making the repeat node having at least a 1 frame interval between each repetition.

Game does not update changes[edit | edit source]

You probably forgot to close the game before saving the changes. Close it, save the changes, then debug it.

Must input an integer[edit | edit source]

Must input an integer

You may have put a decimal number in a place where only integers are allowed.