#luastg troubleshooting
Explore tagged Tumblr posts
Text
List of Common Errors in LuaSTG
This quick reference post is about common errors you might get when using LuaSTG. This post is a WIP. Updated 08 / 05 / 2021
= = =
Troubleshooting in General
If you’ve done something in LuaSTG that “breaks” the game / causes your project to be unable to load when testing your project, I recommend using Ctrl Z and Ctrl Y (i.e. Undo and Redo) to retrace your steps. While it is tedious, using Undo and then trying to boot the game up after each undone step is one slow but surefire way of figuring out what step caused the error.
= = = = = = = = = = = = = = = =
The Common Errors
= = = = = = = = = = = = = = = =
Creating an infinite “Repeat” node that only Waits or only shoots Bullets
This will probably the first error you run into. Basically, if you’re creating an infinitely repeating Repeat node, you don’t want the node to shoot Bullets without any Wait nodes and you don’t want an infinitely repeating Repat node that only has Wait in it. Doing either of these will crash the game because the game will be stuck in an infinite loop of either Waiting or Shooting Bullets on frame 1. To fix these problems, make sure you add whatever is missing (so if it’s Repeat with only Create Bullet, add a Wait node, and if it’s Repeat with only Wait, add a Create Bullet node)
Note that this ONLY applies if you’re using a Repeat node set to repeat infinitely. If the Repeat node isn’t repeating infinitely, you can leave Wait or Shoot by itself. The error only happens with Repeat nodes set to loop infinitely.
Defining [x] node etc. and not giving [x] node a name
This one is rather obvious but don’t forget that when you Define Bullet, Define Laser or Define Whatever you have to actually name that Node something. Even if it’s not being used, your newly created Node needs a name. This also applies to “Load [x] nodes” like “Load Background Music” or “Load Images”
Creating a “Load Background Music” node and leaving the “Loop end” and “Loop length” parameters blank
Don’t leave those parameters blank or LuaSTG crashes. Even if you don’t want your track to have a perfect loop, you have to put a 0 in both paremeters
Naming Variable
I have just discovered that variable names cannot have spaces. For example if you try to create a variable called “spawn angle” you will get an error. There must be no spaces (i.e. “spawnangle”)
Faulty Formulas
I have also noticed that when it comes to formulas, you don’t want to do soemthing like “30^3(variable iii)”. Put the ^ sign AFTER the brackets.
1 note
·
View note