Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • Tutorials »
  • Need to know how to make a bank for my game
« previous next »
  • Print
Pages: [1]

Author Topic: Need to know how to make a bank for my game  (Read 4862 times)

Offline Sock Monkey King

  • Initiate
  • *
  • Posts: 1
Need to know how to make a bank for my game
« 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).
Logged

Offline Prpl_Mage

  • Administrator
  • Sage
  • *
  • Posts: 7,645
  • The Administrator Mage
    • Check out our itch website
Re: Need to know how to make a bank for my game
« Reply #1 on: March 20, 2010, 04:40:48 PM »
I posted this as an answer some time back:

Quote from: Prpl_Mage on February 04, 2010, 11:11:38 PM
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.
Logged
Cool RPGM Project!
Sprite till you die

Oh my god, this was ...10 years ago...

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • Tutorials »
  • Need to know how to make a bank for my game
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum