The (much shorter) part 2 of my series about parametric equations in LuaSTG. Spoiler alert: It’s about Ellipses.Â
An Ellipse uses the same parametric equation as a Circle. The difference is that the formula for a Circle requires the X and Y values to be the same, while an Ellipse requires different X and Y values. The shape of the Ellipse will depend on which value is bigger or smaller. In the given example, the X value is 75 while the Y value is 30. The result is an ellipse with a larger X axis than Y axis. If you flipped these values, with Y as 75 and X as 30, you would get an ellipse with a larger Y axis instead. To reiterate:
To create a Circle, the equation is
r*cos([variable]),r*sin([variable])
“r” (the radius) should be the same for both x and y
To create an Ellipse, the formula is
a*cos([variable]),b*sin([variable])
It is the exact same formula as a circle, but there is no “r”. You have to put two different values into a and b.
As for how to recreate the above pattern:
The same stuff about the Time Parameter applies. The difference here is that I use two different waves to spawn at the same time.
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
âś“ Live Streamingâś“ Interactive Chatâś“ Private Showsâś“ HD Qualityâś“ Free Actions
Free to watch • No registration required • HD streaming
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.
English Commentary on a Chinese LuaSTG Tutorial Pt 1
Here are my personal notes on (one of) the LuaSTG tutorials I’m going through. Disclaimer: I don’t know Chinese, so this isn’t a translation of the tutorial. This post more has “sharing my homework” vibes. The tutorial, (which is linked on the LuaSTG Wiki) is here.
= = =Â
Video 1:
tl;dr They show off the legacy LuaSTG editor and how to start a new project.
Content: No, seriously, that’s it.
= = =
Video 2:
tl;dr They show "Create Simple Bullet" and Debug Settings.
Content: At 3:55 is when you get to the useful stuff. Basically they're saying that there's a grid system that determines positioning. The grid starts at the center, with the mid point being 0,0. The diagram with the four sector (-,+; +,+; -,-; and +,-) is very handy, and I strongly suggest screencapping for personal use.
(This isn’t super relevant, but I believe Danmakufu, the other noteworthy shmup engine, has a grid system with a completely different starting value. That is to say, 0,0 does is not the center of the screen there)
They then mention the maximum points are 192, 224 and -192, 224.
At 5:40 they're explaining how angles work. 0-359 is one, counter-clockwise rotation. They explain you can actually go past 360, and use 469 degrees as an example, but there's not any real point to using 469 degrees over 109 degrees (since that's what 469 is: 360 + 109 = 469 degrees).
At 6:40 they explain that you can also use negative 0-359. In their example, positive 90 shoots directly up, while negative 90 shoots directly down. You can basically think of this difference as counter-clockwise (positive) vs. clockwise (negative). You can easily test this with the Rotation Velocity function when spawning a bullet.
Afterwards they go into Aim to Player. Ryann1908 covers this in their tutorial but it's the general issue of "homing bullets need to have 0 degrees in the Angle parameter"
One note I'll add is that homing bullets that don’t have an Angle of 0 are still useful. A good (painful) example of this is Youmu's first Nonspell in PCB. After Youmu fires those two slow waves of bullets, she uses barrages of red and blue arrows that are designed to box you in. The blue arrows are obviously aimed at you, but the red arrows actually are aimed at you too. It's also "Aim To Player" the angle paremeter just isn't set to 0.
= = =
Video 3:
tl;dr They talk about 60FPS... and also (hooo boy) Repeats and Variables
Content: Yeah, I’m gonna have to make a separate post just for the part about Repeats and Variables, because using Variables with Repeats is very, very un-simple Let’s just go over the part about 60PS for now.Â
At 1:42, they start talking about 60FPS. I’m not 100% sure why they’re talking about 60FPS in this specific section (I have to assume it’s related to the use of Repeats) so I’m just going to interject with my own notes.
I’m going to assume you know what 60FPS is, but if you don’t: FPS in this context stands for “Frames Per Second”. The Touhou games (and a lot of other shooters) try to run at 60FPS. How is this relevant to LuaSTG? Keeping this value in mind is one way to help calculate shots.
For example, if you want to fire a certain number of bullets per second, then you just need to remember that there are 60 frames in a second and calculate the number of Waits accordingly. Want to shoot 60 bullets in one second? Make a Wait of 1 frame. Want 30 bullets in one second? Wait 2 frames in between shots. 20 bullets? Wait 3 frames. 15 bullets? Wait 4 frames etc.
Note that you don’t have to work in the timeframe of only one second. How about “I want to fire 5 bullets over 2 seconds?” Well 2 seconds is 120 FPS. 120 (frames) / 5 (shots) = 24 (gap between bullets). So we want a gap of 24 times between bullets. I know this sounds super obvious, but trust me, it’s useful to keep in mind.
= = =
Expect the part about Repeats and Variables very soon.