Main Menu
  • Welcome to The RPG Maker Resource Kit.

Bank system

Started by mikerz119, December 14, 2005, 06:18:21 AM

0 Members and 1 Guest are viewing this topic.

mikerz119

I need the code to a good bank system for RPG maker 2000. It used to be on a site that directed me here. No luck now. Any help is appreciated...

haloOfTheSun

<>Branch: If Timer 1 is 0M 00S Less/Equal
<> Timer 1 Operation: Set 20M 00S
<> Timer 1 Operation: Start
<> Play SE (Whatever)
<>Variable Operation: [0001] Bank Interest Set, Var. 0004's Value
<> Variable Operation: [0001] Bank Interest: /, 10
<> Variable Operation: [0002] Savings Account + Var. 0001's Value
<>
End
<>

This will add 10% interest evey 20 minutes in your savings account after you have opened one. Now, for the actual bank or ATM or whatever, here is the code:
PAGE 1:
<> Message: Would you like to open a savings account?
<> Show Choices: Yes/No
: [Yes Handler]
<> Branch: If Money is 0 Less/Equal
<> Message: You don't have any money!
<>
Else Handler
<> Message: How much do you wish to deposit?
<> Input Number, 6 Digit, [0004] Savings Add]
<> Var. Operation: [0003] Money, Set Money
<> Branch: If [0003] Money, is [0004], Less
<> Message: You don't have that much money!
<>
Else Handler
<> Var. Operation: [0003] Money - Var. [0004]'s Value
<> Var. Operation: [0002] Savings Account + Var. [0004]'s Value
<> Change Money: V[0004] Remove
<> Message: Every 20 minutes, your account will gain 10% interest.
<> Switch Operation: 0001 Bank Account ON
<>
End
<>
End
[No] Handler
<>
End
<>

The switch you turned on should be the same switch as the Trigger Switch in the common event.

PAGE 2 (Preconditions: Switch 0001 ON)
<> Message: Do you wish to deposit or withdraw?
<> Show choices: Deposit, Withdraw, Cancel
[Deposit] Handler
Branch: If Money is 0 Less/Equal
<> Message: You don't have any money!
<>
Else Handler
<> Message: You have
V\[2]
In your account.
<> Message: How much do you wish to deposit?

From here, just copy and paste from the previous page. To do the withdraw:

[Withdraw] Handler:
<> Message: You have
\V[2]
in your account.
<> Message: How much do you with to withdraw?
<> Input Number: 6 Digit, [0004] Savings Add
Branch: If Var. [0002] Savings Account, is V[0004], Less
<> Message: You don't have that much in your account!
<>
Else Handler
<> Var. Operation: Var. [0002] Savings Account, - V[0004]'s Value
<> Change Money: Var. [0004] ADD
<>
End
[Cancel] Handler
<>
End
<>
:tinysmile:

Captain Callahan

What exactl;y does it do really, i want to know? like money back?
"Always remember the best form of revenge is to better yourself." -ZV

Zeriab

Here's an example:
Let's say I go over to this bank guy.
I have before doing anything exactly 1000.

I talk to the bank guy and select yes as I want to open an account.
I deposit 1000, which leaves me with 0.
I leave.

1000 in bank.
0 on me.

57 minutes later:

(1000*1.1)*1.1 = 1210 in the bank now (20 minutes have gone twice)
How did I get 1210?
First I had 1000.
- 20 minutes later -
Savings in bank becomes 1000 + 100 = 1100
- 20 minutes later -
Savings in bank becomes 1100 + 110 = 1210

I come back and have earned 990 in the mean time and now I want to deposit some more of my money.
Again I talk to the bank guy, select deposit and deposits 790. That leaves:

1210 + 790 = 2000 to the bank
990 - 790 = 200 to me

If I now wait 3 minutes I can withdraw up to 2200 totalling the money on me to 2400.

This happens because the timer once again becomes 0m 00s and the present money in the bank becomes 2000 + 200 = 2200.

So after 60 minutes (if I haven't withdrawn anything):

2200 on the bank
200 on me.



Do you understand what this does now or do you want a description of the event itself?

mikerz119

Which Event command is the Branch in RM2k? I Can't find it...

haloOfTheSun

Fork Condition, 3rd Event Page, Right Column
:tinysmile:

dracohaze

So, what your saying is, that you get interest? Cool dude!

NeoPuma

I am a total newbie to this. Where would I put this script? I am using RPG Maker XP (Postality Knights Edition)

The Moogle

XD
you are a newb....

This isn't a script, just use it everytime you would use the bank in rm2k(3). or you could make it a common event and call it every time a char talks to the banker.



Unless I say so, I'm using RPG Maker XP.

NeoPuma

ah... ah well... thanks n e way

haloOfTheSun

Yes, it's meant to be used as a common event in rm2k or 2k3.
:tinysmile:

mikerz119

Thanks to everyone who helped me. I learned alot from this example. I'm going to be posting the starting of my game right now in a new topic. If anyone would like to contribute in any way or make it a group project, get in touch with me. You can reach me the fastest on AIM: mikerz11988 is my sn.