Page 3 of 4

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

Posted: Tue May 07, 2024 11:56 am
by mariobrigade2018
KJPopcorn wrote:
Tue May 07, 2024 10:23 am
I mean, yeah, but you’ll have to code it yourself.
How?
The download have 2 examples of how to make them, and any Powerup that uses anotherpowerup (aside from Captain Monochrome’s acorn and penguin suit) can work with this as well.

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

Posted: Tue May 07, 2024 3:55 pm
by KJPopcorn
mariobrigade2018 wrote:
Tue May 07, 2024 11:56 am
KJPopcorn wrote:
Tue May 07, 2024 10:23 am
I mean, yeah, but you’ll have to code it yourself.
How?
The download have 2 examples of how to make them, and any Powerup that uses anotherpowerup (aside from Captain Monochrome’s acorn and penguin suit) can work with this as well.
Ok

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

Posted: Thu May 30, 2024 6:02 pm
by Shodax
Hello.
First of all, great job your library works excellent, I can add all the powerups I want, but I have a question.
I don't know if I did anything wrong but apparently with the script of "Cape Feather"(ap_cape.lua) the powerup of "Drill" behaves like the "Drill" because when trying to do the "GroundPound" the character of Mario does not execute the action, as it is automatically canceled looks:
Image

Strangely with Luigi if the action and animation are executed

Image

I say it's the "Cape Feather" because when I remove that script it doesn't give that problem anymore.
This is my setup, I probably didn't get something right

Code: Select all

	
local cp = require("customPowerups")
local drill = cp.addPowerup("Drill", "powerups/drill", 753)
drill.applyDefaultSettings()
cp.addPowerup("Superball", "powerups/ap_superball", 957, true)
cp.addPowerup("Carrot", "powerups/ap_carrot", 848, true)
local bubbleFlower = cp.addPowerup("Bubble Flower", "powerups/bubbleFlower", 751)
cp.registerItemTier(968, true)
cp.registerItemTier(969, true)
cp.registerPowerup("ap_thunderflower")

twirl = require("Twirl")

local aw = require("anotherwalljump")
aw.registerAllPlayersDefault()

local GP = require("GroundPound")
GP.applyDefaultSettings()
GP.inputStyle = GP.INPUT_DOUBLE_DOWN


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

Posted: Thu May 30, 2024 11:42 pm
by Marioman2007
How are you registering the cape feather?

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

Posted: Fri May 31, 2024 2:31 am
by mariobrigade2018
Marioman2007 wrote:
Thu May 30, 2024 11:42 pm
Ping
Oh yeah I remember, how’s progress on fixing the costume bug?

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

Posted: Fri May 31, 2024 10:05 pm
by Shodax
Marioman2007 wrote:
Thu May 30, 2024 11:42 pm
How are you registering the cape feather?
I don't add it, I just copy the files and modify the npc-851.lua by changing the code

Code: Select all

local ap = require("anotherpowerup")
by

Code: Select all

local ap = require("customPowerups")
And it works.

However, I have tried to register it this way

Code: Select all

cp.addPowerup("Cape Feather", "ap_cape", 851)
I've also added the "true"

Code: Select all

cp.addPowerup("Cape Feather", "ap_cape", 851, true)

And it's still the same, what do you recommend?

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

Posted: Sat Jun 01, 2024 7:48 am
by Marioman2007
Shodax wrote:
Fri May 31, 2024 10:05 pm

Code: Select all

local ap = require("customPowerups")

Doing this works fine for me.
Can you share your test level so that I can check?

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

Posted: Sat Jun 01, 2024 7:08 pm
by Shodax
Marioman2007 wrote:
Sat Jun 01, 2024 7:48 am
Shodax wrote:
Fri May 31, 2024 10:05 pm

Code: Select all

local ap = require("customPowerups")

Doing this works fine for me.
Can you share your test level so that I can check?
I'll leave it here. The level file is called "pruebas"
Thank you

https://www.mediafire.com/file/hd6rqkec ... t.zip/file

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

Posted: Sat Jun 01, 2024 7:16 pm
by mariobrigade2018
If I remember correctly, you don’t need to register the cape feather in the luna.lua file, because the lua file for the Cape already does this.

Also this.
mariobrigade2018 wrote:
Fri May 31, 2024 2:31 am
Marioman2007 wrote:
Thu May 30, 2024 11:42 pm
Ping
Oh yeah I remember, how’s progress on fixing the costume bug?

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

Posted: Sun Jun 02, 2024 2:53 am
by Marioman2007
Shodax wrote:
Sat Jun 01, 2024 7:08 pm
I'll leave it here. The level file is called "pruebas"
Thank you

https://www.mediafire.com/file/hd6rqkec ... t.zip/file

Oh, it's due to drill.lua.
Find this code

Code: Select all

local function isOnGround(p)
	return (
		p.speedY == 0 -- "on a block"
		or p:mem(0x176,FIELD_WORD) ~= 0 -- on an NPC
		or p:mem(0x48,FIELD_WORD) ~= 0 -- on a slope
	)
end
And replace that with this.

Code: Select all

local function isOnGround(p)
    return p:isOnGround()
end



mariobrigade2018 wrote:
Fri May 31, 2024 2:31 am
Oh yeah I remember, how’s progress on fixing the costume bug?
I think it's done, but I have not tested it properly.

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

Posted: Sun Jun 02, 2024 1:49 pm
by Shodax
Marioman2007 wrote:
Sun Jun 02, 2024 2:53 am
Shodax wrote:
Sat Jun 01, 2024 7:08 pm
I'll leave it here. The level file is called "pruebas"
Thank you

https://www.mediafire.com/file/hd6rqkec ... t.zip/file

Oh, it's due to drill.lua.
Find this code

Code: Select all

local function isOnGround(p)
	return (
		p.speedY == 0 -- "on a block"
		or p:mem(0x176,FIELD_WORD) ~= 0 -- on an NPC
		or p:mem(0x48,FIELD_WORD) ~= 0 -- on a slope
	)
end
And replace that with this.

Code: Select all

local function isOnGround(p)
    return p:isOnGround()
end



mariobrigade2018 wrote:
Fri May 31, 2024 2:31 am
Oh yeah I remember, how’s progress on fixing the costume bug?
I think it's done, but I have not tested it properly.
It works perfectly!

Thank you

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

Posted: Thu Jun 06, 2024 8:24 pm
by ducksarecool2001
What is anotherpowerup.lua and customPowerups.lua? How do you use them?

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

Posted: Thu Jun 13, 2024 11:41 am
by mariobrigade2018
ducksarecool2001 wrote:
Thu Jun 06, 2024 8:24 pm
What is anotherpowerup.lua and customPowerups.lua? How do you use them?
Those two are frameworks that add more powerups, with ap being buggier than cp. Normally, for any library, you would use this code:

Code: Select all

require(“name of library”)
...to load it in, but some of them may have settings that you might want to change. In that case, this code is required to change them:

Code: Select all

local anyvariablename = require(“name of library”)
anyvariablename.settingname = changedvalue
... which is what you need to do in order to register powerups.

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

Posted: Mon Jun 24, 2024 6:18 am
by King Mario
KJPopcorn wrote:
Mon May 06, 2024 5:52 pm
I meant: can you make these with this?
Spoiler: show
Image
Image
Image
Image
Image

As well as Luigi's, Toad's, Link's and Peach's sprites
I think you have amazing ideas! It would be quite cool to see the Frog Suit, Shell Suit, Propeller Suit, and Mini Mario in SMBX2! Looking forward to seeing them once they're finished.

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

Posted: Mon Jun 24, 2024 1:07 pm
by Cat king
According to the original post, any custom powerups replace existing ones. But in this post, I can see there are more powerups than the normal amount (Which I believe is 5). So I'm not entirely certain about the limits of the powerups for this library. How many can I have, more than the initial 5 or is it still limited by that? Also would the code work for episodes (e.x. penguin suit all throughout the episode).
Spoiler: show
Shodax wrote:
Thu May 30, 2024 6:02 pm
Hello.
First of all, great job your library works excellent, I can add all the powerups I want, but I have a question.
I don't know if I did anything wrong but apparently with the script of "Cape Feather"(ap_cape.lua) the powerup of "Drill" behaves like the "Drill" because when trying to do the "GroundPound" the character of Mario does not execute the action, as it is automatically canceled looks:
Image

Strangely with Luigi if the action and animation are executed

Image

I say it's the "Cape Feather" because when I remove that script it doesn't give that problem anymore.
This is my setup, I probably didn't get something right

Code: Select all

	
local cp = require("customPowerups")
local drill = cp.addPowerup("Drill", "powerups/drill", 753)
drill.applyDefaultSettings()
cp.addPowerup("Superball", "powerups/ap_superball", 957, true)
cp.addPowerup("Carrot", "powerups/ap_carrot", 848, true)
local bubbleFlower = cp.addPowerup("Bubble Flower", "powerups/bubbleFlower", 751)
cp.registerItemTier(968, true)
cp.registerItemTier(969, true)
cp.registerPowerup("ap_thunderflower")

twirl = require("Twirl")

local aw = require("anotherwalljump")
aw.registerAllPlayersDefault()

local GP = require("GroundPound")
GP.applyDefaultSettings()
GP.inputStyle = GP.INPUT_DOUBLE_DOWN


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

Posted: Mon Jun 24, 2024 3:24 pm
by King Mario
Oh that's right! You reminded me of something. I got 6 existing custom powerups to work in SMBX2 B5, at the same time! Yeah, it was a little hard to get it done, but I tampered around with the .lua and .ini files, and learned some valuable things. I don't claim to be a professional at LunaLua by any standards, but eventually, I was able to figure out what it was I was missing, and once I did, all 6 powerups started working perfectly! (With Mario and Luigi anyway.) I also personally made my own file called Custom Powerups.tileset.ini, the point of which would be to record and call every instance of custom powerups that I wanted to use. And for an added bonus, I've also added Tempest's Boomerang Flower, which replaces Mario's Hammer Suit and also works perfectly! Credit goes to Tempest for the original powerup.

Here's a video to prove that all 6 powerups work:


And here's the file if you want to use it (including the test level): https://www.dropbox.com/scl/fo/6dywftpc ... o3opq&dl=0

DISCLAIMER: I do NOT own or claim for myself any of the scripts, powerups, or files made by other people. The credit for all those belong to the original owners of said content, wherever credit is due. The only things I made are the tileset.ini file and my personal modifications to the .lua and .ini files.

Added in 25 minutes 30 seconds:
Some things I should make clear:
1. Tempest's Boomerang Flower is the only powerup that replaces an existing powerup. Every other custom powerup is its own independent thing and works just fine, without replacing anything!
2. Only Mario and Toad can throw boomerangs. Upon any other character interacting with the Boomerang Flower, it will function just like an ordinary Hammer Suit, granting the other 3 main characters their traditional abilities (Hammer Suit for Luigi, Bomb Suit for Peach, and Master Sword for Link).
3. Only Mario and Luigi can use the Drill Mushroom. Doing otherwise can cause weird bugs, glitches, or even a crash.
4. The only custom abilities Link can properly use are Cape Feather and Gold Flower. Using any of the other 4 custom powerups with Link will definitely cause a crash.

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

Posted: Tue Jun 25, 2024 1:48 pm
by mariobrigade2018
King Mario wrote:
Mon Jun 24, 2024 3:49 pm
All workable AP powerups as CP ones

Added in 25 minutes 30 seconds:
Some things I should make clear:
1. Tempest's Boomerang Flower is the only powerup that replaces an existing powerup. Every other custom powerup is its own independent thing and works just fine, without replacing anything!
2. Only Mario and Toad can throw boomerangs. Upon any other character interacting with the Boomerang Flower, it will function just like an ordinary Hammer Suit, granting the other 3 main characters their traditional abilities (Hammer Suit for Luigi, Bomb Suit for Peach, and Master Sword for Link).
3. Only Mario and Luigi can use the Drill Mushroom. Doing otherwise can cause weird bugs, glitches, or even a crash.
4. The only custom abilities Link can properly use are Cape Feather and Gold Flower. Using any of the other 4 custom powerups with Link will definitely cause a crash.
I actually made the Boomerang Flower work on other characters. I can send it in if you want.

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

Posted: Tue Jun 25, 2024 5:21 pm
by King Mario
mariobrigade2018 wrote:
Tue Jun 25, 2024 1:48 pm
King Mario wrote:
Mon Jun 24, 2024 3:49 pm
All workable AP powerups as CP ones

Added in 25 minutes 30 seconds:
Some things I should make clear:
1. Tempest's Boomerang Flower is the only powerup that replaces an existing powerup. Every other custom powerup is its own independent thing and works just fine, without replacing anything!
2. Only Mario and Toad can throw boomerangs. Upon any other character interacting with the Boomerang Flower, it will function just like an ordinary Hammer Suit, granting the other 3 main characters their traditional abilities (Hammer Suit for Luigi, Bomb Suit for Peach, and Master Sword for Link).
3. Only Mario and Luigi can use the Drill Mushroom. Doing otherwise can cause weird bugs, glitches, or even a crash.
4. The only custom abilities Link can properly use are Cape Feather and Gold Flower. Using any of the other 4 custom powerups with Link will definitely cause a crash.
I actually made the Boomerang Flower work on other characters. I can send it in if you want.
Oh you did? That's pretty cool! Sure, you may send it in.

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

Posted: Wed Jun 26, 2024 11:06 am
by Cat king
King Mario wrote:
Mon Jun 24, 2024 3:49 pm
Oh that's right! You reminded me of something. I got 6 existing custom powerups to work in SMBX2 B5, at the same time! Yeah, it was a little hard to get it done, but I tampered around with the .lua and .ini files, and learned some valuable things. I don't claim to be a professional at LunaLua by any standards, but eventually, I was able to figure out what it was I was missing, and once I did, all 6 powerups started working perfectly! (With Mario and Luigi anyway.) I also personally made my own file called Custom Powerups.tileset.ini, the point of which would be to record and call every instance of custom powerups that I wanted to use. And for an added bonus, I've also added Tempest's Boomerang Flower, which replaces Mario's Hammer Suit and also works perfectly! Credit goes to Tempest for the original powerup.

Here's a video to prove that all 6 powerups work:


And here's the file if you want to use it (including the test level): https://www.dropbox.com/scl/fo/6dywftpc ... o3opq&dl=0

DISCLAIMER: I do NOT own or claim for myself any of the scripts, powerups, or files made by other people. The credit for all those belong to the original owners of said content, wherever credit is due. The only things I made are the tileset.ini file and my personal modifications to the .lua and .ini files.

Added in 25 minutes 30 seconds:
Some things I should make clear:
1. Tempest's Boomerang Flower is the only powerup that replaces an existing powerup. Every other custom powerup is its own independent thing and works just fine, without replacing anything!
2. Only Mario and Toad can throw boomerangs. Upon any other character interacting with the Boomerang Flower, it will function just like an ordinary Hammer Suit, granting the other 3 main characters their traditional abilities (Hammer Suit for Luigi, Bomb Suit for Peach, and Master Sword for Link).
3. Only Mario and Luigi can use the Drill Mushroom. Doing otherwise can cause weird bugs, glitches, or even a crash.
4. The only custom abilities Link can properly use are Cape Feather and Gold Flower. Using any of the other 4 custom powerups with Link will definitely cause a crash.
Interesting. I wasn't aware that one could have independent power ups due to some limitation in the code of the original SMBX.

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

Posted: Mon Jul 08, 2024 11:27 am
by King Mario
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.