This template and tutorial allows you to build your own Currency Counter System in GB Studio for Buying and Selling in game.
The main feature of this template is the Currency Counter on the upper right of the in game screen. The sample shop, buying and selling feature and +1 coin feature (from interacting with the coin) are all extra stuff for you to get the entire feel of this system.
Show full description...
Below are downloadable files that contain the Currency Counter template.
(Made in GB Studio 3.1 but a migrated file to 4.1.3 is now available!)
_____________________________________________________________________
WARNING: THE NUMBER OF EVENTS IN THIS SYSTEM ARE A LOT. IT TOOK ME A LONG TIME TO MAKE IT WORK SMOOTHLY. ESPECIALLY SINCE I COULDN'T MAKE A MODULUS FORMULA WORK FOR A 3 DIGIT COUNTER. THE FORMULA FOR 0-99 IS EASY BECAUSE THERE ARE TEMPLATES FOUND ONLINE BUT 3 DIGITS IS A WHOLE OTHER LEVEL IF YOU CAN'T FIGURE OUT A FORMULA.
THEREFORE I MANUALLY CREATED EVENTS FOR THE 3RD DIGITS WHICH STARTED FROM 100 - 999. SO I SUGGEST YOU START YOUR PROJECT WITH THIS TEMPLATE FIRST THEN WORK FROM THERE.
_____________________________________________________________________
Before you begin using this template I would like to give you a few reminders.
1. I highly recommend for you to start your project with this template first then build your game from then on. Because the script 'Player Coin Counter' resets whenever you copy the Event onto another project. Therefore a very tedious process switching all animation states of all digits. (You'll understand once you see the script). You may also just duplicate the sample mart I made and just change the background, the Currency Counter wont be affected. *It is only when you copy the digits actors onto another scene or project messes the animation states up.
2. I made all variables far down the list between Variables 118-125 so it won't affect any of your variables that are near the numbers 1-10 if you do copy the scenes in this template to your projects.
3. Make sure you place the 'Player Coin Counter' Event on "Init" scene, on actor and/or trigger if you want it to update properly as you interact with everything in scene, also - depending on what you want to achieve.
You can't place too many in one list though because the build won't run properly since the currency counter has a lot of topdown events inside.
4. I have tested using the increment variable by 1 adding +1 (coin) to the Currency Counting System from 1-999 and was successful. Also tested going beyond 999 and going below 0 and it's all good.
5. Make sure your animation states for the numbers sprites are adjusted if you do choose to transfer this template to another project. (*The number digits are behind the coin banner if you are wondering where they are during gameworld mode)
(November 12, 2023 Update)
I made the counters appear simultaneously on each 0.1 tick after every interaction.
By supporting what I do, it encourages me to do more!
Thanks for dropping by!
Special Thanks to:
Jan Schneider of Murder Mansion (Assets used for Sample Mart)