SMILE GAME BUILDER

SMILE GAME BUILDER

Not enough ratings
Creating a bank
By Guilion
Just a simple system to make a bank
   
Award
Favorite
Favorited
Unfavorite
Introduction and limits
SGB by default has no NPC that can act as a bank, however there is a way to do it manually.
This guide will touch on how you can make a bank where you can deposit, withdraw and check your balance. You can only make characters interact with the bank in static numbers (E.G. deposit 50 gold, deposit 100 gold, etc) The reason for this is because Smile doesn't allow for open inputs, therefore this is the best you can do without involving other NPC's or systems (E.G. buying something in a convinience store adds 2 gold into your bank Balance).

All you need to start this is to add an NPC with an advanced event, this is simple enough and can be done by going to the events tab, selecting an NPC that starts a discussion and selecting convert into advanced event.

You will be given a warning, just select ok and you're set.
Now you can create your bank for starters you'll need an event that creates a display on what the player wants to do, deposit money, withdraw or check their balance, this is done by clicking the "+" button and going to the tab with the branches in dialogue, from here just make the options, for the rest please check each section.
Making a deposit
In order to make a deposit you will need to make use of three events, one to check if the player actually has the money needed, one to withdraw money the player is holding and one to add money to the bank.

First add the check to add money, this should be in the same section as the one used to display selections

































Then once selected add the minimal amount of coins people can deposit and add another display selection event with the amounts player can deposit. It should look like this:


Now you want to fill those deposit events to be filled, first you want to take money away from the player, in order to do this all you need to do is set it to the amount of gold the player wants to deposit, like this:




















And second you need to add that money to the bank and in order to do this you need to use a variable; all you need to do is go to events and go to the tab that looks like an open box, here you can select the variable box and pick add the same value to the variable that you have extracted from the player, like this:























Do the same for all other deposit options and you are pretty much done, all is left is to add some dialogue and system messages if you want to do some debugging. All in all this segment should look somewhat similar to this:
Making a withdrawal
Withdrawals work in a similar way to deposits but using the bank variable instead of the cash the player has.
First you start by making sure the player has the minimal amount required for an account










Then all you need to do is make the player select the amount of money they want and based on that substract that amount from the bank account and give it to the player. Keep in mind to add an extra check to verify if the player actually has enough cash for amounts bigger than the minimum required.
Overall this module should look like this:
Checking the account's balance
This is by far the easiest module, just add a system message that displays the variable working as a bank using the number of the variable as seen below:
Things that are possible but not included on this guide:
This part only includes things that I've half-tested but am honestly too lazy to refine and include in this guide:

Have your bank account charge you money or add money with time
It's rather well known it's possible to add a date system to your games using a huge workaround (You can check other guides, there's already a tutorial on how to do this) you can add a small line that substracts or adds money from your account at the end of each month/week/day/whatever on said workaround.

Points system
Have you ever had a stupid credit card that gives you points that then turn into cash for buying from certain department stores? You can totally do that but you will require a huge workaround using advanced variables because there is no check for how much the player has spent:

  • First when starting a conversation with a shopkeeper assign all the player's cash to an advanced variable
  • Second when the player is done trading assign a new variable with the cash that the player has left on him
  • Third, take the first variable and substract the second variable, now all the first variable has is the amount of cash the player has spent on the store.
  • Finally: store this value into a new variable, after this variable hits a certain amount of points make it reset and add a proportionate amount to the player's bank account

Loans (With fixed non-percent interest)
This one also requires the usage of the date system, it's fairly straightforward, have the players take a loan with an npc, add a check to see if the player has a bank account with money on it and lock him from his bank account until he pays his loan, then at the end of each month/Week/day/whatever add a small amount of cash to the loan in set numbers (e.g. 50 gold coins). Bear in mind players can only pay their loans the same way they operate their bank accounts, so try not to make them impossible to pay off by making them percent based.

Have the amount of your bank increase according to inflation
If you want to make a poverty/supply shortage simulator then this is by far the most complicated but I believe it's doable (Albeit if you do it everyone will think you are an insane person for not using another program to do it). Okay, so:

  • First thing you'll need is checks on every store and checks on basic objects such as bread, meat, milk, eggs and raw materials (iron, copper, etc.). You will need to make several copies of these prices in order to allow stores to adjust their prices. I am not entirely sure what's the game's limit on how many items can be in the database but I'm willing to bet it's 999, so try not to go above that. Also you will need to make the system load istores for individual items so I recommend you do this in some place where players are expected to buy single items like supermarkets.
  • Second: you need to add all these variables into a new variable called inflation at the end of each day using the date and time system.
  • Third: you'll need to use the individual variables of each item and compare it to certain theresholds in order to make the stores refresh their prices for items (E.g. is the amount of eggs sold more than 5? Yes. More than 7? Yes. More than 9? No. THEN eggs are now worth 17 dollars)
  • Fourth: Now you need the date and time system (Again) make it so at the end of each month/Week/whatever the inflation variable is divided by a set number (E.G. inflation/10) then take the bank account variable and assign the same value of it to a new variable called rate, have this rate be multiplied by the inflation variable and then add the result of this to the bank account. Make sure to add a check in case the inflation is 0 to avoid an impossible division and crash the game.
  • Fifth: Finally, just adjust your inflation rate, make use of the date and time system (Again) so every set amount of time the inflation for items reset (E.g. every 3 days substract 1 from the eggs variable counter). This way inflation will reset to 0 eventually.

Aaaaaaand that's it, I have no ideas for other systems, have fun adding capitalism to your games