Charas-Project

Game Creation => Requests => Tutorials => Topic started by: Sock Monkey King on March 19, 2010, 06:58:11 PM

Title: Need to know how to make a bank for my game
Post by: Sock Monkey King on March 19, 2010, 06:58:11 PM
Any one know how to make a banking event? I need one for my game Puzzleland(TM).
Title: Re: Need to know how to make a bank for my game
Post by: Prpl_Mage on March 20, 2010, 04:40:48 PM
I posted this as an answer some time back:

Make the player talk to a certian NPC. It will ask if you want to deposit or withdraw.
In the deposit part you'll make one of them "Input numbers" events, store the value in a certain varaible(i'll call it "[DEposit]".
Now set a variable equal to your amount of gold(it's a choice near the bottom)
Check if the value of "[DEposit]" is larger than the ammount of gold you carry.
If it is: tell the player that they are a bunch of leeches that are trying to cheat.
If it is not: add the value of [DEposit] to another variable called "[StoredCA$H]"
And then remove gold equal to the amount of [DEposit].
--------- With this we let the player input a number of the ammount he want to deposit. Then we check if the player actually have that much. If he does then the value is added to the "bank variable" [StoredCA$H"] and at the same time we remove the same amount from the player's pocket.

Now, the withdraw. (it's basically the same thing but in reverse)
The player have a input numbers again to chose how much he want to withdraw. (store it in a variable(you can even use the same as for deposting))
Check if the value the player inserted is higher than the amount of gold stored in "[StoredCA$H]"
If it is higher: Tell them to bugger off.
If it is lower: remove the value of the input on the "bank variable" and then increase gold by the same value.