customPowerups.lua - One more powerup framework! [v1.2]

Share and discuss custom LunaLua code and content packs for SMBX2.
Cat king
Swooper
Swooper
Posts: 58
Joined: Thu Feb 29, 2024 1:04 pm
Flair: Mario kart wii is #1
Pronouns: he/him

Re: customPowerups.lua - One more powerup framework! [v1.1]

Postby Cat king » Mon Jul 08, 2024 12:21 pm

King Mario wrote:
Mon Jul 08, 2024 11:27 am
I was testing some more and I realized two things:

1. Bubble Flower cannot be used while invincible with Starman. This is a really minor issue though, maybe it's meant to be that way.

2. The More Important Thing: Whenever Bosses (the default ones) get captured by bubbles, they get killed instantly. I was thinking that maybe I could take all of the current Boss NPCs and put them in a blacklist so that the Bubble doesn't instantly kill bosses in one hit. How would I blacklist a set of NPCs though? A little help would be nice.
I don't know much about Luna lua, but from what I can tell the star issue seems to be a silly mistake in the code where it can die from a star. Not sure how to fix that, but maybe make the bubble friendly by default. As for the second issue the only way I could imagine fixing that would be to modify the code. Perhaps you could use the iselectric or health config settings (as there is only like one NPC that actually uses iselectric in the game anyways) to define which ones it can harm and which ones it can't. Again I have little to no experience with Luna lua, so I'm probably missing something.

Marioman2007
Lakitu
Lakitu
Posts: 487
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: customPowerups.lua - One more powerup framework! [v1.1]

Postby Marioman2007 » Wed Jul 10, 2024 2:21 am

King Mario wrote:
Mon Jul 08, 2024 11:27 am
I was testing some more and I realized two things:

1. Bubble Flower cannot be used while invincible with Starman. This is a really minor issue though, maybe it's meant to be that way.

2. The More Important Thing: Whenever Bosses (the default ones) get captured by bubbles, they get killed instantly. I was thinking that maybe I could take all of the current Boss NPCs and put them in a blacklist so that the Bubble doesn't instantly kill bosses in one hit. How would I blacklist a set of NPCs though? A little help would be nice.

1. Oops, that's a mistake on my part.

2. There are blacklist and whitelist functions, you can use them like this:

Code: Select all

local bubble = require("AI/smbw_bubble")
bubble.whitelist(id)
bubble.blacklist(id)

King Mario
Tweeter
Tweeter
Posts: 166
Joined: Sun Nov 19, 2017 2:13 pm
Flair: Jesus Christ is Lord!
Pronouns: he/him
Contact:

Re: customPowerups.lua - One more powerup framework! [v1.1]

Postby King Mario » Wed Jul 10, 2024 7:58 am

Marioman2007 wrote:
Wed Jul 10, 2024 2:21 am
King Mario wrote:
Mon Jul 08, 2024 11:27 am
I was testing some more and I realized two things:

1. Bubble Flower cannot be used while invincible with Starman. This is a really minor issue though, maybe it's meant to be that way.

2. The More Important Thing: Whenever Bosses (the default ones) get captured by bubbles, they get killed instantly. I was thinking that maybe I could take all of the current Boss NPCs and put them in a blacklist so that the Bubble doesn't instantly kill bosses in one hit. How would I blacklist a set of NPCs though? A little help would be nice.

1. Oops, that's a mistake on my part.

2. There are blacklist and whitelist functions, you can use them like this:

Code: Select all

local bubble = require("AI/smbw_bubble")
bubble.whitelist(id)
bubble.blacklist(id)
Thanks for the help! Truth to tell, I actually figured out the solution a little while ago. What I did was a little different. I took this code

Code: Select all

local blacklist = {}
and changed it to this

Code: Select all

local blacklist = table.map{15, 39, 86, 200, 201, 351, 209, 262, 267, 268, 280, 281, 413, 608}
and it works! Now the Bubble Flower no longer insta-kills Bosses! Regardless, thanks for your help and Cat King's, I really appreciate it.

Marioman2007
Lakitu
Lakitu
Posts: 487
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Re: customPowerups.lua - One more powerup framework! [v1.2]

Postby Marioman2007 » Mon Aug 19, 2024 6:49 am

Update to Version 1.2!!

This is a major update which adds a lot of new features and major bugfixes.
- Costume support
- Cheats
- Forced state effects
- Support for respawnRooms and customReserve
- Now the code checks if the player is in mega state before doing stuff
- setting to prevent the powerup from going into the reserve box
- Bubble flower now works properly if the starman effect is active

WinterSweater
Fighter Fly
Fighter Fly
Posts: 40
Joined: Sat Apr 23, 2022 12:32 pm
Flair: Eternity Larva
Pronouns: they/them/their

Re: customPowerups.lua - One more powerup framework! [v1.2]

Postby WinterSweater » Fri Aug 30, 2024 9:10 pm

I tried to edit the mini mushroom so you can run up and down the walls and on the ceiling
Image

DrMekar
Eerie
Eerie
Posts: 780
Joined: Sat Apr 08, 2017 7:16 am
Flair: CUSTOM CHARACTER CREATOR
Contact:

Re: customPowerups.lua - One more powerup framework! [v1.2]

Postby DrMekar » Sun Sep 01, 2024 3:04 pm

Image
For some reason I got this error when the Tank squashed the Spiny Egg.

If it helps, the Custom Powerups I'm using are:
Cape Feather, Superball Flower, Jumping Lui, Gold Flower, Swooper Suit and Chuck Suit.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari