Notice: fwrite(): Write of 38 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 59 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 1714 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 8192 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Print Page - Bank system

The RPG Maker Resource Kit

Other Game Creation => Game Creation General Chat => Topic started by: mikerz119 on December 14, 2005, 06:18:21 AM

Title: Bank system
Post by: mikerz119 on December 14, 2005, 06:18:21 AM
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...
Title: Bank system
Post by: haloOfTheSun on December 14, 2005, 07:32:44 AM
<>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
<>
Title: Bank system
Post by: Captain Callahan on December 14, 2005, 10:28:26 PM
What exactl;y does it do really, i want to know? like money back?
Title: Bank system
Post by: Zeriab on December 14, 2005, 11:29:24 PM
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?
Title: Bank system
Post by: mikerz119 on December 16, 2005, 04:35:04 AM
Which Event command is the Branch in RM2k? I Can't find it...
Title: Bank system
Post by: haloOfTheSun on December 16, 2005, 05:17:19 AM
Fork Condition, 3rd Event Page, Right Column
Title: Bank system
Post by: dracohaze on December 16, 2005, 11:51:49 AM
So, what your saying is, that you get interest? Cool dude!
Title: Bank system
Post by: NeoPuma on December 18, 2005, 10:56:32 AM
I am a total newbie to this. Where would I put this script? I am using RPG Maker XP (Postality Knights Edition)
Title: Bank system
Post by: The Moogle on December 18, 2005, 06:51:57 PM
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.
Title: Bank system
Post by: NeoPuma on December 18, 2005, 08:02:08 PM
ah... ah well... thanks n e way
Title: Bank system
Post by: haloOfTheSun on December 19, 2005, 10:03:30 PM
Yes, it's meant to be used as a common event in rm2k or 2k3.
Title: Bank system
Post by: mikerz119 on December 22, 2005, 03:13:21 AM
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.