Collecting all Star Coins on a layer isn't making my Star layer appear

Moderators: Semi-moderatos, Moderators

Animebryan
Topic author, Good citizen
Good citizen
Animebryan
Topic author, Good citizen
Good citizen
Reputation: -1
Posts: 20
Joined: 9 Jun 2017

Post #1by Animebryan » 9 Nov 2019, 9:45

One of the basic mechanics in my episode is to have the player collect 5 star coins in a level in order to get the star to appear in a certain spot. In my current level, I've been testing it to make sure that collecting all 5 star coins is possible & that the star appears like it's supposed to, but it's not. Event wise, this is pretty simple. I have all 5 star coins on a 'Star Coins' layer, with each one set with it's Star Coin ID & the option that when all objects on that layer are gone, the 'Star' layer would show. The event itself is also pretty basic. Collecting all 5 Star Coins should trigger the event, which in turn should show the star layer, but it won't.

When I used cheat codes to make the test playing easier (the level is HARD), I noticed that the star did appear, but when I wasn't using cheat codes & collected all 5 star coins (which required my tries), the star wasn't there. The reason I used the cheat codes was to confirm a suspicion I had about whether Star Coins are still considered to be collected after restarting at a checkpoint, in which case, any star coins collected before reaching a checkpoint are saved, but ones you collect afterward before you die are not. But when I collected the 5th & final one, it made a notification sound that normally happens when you collect all the star coins from a level.

So is this some sort of bug or something? How can I fix this issue?

In case you want to test this yourself, I've included the level as well as map images to help you navigate the level & find the 5 star coins. The level is really HARD, so I highly recommend using cheat codes or the debug/test options to make yourself invincible & be able to fly somehow or the ahippinandahoppin code to jump freely in the air to avoid dying in pits. The level also has a split path at the end of the 2nd section so I noted on the map which door to take.

Anyway, I hope you can figure out what's causing the issue. Considering this is a main concept in my episode, not having this simple function working is going to be a huge problem.

Fortress of Death.zip
(3.33 MiB) Downloaded 6 times

Wohlstand M
Lead Developer
Lead Developer
Avatar
Wohlstand M
Lead Developer
Lead Developer
Age: 27
Reputation: 392
Posts: 1449
Joined: 15 Feb 2014
Location: Moscow, Russia
Website Skype YouTube

Post #2by Wohlstand » 10 Nov 2019, 0:37

Quick question: do you playing this while testing or not? The star is collectable and it will disappear if it was collected earlier. So, in normal game, this star will not appear again. The only "Star exit" will appear to allow you exit level.

Here is my little sample, please try it in your game, will it be same or not?
ZtarKoins.lvlx
(1.73 KiB) Downloaded 6 times


P.S. I'll move this thread into SMBX2 section :acute:
Pay attention in the place for what you are posting. The original place you have posted this topic is related to PGE itself (PGE Editor, PGE Engine, Calibrator, console tools, etc.) and it's not about SMBX.

Animebryan
Topic author, Good citizen
Good citizen
Animebryan
Topic author, Good citizen
Good citizen
Reputation: -1
Posts: 20
Joined: 9 Jun 2017

Post #3by Animebryan » 10 Nov 2019, 5:42

Of course I'm testing. I haven't collected the star yet because it won't appear like it's supposed to. Like I said before, it only appears if I collect all 5 star coins in 1 try without dying & restarting at a checkpoint. But if I die at least once & I've collected at least 1 or more before a checkpoint & restart at one, it won't appear. I tried backtracking to see if you really have to collect all of them in 1 try, but the level is too hard without cheats.

I've edited that poor example of a level & tested my theory about why it wasn't appearing & I was right!
phpBB [youtube]

Original link: https://youtu.be/OGLM1WyhWPg


Hoeloe F
Nice citizen
Nice citizen
Hoeloe F
Nice citizen
Nice citizen
Reputation: 5
Posts: 16
Joined: 3 Nov 2014

Post #4by Hoeloe » 10 Nov 2019, 8:54

This is behaving exactly as intended.

The "no NPCS on layer" refers to all NPCs being killed on the layer. When you come back to a level with collected star coins, they are not killed, they are replaced with a different animation to indicate they have been previously collected. The NPC itself, however, is still present and spawned in the world. This means there are still 5 NPCs on the layer, even if 3 of them look different.

There are other ways to get the total collected star coin count in a level, if you use lua instead of vanilla events. Specifically, you can load the "npcs/starcoin" library, and use starcoin.getLevelCollected().


Return to “Troubleshooting”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest