Page 1 of 2
ShopSystem.lua [v1.1] - in Episode/Level purchases!
Posted: Tue Mar 22, 2022 1:58 am
by Marioman2007
A basic shop library on which I've been working on for a while!
This script is based on
anothercurrency.lua
GIF:
Credits:
Me
Enjl
Special thanks:
Rednaxela - for helping me to add support for multiple shops
Enjl - for providing lots of useful feedback
Notes:
It is preferable to use
anothercurrency.lua for your currencies, variable-based currencies are tedious to use in this shop system.
Documentation:
https://docs.google.com/document/d/1qJR ... sp=sharing
Download:
https://drive.google.com/file/d/1dR1Z3x ... sp=sharing
Enjoy and please give credits!
Re: ShopSystem.lua [v1] - in Episode/Level purchases!
Posted: Tue Mar 22, 2022 2:04 am
by MegaDood
This is an amazing script! I'm glad to see it released.
Re: ShopSystem.lua [v1] - in Episode/Level purchases!
Posted: Tue Mar 22, 2022 4:58 am
by georgespezi12
An excellent thing about the shopsystem is that the music can be chosen for the shop itself to suit the theme of the episode!
Re: ShopSystem.lua [v1] - in Episode/Level purchases!
Posted: Tue Mar 22, 2022 9:02 am
by Mal8rk
You have no idea how long I wanted an actually woking shop system
Thanks
Re: ShopSystem.lua [v1] - in Episode/Level purchases!
Posted: Tue Mar 22, 2022 11:42 am
by AirShip
Incredible work! I will definitely use it in my next projects!
Re: ShopSystem.lua [v1] - in Episode/Level purchases!
Posted: Tue Mar 29, 2022 4:23 pm
by Bboyfergie
Thank you for this! It's super useful! How would I go about making a separate shop that only uses Dragon Coins?
Re: ShopSystem.lua [v1] - in Episode/Level purchases!
Posted: Tue Apr 05, 2022 1:40 pm
by Luna
read the title and hoped i could finally add microtransactions to my episodes : (
Cool Script!
Re: ShopSystem.lua [v1] - in Episode/Level purchases!
Posted: Wed Apr 06, 2022 9:48 am
by Marioman2007
Thanks everyone for the positive comments!!
Bboyfergie wrote: ↑Tue Mar 29, 2022 4:23 pm
Thank you for this! It's super useful! How would I go about making a separate shop that only uses Dragon Coins?
You can use
anothercurrency.lua to create a currency for dragon coins and then use that currency for that shop.
Re: ShopSystem.lua [v1] - in Episode/Level purchases!
Posted: Wed Apr 13, 2022 7:39 pm
by Mal8rk
Hey there
So this might be more of a thing with anothercurrency.lua, but whenever I use the shop in a level, there are two numbers in the top left that say either 0 or nil.
Is there a way to disable them?
Re: ShopSystem.lua [v1] - in Episode/Level purchases!
Posted: Wed Apr 13, 2022 10:11 pm
by Marioman2007
POPME wrote: ↑Wed Apr 13, 2022 7:39 pm
Hey there
So this might be more of a thing with
anothercurrency.lua, but whenever I use the shop in a level, there are two numbers in the top left that say either 0 or nil.
Is there a way to disable them?
The test level's luna.lua file is full of examples
Those two are examples for variable currencies
You can look for "Text.print" and remove the lines that have them.
Re: ShopSystem.lua [v1] - in Episode/Level purchases!
Posted: Thu Apr 28, 2022 10:55 pm
by Brian
Hello, first of all this script is just amazing.
I was just wondering, on the world map, the coins always stay at 0, while in the rest of my levels, the counter is correct. Is there any way to change the value of the coins for the world map?
Re: ShopSystem.lua [v1] - in Episode/Level purchases!
Posted: Mon May 02, 2022 4:37 am
by Marioman2007
Brian wrote: ↑Thu Apr 28, 2022 10:55 pm
Hello, first of all this script is just amazing.
I was just wondering, on the world map, the coins always stay at 0, while in the rest of my levels, the counter is correct. Is there any way to change the value of the coins for the world map?
create a file called "map.lua" and put this code inside it:
Code: Select all
local HUDOverride = require("hudoverride")
local anothercurrency = require("anothercurrency")
HUDOverride.overworld.offsets.coins.value.y = -500
local coins = anothercurrency.registerCurrency("coins", true)
coins:registerLimit(9999, function() end)
local coinsY = 90
local coinsX = 190
function onDraw()
Text.printWP(coins:getMoney(), 1, coinsX, coinsY, 5)
end
Re: ShopSystem.lua [v1.1] - in Episode/Level purchases!
Posted: Thu May 19, 2022 4:26 am
by Marioman2007
Version 1.1 is out!
- Fixed the item drawing system
- added a new argument to registerItem that allows to change the color of the egg
Re: ShopSystem.lua [v1.1] - in Episode/Level purchases!
Posted: Mon Jun 13, 2022 3:22 pm
by Coldcolor
i wonder if I can make this compatible with my Bowsers Fury Inventory library...
Re: ShopSystem.lua [v1.1] - in Episode/Level purchases!
Posted: Mon Jun 13, 2022 4:55 pm
by Ness-Wednesday
Such emotional poetry...
"a"
"b"
"c"
"gfhfghjfgkjghjkhvbgkjghkghjghjgcfydsrtawerftaewsygdrefuyhreuyraetgdrfyhdfjuyfcikjfiuypfuipluikhujkfgyujdt7yusrtesdtfgdsreyhftjuyo8uy9i56d7y43es5r3awr4eswfdxbvgmhj,iuj;89p7yg8uid4e52357569i7689itgjnhfcgbs5437r5ujgyhkhvgjdfgaew36547"
Jokes aside, this is a great API. I'm really excited to see how people use it
Re: ShopSystem.lua [v1.1] - in Episode/Level purchases!
Posted: Tue Jun 14, 2022 3:38 am
by Marioman2007
Coldcolor900 wrote: ↑Mon Jun 13, 2022 3:22 pm
i wonder if I can make this compatible with my Bowsers Fury Inventory library...
If you have a function to add items to the inventory, it will be pretty easy.
Re: ShopSystem.lua [v1.1] - in Episode/Level purchases!
Posted: Fri Jul 29, 2022 7:19 pm
by KurttheKing
It doesn't seem to be working for me. Any ideas why?
Error I got from the Test Level
Edit: it's because "
anothercurrency.lua" isn't in the Folder. It works now and...yeah it's incredible

Re: ShopSystem.lua [v1] - in Episode/Level purchases!
Posted: Wed Jan 04, 2023 3:22 pm
by Mal8rk
Added in 1 minute 17 seconds:
Marioman2007 wrote: ↑Mon May 02, 2022 4:37 am
Brian wrote: ↑Thu Apr 28, 2022 10:55 pm
Hello, first of all this script is just amazing.
I was just wondering, on the world map, the coins always stay at 0, while in the rest of my levels, the counter is correct. Is there any way to change the value of the coins for the world map?
create a file called "map.lua" and put this code inside it:
Code: Select all
local HUDOverride = require("hudoverride")
local anothercurrency = require("anothercurrency")
HUDOverride.overworld.offsets.coins.value.y = -500
local coins = anothercurrency.registerCurrency("coins", true)
coins:registerLimit(9999, function() end)
local coinsY = 90
local coinsX = 190
function onDraw()
Text.printWP(coins:getMoney(), 1, coinsX, coinsY, 5)
end
It doesn't seem to work on smwMap though. The counter always stays at 0
Re: ShopSystem.lua [v1.1] - in Episode/Level purchases!
Posted: Fri Jan 06, 2023 10:23 pm
by Marioman2007
Mal8rk wrote: ↑Wed Jan 04, 2023 3:24 pm
It doesn't seem to work on smwMap though. The counter always stays at 0
Yeah, smwMap is level based, what you can do is:
EDIT (2-Feb-23): I just realized that there was an issue with this code, its fixed now.
Code: Select all
local smwMap = require("smwMap")
local function getCoins()
return coinCounter:getMoney()
end
function onTick()
if Level.filename() == smwMap.levelFilename then
smwMap.hudCounters[2].getValue = getCoins
end
end
Re: ShopSystem.lua [v1.1] - in Episode/Level purchases!
Posted: Fri Jul 04, 2025 3:01 pm
by Paka_Mzuri
How can I get multiple currencies to show up in the shop? It's shows one of them, but none of the others. I would also like each currency to have its own icon, but i couldn't figure that out either.