Share and discuss custom LunaLua code and content packs for SMBX2.
Moderator: Userbase Moderators
|
|
|
|
-
Lusho
- Blooper

- Posts: 163
- Joined: Wed Dec 25, 2019 11:39 pm
- Flair: Intention is what matters
- Pronouns: he/him
Postby Lusho » Tue Apr 28, 2020 11:53 am
Custom Inventory
Welcome folks to another library! this is the custom inventory, again this started in the form of reviving the old one that XerX made, although it ended being completely different, its SMB3 style, but works pretty similar to the New Super Mario Bros one.
How can i install this and how does this work?
Its pretty simple, you add the code file and folder inside your episode folder and add to your level/folder luna.lua and map.lua files:
Code: Select all local inventory = require("customInventory")
Also this comes with two functions to add stuff into your inventory, because otherwise, well, this would be useless.
Code: Select all -- The item order is: Mushroom, FireFlower, Leaf, Tanooki, Hammer, IceFlower, Starman, PWing. Going from 0 to 7
-- This function adds Items to the inventory, select which item you want to add and the amount --
inventory.addPowerUp(itemID, amount)
-- This one sets the amount of Items that you have, select which item do you want to set and the number --
inventory.setPowerUp(itemID, number)
Its also pretty simple to use, while in the world map use the altRun key to open and close the inventory, you navigate through the menu using left and right, and use the jump button to select an item, in the world map a select player menu might open when you want to add a powerup.

Last edited by Lusho on Tue Apr 28, 2020 12:47 pm, edited 2 times in total.
|
|
|
|
|
|
|
|
|
-
Eri7
- Banned
- Posts: 1770
- Joined: Sat Jan 28, 2017 4:48 pm
- Flair: Good Foundation allows for strong Execution
-
Contact:
Postby Eri7 » Tue Apr 28, 2020 11:56 am
Wow this is awesome, I'm also impressed you managed to add the P-wing.
|
|
|
|
|
|
|
|
|
-
Lusho
- Blooper

- Posts: 163
- Joined: Wed Dec 25, 2019 11:39 pm
- Flair: Intention is what matters
- Pronouns: he/him
Postby Lusho » Tue Apr 28, 2020 12:08 pm
Oh geez i found an error in the code let me update it quickly.
|
|
|
|
|
|
|
|
|
-
DrMekar
- Eerie

- Posts: 781
- Joined: Sat Apr 08, 2017 7:16 am
- Flair: CUSTOM CHARACTER CREATOR
-
Contact:
Postby DrMekar » Tue Apr 28, 2020 3:39 pm
This is really cool, though what is the diffrence between this Codes?
Code: Select all -- The item order is: Mushroom, FireFlower, Leaf, Tanooki, Hammer, IceFlower, Starman, PWing. Going from 0 to 7
-- This function adds Items to the inventory, select which item you want to add and the amount --
inventory.addPowerUp(itemID, amount)
-- This one sets the amount of Items that you have, select which item do you want to set and the number --
inventory.setPowerUp(itemID, number)
From my understanding, both add items to the players Inventory.
|
|
|
|
|
|
|
|
|
-
Emral
- Cute Yoshi Egg

- Posts: 9865
- Joined: Mon Jan 20, 2014 12:58 pm
- Flair: Phoenix
Postby Emral » Tue Apr 28, 2020 3:42 pm
DrMekar wrote: ↑Tue Apr 28, 2020 3:39 pm
This is really cool, though what is the diffrence between this Codes?
From my understanding, both add items to the players Inventory.
Add:
itemCount = itemCount + n
Set:
itemCount = n
|
|
|
|
|
|
|
|
|
-
Wowsie
- Bot

- Posts: 54
- Joined: Thu Oct 17, 2019 6:14 am
- Flair: Something
- Pronouns: he/him
-
Contact:
Postby Wowsie » Wed Feb 24, 2021 3:37 am
When getting starman, Mario dosen't became invincible in the start of the level, please fix this
Added in 43 minutes 59 seconds:
oops, this also need to be loaded in luna.lua episode script
|
|
|
|
|
|
|
|
|
-
ShadowLabrys101
- Swooper

- Posts: 73
- Joined: Thu Jan 09, 2014 3:14 pm
Postby ShadowLabrys101 » Wed Feb 24, 2021 3:20 pm
How can implement this code so that you can make Toad Houses that give you items for your inventory?
|
|
|
|
|
|
|
|
|
-
Murphmario
- 2025 Egg Hunter

- Posts: 2389
- Joined: Fri Dec 20, 2013 7:07 pm
- Pronouns: he/him
Postby Murphmario » Fri Jul 09, 2021 1:45 am
How hard would it be to get this to work with MrDoubleA's SMWmap?
|
|
|
|
|
|
|
|
|
-
Marioman2007
- 2025 Egg Hunter

- Posts: 530
- Joined: Tue Aug 25, 2020 3:19 am
- Flair: Dr. Bones
- Pronouns: He/Him
Postby Marioman2007 » Fri Jul 09, 2021 3:34 am
Murphmario wrote: ↑Fri Jul 09, 2021 1:45 am
How hard would it be to get this to work with MrDoubleA's SMWmap?
MrDoubleA told me to not to use this code, because Lusho is going to update it.
|
|
|
|
|
|
|
|
|
-
Lusho
- Blooper

- Posts: 163
- Joined: Wed Dec 25, 2019 11:39 pm
- Flair: Intention is what matters
- Pronouns: he/him
Postby Lusho » Tue Jul 13, 2021 9:46 pm
Yeah, I have been planning to do this for a while, in fact I did a bit of it, but I haven't advanced enough on it, and i'm not sure on how long it will take until I actually get to finish it
|
|
|
|
|
|
|
|
|
-
JordanTRS
- Cheep-Cheep

- Posts: 13
- Joined: Sat Apr 01, 2017 12:53 pm
- Pronouns: he/him
-
Contact:
Postby JordanTRS » Thu Sep 16, 2021 8:33 pm
ShadowLabrys101 wrote: ↑Wed Feb 24, 2021 3:20 pm
How can implement this code so that you can make Toad Houses that give you items for your inventory?
I second this. It would be really useful to have this, as my own episode requires it too. Only problem is I want mine to be random, but only have a select few powerups you can get from each toad house (for example, world 1 will only have mushrooms, fire flowers, and leafs while world 6 has hammer suits and some others)
|
|
|
|
|
|
|
|
|
-
Marioman2007
- 2025 Egg Hunter

- Posts: 530
- Joined: Tue Aug 25, 2020 3:19 am
- Flair: Dr. Bones
- Pronouns: He/Him
Postby Marioman2007 » Fri Sep 17, 2021 12:47 am
JordanTRS wrote: ↑Thu Sep 16, 2021 8:33 pm
ShadowLabrys101 wrote: ↑Wed Feb 24, 2021 3:20 pm
How can implement this code so that you can make Toad Houses that give you items for your inventory?
I second this. It would be really useful to have this, as my own episode requires it too. Only problem is I want mine to be random, but only have a select few powerups you can get from each toad house (for example, world 1 will only have mushrooms, fire flowers, and leafs while world 6 has hammer suits and some others)
Code: Select all function onEvent(eventName)
if eventName == "yourEventNameHere"
inventory.addPowerUp(itemID, amount)
end
end
|
|
|
|
|
|
|
|
|
-
ChunkyChimp
- Spiny

- Posts: 26
- Joined: Tue Sep 01, 2020 9:02 pm
- Flair: I TAKE GFX FOR MY OWN LEVELS
Postby ChunkyChimp » Tue Sep 21, 2021 8:57 pm
I see there is the PWING as an inventory item option. How do you actually get this?
|
|
|
|
|
|
|
|
|
-
MrCool422
- Fighter Fly

- Posts: 35
- Joined: Sun Jan 24, 2021 12:26 am
- Flair: Autistic
- Pronouns: He/Him
-
Contact:
Postby MrCool422 » Fri Nov 19, 2021 10:31 pm
how come i've got an error

i've got the lua code right
|
|
|
|
|
|
|
|
|
-
Marioman2007
- 2025 Egg Hunter

- Posts: 530
- Joined: Tue Aug 25, 2020 3:19 am
- Flair: Dr. Bones
- Pronouns: He/Him
Postby Marioman2007 » Sat Nov 20, 2021 7:54 am
MrCool422 wrote: ↑Fri Nov 19, 2021 10:31 pm
how come i've got an error

i've got the lua code right
Can you share the code??
|
|
|
|
|
|
|
|
|
-
MrCool422
- Fighter Fly

- Posts: 35
- Joined: Sun Jan 24, 2021 12:26 am
- Flair: Autistic
- Pronouns: He/Him
-
Contact:
Postby MrCool422 » Thu Nov 25, 2021 4:58 pm
marioman2007 wrote: ↑Sat Nov 20, 2021 7:54 am
MrCool422 wrote: ↑Fri Nov 19, 2021 10:31 pm
how come i've got an error

i've got the lua code right
Can you share the code??
I've just put in this: local inventory = require("customInventory")
What i did wrong?
|
|
|
|
|
|
|
|
|
-
RadMetalMarioSMIX
- Swooper

- Posts: 65
- Joined: Sat Mar 14, 2015 6:42 pm
- Flair: What kind of grave is this?
- Pronouns: he/him
Postby RadMetalMarioSMIX » Mon Apr 25, 2022 1:36 pm
Can this Inventory support custom power-ups?
|
|
|
|
|
|
|
|
|
-
Danat Nukem
- Bob-Omb

- Posts: 22
- Joined: Tue Aug 04, 2020 6:32 am
Postby Danat Nukem » Wed Apr 27, 2022 10:51 am
RadMetalMarioSMIX wrote: ↑Mon Apr 25, 2022 1:36 pm
Can this Inventory support custom power-ups?
Thats pretty good question, i wanna know about this too.
|
|
|
|
|
|
|
|
|
-
Mal8rk
- Snifit

- Posts: 216
- Joined: Mon Oct 25, 2021 11:04 pm
- Flair: English Speaking Spanish Speaker
- Pronouns: He/Him
-
Contact:
Postby Mal8rk » Wed Apr 27, 2022 10:56 am
RadMetalMarioSMIX wrote: ↑Mon Apr 25, 2022 1:36 pm
Can this Inventory support custom power-ups?
It could theoretically support custom power-ups, but you will have to add a new icon for the power-up you want to add, and then make it so that the code registers the power-up
This is what I think will work
|
|
|
|
|
|
|
|
|
-
LawrenceindaSky
- Shy Guy

- Posts: 5
- Joined: Sat Jul 25, 2015 8:37 pm
Postby LawrenceindaSky » Thu Apr 28, 2022 1:26 am
I am super new still to Lua related stuff on SMBX2, how would I call the script? I've tried to 'Edit raw user data' and tried putting adding the item but I am certain I need something like "if interacted = do this" but I am unsure how it all works out.
Thank you so much in advance!
|
|
|
|
|
Return to “LunaLua”
Users browsing this forum: No registered users and 1 guest
|