Re: customPowerups.lua - One more powerup framework! [v1.1]
Posted: Tue May 07, 2024 11:56 am
Forums for SMBX
https://www.smbxgame.com/forums/
Okmariobrigade2018 wrote: ↑Tue May 07, 2024 11:56 amThe 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.
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
Oh yeah I remember, how’s progress on fixing the costume bug?
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")
Code: Select all
local ap = require("customPowerups")
Code: Select all
cp.addPowerup("Cape Feather", "ap_cape", 851)
Code: Select all
cp.addPowerup("Cape Feather", "ap_cape", 851, true)
I'll leave it here. The level file is called "pruebas"Marioman2007 wrote: ↑Sat Jun 01, 2024 7:48 am
Doing this works fine for me.
Can you share your test level so that I can check?
mariobrigade2018 wrote: ↑Fri May 31, 2024 2:31 amOh yeah I remember, how’s progress on fixing the costume bug?
Shodax wrote: ↑Sat Jun 01, 2024 7:08 pmI'll leave it here. The level file is called "pruebas"
Thank you
https://www.mediafire.com/file/hd6rqkec ... t.zip/file
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
Code: Select all
local function isOnGround(p)
return p:isOnGround()
end
I think it's done, but I have not tested it properly.mariobrigade2018 wrote: ↑Fri May 31, 2024 2:31 amOh yeah I remember, how’s progress on fixing the costume bug?
It works perfectly!Marioman2007 wrote: ↑Sun Jun 02, 2024 2:53 amShodax wrote: ↑Sat Jun 01, 2024 7:08 pmI'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 codeAnd replace that with this.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
Code: Select all
local function isOnGround(p) return p:isOnGround() end
I think it's done, but I have not tested it properly.mariobrigade2018 wrote: ↑Fri May 31, 2024 2:31 amOh yeah I remember, how’s progress on fixing the costume bug?
Those two are frameworks that add more powerups, with ap being buggier than cp. Normally, for any library, you would use this code:ducksarecool2001 wrote: ↑Thu Jun 06, 2024 8:24 pmWhat is anotherpowerup.lua and customPowerups.lua? How do you use them?
Code: Select all
require(“name of library”)
Code: Select all
local anyvariablename = require(“name of library”)
anyvariablename.settingname = changedvalue
I actually made the Boomerang Flower work on other characters. I can send it in if you want.King Mario wrote: ↑Mon Jun 24, 2024 3:49 pmAll 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.
Oh you did? That's pretty cool! Sure, you may send it in.mariobrigade2018 wrote: ↑Tue Jun 25, 2024 1:48 pmI actually made the Boomerang Flower work on other characters. I can send it in if you want.King Mario wrote: ↑Mon Jun 24, 2024 3:49 pmAll 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.
Interesting. I wasn't aware that one could have independent power ups due to some limitation in the code of the original SMBX.King Mario wrote: ↑Mon Jun 24, 2024 3:49 pmOh 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.