Good news! The reset system you wrote up, along with some slight tweaks here and there to make it fit my project, is working great for what I needed. Thank you so much!
Bad news! I’m now experiencing my strangest issue yet. It seems like every time I leave the frame where my level is held, and then return to it the tick speed of the game engine speeds up? I’m not confident in the phrasing there so I’ll try to explain what’s going on.
I’ve got a character that the player controls, and some enemies that move around. If the player collides with an enemy, their health decreases. Upon reaching 0 health, the game goes to another frame saying “game over, try again?”, with a button that takes the player back to the previous frame where the gameplay takes place. That’s when the resetting occurs, which seems to be functioning as intended.
However, upon returning to the first frame, it seemed like all of the global variables were increased, possibly doubled. The player moves incredibly fast, as do the enemies. The player’s jump height is practically enough to send them into orbit. The gravity (which I use to control player jumps) is now exceptionally fast, to the point that it doesn’t look like the player is falling, so much as they’re phasing between planes of existence (and after a few “resets”, just falling straight through my ground objects and my “killzone” without detecting collision at all).
My first thought was that perhaps I had something that was adding to the global variables (something along the lines of speed += 5, or something to that effect) on load, but after digging around that doesn’t seem to be the case, so I decided in the update of my frame script I would console log the speed variable just to see what’s going on.
So, watching the speed variable get logged on every tick shows that it isn’t changing after resetting. Instead, it seems to be that every time I reset, the number of times the variable is logged in the console per second is rapidly increasing, as if the frame rate of the game was somehow increasing, causing the variable to be logged many more times per second with each reset, as compared to the first run.
I have no idea what would be causing this, and I’m not sure that there’s really anything anyone can do to help. I know it would be easier for people to figure out what’s going on if I uploaded my .wick file, but I’ll be totally honest, I don’t want to do that because I know that it’s absolutely atrocious. There’s all kinds of whacky code all over the place, none of it is commented, and it would probably cause anyone who saw it nightmares for decades. Frankly I’d just be too embarrassed to have people see it.
Anyway, I guess I’m mostly just posting this to vent about my own programming inadequacies. Hopefully I can find some work-around for this issue before the game jam deadline. Wish me luck, friends!
edit: Tried console logging the project frame rate. It is not increasing.