-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing/Skipping Rules? Objects disappear for no reason? #1046
Comments
On further testing, I noticed that switching away from the |
At a cursory glance, it's not that level1 has a comma (Level5Mark1) in it, but level2 doesn't? You use this in the rule on line 285:
|
True, level 2 doesn't have the mark. I only wanted the message to play on a specific level. On level 2, the player should just respawn like normal with no message. Also, the rule you mentioned is what destroys the death object, not the one that creates it. That one should be line 282:
|
I was going to try to reproduce this and I read the long comment, but I'm no wiser.
[A comment with this info at the top of the program is really helpful.] |
I attached my minimum reproduction source to the original post, but I'll include it again here: It's possible you could reduce it further; I'm not certain. What this should do is play a little animation upon the player's death, then restart the level. Instead, the last frame of the animation never appears, and the level doesn't restart. |
So after loading and running that test case:
|
All you should have to do is maneuver the player into the spike object (it looks more like a grate, I'm not a good artist). This should kill the player, trigger the death animation, and then afterwards the level should restart. The last step is the part that doesn't happen. |
I've simplified it down to a more minimal test case - the behaviour does seem a bit spooky (why doesn't it restart if the player moves right? if I remove 'again' and just tap the x to progress the animation button it works out!) https://www.puzzlescript.net/editor.html?hack=687335e01473ff938a94c48f9ee9bf77 I will look into this further - it looks like a proper bug! |
Thanks, glad I'm not just going crazy! |
In my game, I wanted to make a message appear the first time the player dies on a specific level. I do this by placing a transparent marker in the level. When the player dies, the game first searches for this marker. If it's there, it removes the marker, sends the player back to the start, then sets a checkpoint so that further restarts don't reset the marker. Then it shows the message and continues as normal. At least, that was the plan.
Instead, I've ended up with a weird bit of spaghetti code that only half-works and has severely befuddled me. I've attached a trimmed version of the source code below (
Rule Skipping Basic Reproduction.txt), and you'll see I've already laid out some of my grievances in a large comment. If you want to try it for yourself, which I highly recommend you do, walking into the spike should trigger death, and the little green circle takes you to the next level. I've also given the markers some color so you can sorta see what's happening.
The long and short of it is that some rules are being skipped, apparently because the objects required for them to trigger disappear without any prompting. In this specific example, You can see that on level 1, everything works fine, but on level 2, the game fails to auto-restart after your death animation. By looking at the verbose logging, it would seem this is because the rule that summons the Death object never runs. However, it clearly has no problem running in level 1. On further inspection, you can see that, in level 2, the final frame of the death animation is created, and nothing deletes it, but somehow it disappears on the next turn. If you remove rule 302, you can see the same behavior on level 1: for some reason, removing that rule keeps the death rule from playing.
I have no idea why this might be. There seems to be some weird voodoo going on under the hood that neither the logger or the debug view is telling me about. I've managed to recreate the broken behavior in an even simpler environment, which I've also attached (Rule Skipping Minimum Reproduction.txt). The most confusing thing is that the victory animation seems to work perfectly fine, and that the Minimum Reproduction code used to work correctly. Any light that could be shined on this is very helpful and deeply appreciated.
Platform: I've tried running both of these on Brave, Google Chrome, and Firefox. Same results on each.
The text was updated successfully, but these errors were encountered: