Page 2 of 2

Re: SMBX Custom Inventory System (1.0)

Posted: Thu Apr 28, 2022 5:07 am
by deice
LawrenceindaSky wrote:
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!
as the original post details, create two files inside your episode folder called "map.lua" and "luna.lua". open them inside a text editor and add

Code: Select all

local inventory = require("customInventory")
at the top of each file. the main post then also outlines how to add and set items. if you're unsure about where inside the code you'd put those calls, i recommend reading this, this and (albeit a slightly outdated source) this.

Re: SMBX Custom Inventory System (1.0)

Posted: Thu Apr 28, 2022 12:07 pm
by RadMetalMarioSMIX
LawrenceindaSky wrote:
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!
Inside your main episode folder put this above everything else in the Luna.lua:

Code: Select all

 local inventory = require("customInventory")
Added in 2 minutes 2 seconds:
deice wrote:
Thu Apr 28, 2022 5:07 am
LawrenceindaSky wrote:
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!
as the original post details, create two files inside your episode folder called "map.lua" and "luna.lua". open them inside a text editor and add

Code: Select all

local inventory = require("customInventory")
at the top of each file. the main post then also outlines how to add and set items. if you're unsure about where inside the code you'd put those calls, i recommend reading this, this and (albeit a slightly outdated source) this.
Actually listen to this dude he explains it better. Also, thanks for xmap dude, makes creating my episodes easier!