Clip.remove running unload causes bugs in my game, i suggest a new option

Please complete the following questions!

Has this feature been suggested before?
no

Is your feature request related to a problem? Please describe.
I’ve been slowly developing “Hoop Flight,” and with the patch of clip.remove() “correctly” running the “unload” code when it is called, it presented a new bug in my game that depended on not calling “unload” when something was removed. I’ve tried a few things and it still didn’t work.

Describe the solution you’d like
What I’d like to suggest is a way to not run “unload” when clip.remove() is called. Something like "clip.remove({unload: bool}) where bool decides whether to run the unload code (true means run, false means don’t run).

Describe alternatives you’ve considered
I’ve tried using variables to not run unload when appropriate, and maybe my coding’s bad but it doesn’t work for me.

Image/Video Explanation Optional
Attach an image or video that will make your feature easier to understand.

Additional context
image
this abomination occurs when you die with rings on-screen and come back.

Hello Baron, I just created a new topic that will help you with removing, adding, or running a script

Question: Are you forced to use unload due to something on your game? I mean, Is there no other way to get the same results? Could you describe what you want to accomplish?

expected:

  1. play game, rings spawn, player eventually dies
  2. the program starts doing its game-over thing. it does some vcam stuff and later goes to the next frame. the rings (*there are 5 parts to the ring) delete themselves with this.remove() in unload.
  3. you play again and the cycle repeats.

this happens in 1.18, before the bug was patched. (the bug was that when this.remove() is called, it is supposed to call unload, but it didn’t. it was fixed in 1.19.)

what happens:

  1. same
  2. vcam stuff is the same, but since this.remove() in the unload calls unload again (because that’s what it’s meant to do), the rings are in and infinite loop now. it doesn’t freeze the program for some reason, but in the end they aren’t removed.
  3. you play again and the rings stay there, duplicating themselves to make even more rings and going crazy.

this happens in 1.19 when the patch of the clone remove bug caused another bug in my game.

here is the wick file. if you want to bother helping me solve this, make sure it doesn’t go crazy when you play a second time through with rings on-screen.

Hoop Flight 0.1.11-27-2021_16-38-53.wick (85.9 KB)

just before sending this, a new idea appeared in my head: i do have a possible workaround in which instead of removing the rings when the frame is left, i remove the rings when the vcam is in a specific position, before the frame transitions. i guess i will try that in the near future.

1 Like

Let me see at least the bug… lets see…

You definitely found a bug… Unload doesn’t work… I’ll open a bug topic…

1 Like