How to make a level end when a certain NPC dies? (SMBX2)

Need help with any SMBX game-related issues? Ask your questions here.

Moderator: Userbase Moderators

MagnusTheGreen
Goomba
Goomba
Posts: 2
Joined: Fri Aug 13, 2021 6:30 pm
Pronouns: he/him

How to make a level end when a certain NPC dies? (SMBX2)

Postby MagnusTheGreen » Fri Aug 13, 2021 6:56 pm

Sorry if this is against the rules to post this here, I'm new to the forums. Basically, I used to use SMBX around 2014-2015, but stopped after a bit. I decided to pick up SMBX2 recently to learn how to make levels again. However, I cannot figure out how to make a level end when I kill an NPC. I'm specifically trying to use the Mega Goomba NPC. I tried setting them to a "Boss NPC" but that didn't work. Googling it didn't help either. Does anyone here know how to do this?

Julia Pseudo
Luigi
Luigi
Posts: 5609
Joined: Wed Jan 08, 2014 12:04 am
Flair: gay gaymer girl
Pronouns: She/her

Re: How to make a level end when a certain NPC dies? (SMBX2)

Postby Julia Pseudo » Fri Aug 13, 2021 10:50 pm

MagnusTheGreen wrote:
Moved to Help & Support as the thread belongs here.

As for your question, the simplest way to do this (without Lua) is with layers and events. Make a new layer in the Layers tab, selectable in the top right of the Moondust editor toolbar by clicking on the two item blocks. Let's call our new layer Exit Layer. Place the level exit you wish to use (let's say an SMB3 goal ball) into the level assigned to Exit Layer (this can be picked in the Item Properties tab that appears when you select it). Then, in the Layers tab, hide Exit Layer by unchecking it. This will cause your goal ball to disappear.

Next, make an event in the Events tab, selectable in the top right of the Moondust editor toolbar by clicking on the stopwatch. Let's call the new event Boss Defeat. In the event's settings, under "Layer visibility", add Exit Layer to the "Show" category. This will cause the layer to appear when that event activates.

Now, pick the NPC you want to use as a boss, and, while it is selected, in its Item Properties tab, under "Death", pick your Boss Defeat event, then place the NPC into the level. There is much more you can do with this system as well, but these are the basics.

The "Set as Boss" option (also known as Legacy Boss in the old 1.3 editor) only works for Boom Boom, Birdo, and SMB3 Bowser and causes the former two to drop an SMB3 goal ball and an SMB2 crystal ball respectively when all npcs of their type in the level are killed, and for the latter it causes the game to end and the credits to roll when all npcs of his type in the level as killed. While one of them is on screen, their respective boss themes also play. While this is a useful feature, it isn't implemented for any other NPCs unfortunately.

On another note, I would recommend joining the SMBX discord, as it will allow people to respond more quickly to any help you need, and in real time.

Marioman2007
2025 Egg Hunter
2025 Egg Hunter
Posts: 544
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: How to make a level end when a certain NPC dies? (SMBX2)

Postby Marioman2007 » Sat Aug 14, 2021 3:05 am

Or use level.finish(end state, bool delayed)

KateBulka
Dolphin
Dolphin
Posts: 1112
Joined: Tue Apr 15, 2014 8:29 am
Pronouns: she/her

Re: How to make a level end when a certain NPC dies? (SMBX2)

Postby KateBulka » Sun Aug 15, 2021 1:36 pm

marioman2007 wrote:
Sat Aug 14, 2021 3:05 am
Or use level.finish(end state, bool delayed)
(Small note: you probably meant Level.finish , hehe :) )

MagnusTheGreen
Goomba
Goomba
Posts: 2
Joined: Fri Aug 13, 2021 6:30 pm
Pronouns: he/him

Re: How to make a level end when a certain NPC dies? (SMBX2)

Postby MagnusTheGreen » Mon Aug 16, 2021 1:17 am

Julia Pseudo wrote:
Fri Aug 13, 2021 10:50 pm
MagnusTheGreen wrote:
On another note, I would recommend joining the SMBX discord, as it will allow people to respond more quickly to any help you need, and in real time.
Thanks a bunch, mind linking the discord?

Marioman2007
2025 Egg Hunter
2025 Egg Hunter
Posts: 544
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: How to make a level end when a certain NPC dies? (SMBX2)

Postby Marioman2007 » Mon Aug 16, 2021 1:33 am



Return to “Help and Support”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari