[TeaScript] Erwill Shop System

General discussion about Super Mario Bros. X.
erwill
Koopa
Koopa
Posts: 15
Joined: Tue Feb 08, 2022 4:39 pm

[TeaScript] Erwill Shop System

Postby erwill » Sun Jul 10, 2022 10:43 am

Erwill Shop System

Years ago, I created a shop system for SMBX 1.4.4. I might as well tell you this system has aged quite badly and looks stark today.
I decided to rewrite this script from scratch and make a better one, let's see what changed.

Image

I- All NPC available
Items id are NPCs id, it means you can set whatever you want in your shop, including improbable things.

II- More compatibility
Unlike the old one, the 2 players mode is compatible and it works with any character. (A restricted amount of items if available for Toad, Peach and Link however)

III- Easy customizable shop
The two first scripts are designed for the users, a few teascript knowledges are requiered, but I want to make it simple to change the settings.
The first script, "Settings", contains all of the shop settings:
npc files: show
val(npcidtexts) : The npc file used to display texts
val(npcidwindows) : The npc file used to display windows
val(npcidplayer) : The npc file used to display players
texts: show
str(mwelcome) : Message displayed when you're choosing to buy or leave.
str(mexit) : Message displayed when you're leaving.
str(mitems) : Message displayed when you're choosing an item.
str(currency) : Name of the currency
texts: show
val(soundselect) : Sound id played when you choose
val(soundback) : Sound id played when you return to the previous menus
val(soundconfirm) : Sound id played when you confirm your choice
val(sounddenial) : Sound id played when it refuses
val(soundbuy) : Sound id played when you buy something
val(soundmoney) : Sound id played during the countdown of the money
val(currency) : the currency used in the shop. 1 = Lifes+Coins ; 2 = Scores ; 3 = global variable
If you choose global variables, don't forget to write the name in the two functions getmoney() and setmoney() at the bottom of the script and remove the character ' so the line isn't a comment anymore.

Itemslist is the array where all the item is in, redim(0, itemslist, SIZE) will set how many items the shop will have, replace SIZE by the amount of items. To specify the items id, array(itemslist(PLACE))=NPCID, replace PLACE by the place among those available and NPCID by the npc id.

The second script, "database", has three databases:
itemdataprice : The price of each npc
itemdataname : The name displayed in the shop of each npc
itemzoom : It's used for graphics displaying when the item icon is zoomed or not, useful for big items

Download link

Return to “General”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest