- Joined
- May 6, 2017
- Messages
- 270
- Reaction score
- 117
- First Language
- Italian
- Primarily Uses
- RMMV
Tutorial topic: how to let the player have a variable amount of money at their disposal
Brief description
Brief description
Even if I'm not into tutorials about something an extension/studying documentation could do just fine, I've recieved an offer for doing this, so… here comes nothing. Check this tutorial if you'd like to let your player's action influence their amount of money.
Template used for this tutorial: Sample Scripted-based UI, 720 x 1280 (my patron wants to develop a mobile game)
Requirements
- Having read the Beginner's Guide. I can't help you either otherwise.
Tutorial body
- Giving the player an initial amount of money (not necessary)
- First, let's decide which kind of variable we should use for storing the current amount of money. It is obviously bound to be a number variable, and since we may need to use it at any point of the game it should also be global.
- Setting up your common events (in the database)
- Go to the Database's "Common Events" section and create three new records called "Show current money", "Change money amount" and "Hide current money"
- If you want to customize these common events at your heart's content, this is the good time to do it
- Please note that "Change money amount" ADDS Factor to Money, so if you want to make the player pay for something instead of getting paid, pass a negative number as parameter
- If for some reason the player's money amount goes under 0, the first common event automatically sets it to zero. Still, you should check if the player has enough money before letting them buy something anyway.
- Setting up your scene (in the scene editor)
Patron: @Valadilene