The RPG Maker Resource Kit

RMRK RPG Maker Creation => General Tutorials and Eventing => RPG Maker General => Tutorials Database => Topic started by: Tsunokiette on June 22, 2005, 07:31:12 PM

Title: currency bank [now including a demo]
Post by: Tsunokiette on June 22, 2005, 07:31:12 PM
if this doesn't work, tell me and I'll fix it.
EDIT: I fixed the common event, the problems I fixed were-


when depsiting money, it didn't subtract it from your money at all

when withdrawling money, it didn't give you the money, and wouldn't show the actual amount of money you have


DEMO FOR THIS BANK CAN BE FOUND HERE-

http://www.geocities.com/tsunokiette/limit_break_tester.zip


this will teach you to make a bank for depositing money.

you can replace Gilda in the Variables and common event by whatever you call your currency.

create 4 variables-

[0001]:gilda held
[0002]:deposit
[0003]:bank
[0004]:withdrawl

then make a common event called "Money" with the following-
Code: [Select]

<>Variable: [0001:gilda held]= Money
<>Message: Balance: \c[3]\v[3]\c[0] Gilda
:               : Gilda on hand: \c[3]\v[1]\c[0]
<>Show Choices: Deposit, Withdrawl, Do Nothing
:   [Deposit] Handler
    <>Conditional Branch: Variable [0001:gilda held] == 0
        <>Message: You don't have any Gilda to deposit.
        <>
    :   Else Handler
        <>Show Choices: Fixed Amount, Custom
        :   [Fixed Amount] Handler
            <>Message: Deposit how much of \c[3]\v[1]\c[0] Gilda?
            <>Show Choices: 1000, 10000, 100000, All
            :   [1000] Handler
                <>Variable: [0002:deposit] = 1000
                <>Conditional Branch: Variable[0002:deposit]>Variable[0001:gilda held]
                    <>Message: Not enough Gilda on hand.
                    <>
                :   Else Handler
                    <>Message: You deposit \c[3]\v[2]\c[0] Gilda.
                    <>Variable: [0003:bank] += Variable [0002:deposit]
                    <>Change Money: - Variable [0002:deposit]
                    <>Variable: [0002:deposit]-= Variable [0002:deposit]
                    <>Message: You now have a balance of \c[3]\v[3]\c[0] Gilda.
                    <>
                :   End
                <>
            :   [10000] Handler
                <>Variable: [0002:deposit] += 10000
                <>Conditional Branch: Variable[0002:deposit]>Variable[0001:gilda held]
                    <>Message: Not enough Gilda on hand.
                    <>
                :   Else Handler
                    <>Message: You deposit \c[3]\v[2]\c[0] Gilda.
                    <>Variable: [0003:bank] += Variable [0002:deposit]
                    <>Change Money: - Variable [0002:deposit]
                    <>Variable: [0002:deposit]-= Variable [0002:deposit]
                    <>Message: You now have a balance of \c[3]\v[3]\c[0] Gilda.
                    <>
                :   End
                <>
            :   [100000] Handler
                <>Variable: [0002:deposit] += 100000
                <>Conditional Branch: Variable[0002:deposit]>Variable[0001:gilda held]
                    <>Message: Not enough Gilda on hand.
                    <>
                :   Else Handler
                    <>Message: You deposit \c[3]\v[2]\c[0] Gilda.
                    <>Variable: [0003:bank] += Variable [0002:deposit]
                    <>Change Money: - Variable [0002:deposit]
                    <>Variable: [0002:deposit]-= Variable [0002:deposit]
                    <>Message: You now have a balance of \c[3]\v[3]\c[0] Gilda.
                    <>
                :   End
                <>
            :   [All] Handler
                <>Variable: [0002:deposit] += Variable [0001:gilda held]
                <>Conditional Branch: Variable[0002:deposit]>Variable[0001:gilda held]
                    <>Message: Not enough Gilda on hand.
                    <>
                :   Else Handler
                    <>Message: You deposit \c[3]\v[2]\c[0] Gilda.
                    <>Variable: [0003:bank] += Variable [0002:deposit]
                    <>Change Money: - Variable [0002:deposit]
                    <>Variable: [0002:deposit]-= Variable [0002:deposit]
                    <>Message: You now have a balance of \c[3]\v[3]\c[0] Gilda.
                    <>
                :   End
                <>
            :   Cancel Handler
                <>
            :   End
            <>
      :     [Custom] Handler
            <>Message: Deposit how much of \c[3]\v[1]\c[0] Gilda?
            <>Input Number : [0002:deposit], 6 digits
            <>Conditional Branch: Variable[0002:deposit]>Variable[0001:gilda held]
                    <>Message: Not enough Gilda on hand.
                    <>
                :   Else Handler
                    <>Message: You deposit \c[3]\v[2]\c[0] Gilda.
                    <>Variable: [0003:bank] += Variable [0002:deposit]
                    <>Change Money: - Variable [0002:deposit]
                    <>Variable: [0002:deposit]-= Variable [0002:deposit]
                    <>Message: You now have a balance of \c[3]\v[3]\c[0] Gilda.
                    <>
                :   End
                <>
            :   Cancel Handler
                <>
            :   End
            <>
      :     End
      <>
: [Withdrawl] Handler
    <>Conditional Branch: Variable [0003:bank] == 0
        <>Message: You don't have any Gilda to withdrawl in the bank.
        <>
    :   Else Handler
        <>Show Choices: Fixed Amount, Custom
        :   [Fixed Amount] Handler
            <>Message: Withdrawl how much of \c[3]\v[3]\c[0] Gilda?
            <>Show Choices: 1000, 10000, 100000, All
            :   [1000] Handler
                <>Variable: [000r:withdrawl] = 1000
                <>Conditional Branch: Variable[000r:withdrawl] > Variable[0003:bank]
                    <>Message: Not enough Gilda in bank.
                    <>
                :   Else Handler
                    <>Message: You withdrawl \c[3]\v[4]\c[0] Gilda.
                    <>Variable: [0003:bank] -= Variable [0004:withdrawl]
                    <>Change Money: + Variable [0004:withdrawl]
                    <>Variable: [0004:withdrawl]-= Variable [000r:withdrawl]
                    <>Variable: [0001:gilda held]= Money                    
                    <>Message: You now have \c[3]\v[1]\c[0] Gilda on hand.
                    <>
                :   End
                <>
            :   [10000] Handler
                <>Variable: [0004:withdrawl] += 10000
                <>Conditional Branch: Variable[000r:withdrawl] > Variable[0003:bank]
                    <>Message: Not enough Gilda in bank.
                    <>
                :   Else Handler
                    <>Message: You withdrawl \c[3]\v[4]\c[0] Gilda.
                    <>Variable: [0003:bank] -= Variable [0004:withdrawl]
                    <>Change Money: + Variable [0004:withdrawl]
                    <>Variable: [0004:withdrawl]-= Variable [000r:withdrawl]
                    <>Variable: [0001:gilda held]= Money                    
                    <>Message: You now have \c[3]\v[1]\c[0] Gilda on hand.
                    <>
                :   End
                <>
            :   [100000] Handler
                <>Variable: [0004:deposit] += 100000
                <>Conditional Branch: Variable[000r:withdrawl] > Variable[0003:bank]
                    <>Message: Not enough Gilda in bank.
                    <>
                :   Else Handler
                    <>Message: You withdrawl \c[3]\v[4]\c[0] Gilda.
                    <>Variable: [0003:bank] -= Variable [0004:withdrawl]
                    <>Change Money: + Variable [0004:withdrawl]
                    <>Variable: [0004:withdrawl]-= Variable [000r:withdrawl]
                    <>Variable: [0001:gilda held]= Money                    
                    <>Message: You now have \c[3]\v[1]\c[0] Gilda on hand.
                    <>
                :   End
                <>
            :   [All] Handler
                <>Variable: [0004:withdrawl] += Variable [0003:bank]
                <>Conditional Branch: Variable[000r:withdrawl] > Variable[0003:bank]
                    <>Message: Not enough Gilda in bank.
                    <>
                :   Else Handler
                    <>Message: You withdrawl \c[3]\v[4]\c[0] Gilda.
                    <>Variable: [0003:bank] -= Variable [0004:withdrawl]
                    <>Change Money: + Variable [0004:withdrawl]
                    <>Variable: [0004:withdrawl]-= Variable [000r:withdrawl]
                    <>Variable: [0001:gilda held]= Money                    
                    <>Message: You now have \c[3]\v[1]\c[0] Gilda on hand.
                    <>
                :   End
                <>
            :   Cancel Handler
                <>
            :   End
            <>
      :     [Custom] Handler
            <>Message: Withdrawl how much of \c[3]\v[3]\c[0] Gilda?
            <>Input Number : [0004:withdrawl], 6 digits
            <>Conditional Branch: Variable[000r:withdrawl] > Variable[0003:bank]
                    <>Message: Not enough Gilda in bank.
                    <>
                :   Else Handler
                    <>Message: You withdrawl \c[3]\v[4]\c[0] Gilda.
                    <>Variable: [0003:bank] -= Variable [0004:withdrawl]
                    <>Change Money: + Variable [0004:withdrawl]
                    <>Variable: [0004:withdrawl]-= Variable [000r:withdrawl]
                    <>Variable: [0001:gilda held]= Money                    
                    <>Message: You now have \c[3]\v[1]\c[0] Gilda on hand.
                    <>
                :   End
                <>
            :   Cancel Handler
                <>
            :   End
      <>
:     End
: [Do Nothing] Handler
       <>Message: If you wish.
       <>
:      End
<>


now just make an event on your map with some graphic, (preferably a person) and give them 2 events

first one, a message with something unnaturaly nice in it. "good evening and welcome to the bank of  my game"

and second one, the common event "Money"



set the trigger for action key and.....done............
Title: currency bank [now including a demo]
Post by: Tsunokiette on June 22, 2005, 08:23:10 PM
some of the lines are longer and continue to the next line, please do not get confused. in the preview, it shows the common event fine, however... as you can see when I submit it, it gets wrapped to the next line
Title: currency bank [now including a demo]
Post by: Plystire on June 22, 2005, 08:37:13 PM
:shock:

Who knew a bank could be so complicated?

Good job. 8)
Title: currency bank [now including a demo]
Post by: Tsunokiette on June 22, 2005, 08:39:37 PM
thank ye
Title: currency bank [now including a demo]
Post by: TDS on June 23, 2005, 07:42:28 PM
its really gud but what does this do

Code: [Select]
\c[3]\v[3]\c[0]
Title: currency bank [now including a demo]
Post by: Tsunokiette on June 23, 2005, 07:45:26 PM
makes how much money is stored in the bank show up green  8)

\c[3]= green

\v[3]= make variable 3 (the amount of money in the bank) show

\c[0]= white
Title: currency bank [now including a demo]
Post by: TDS on June 23, 2005, 08:02:19 PM
thanx. apart from that i understand it all. Thanx its really gud
Title: currency bank [now including a demo]
Post by: Tsunokiette on June 23, 2005, 08:02:56 PM
np :)
Title: currency bank [now including a demo]
Post by: Tsunokiette on June 24, 2005, 01:54:07 AM
demo has been created!! enjoy!!!!!!!!!!!!!!!!!! 8)
Title: currency bank [now including a demo]
Post by: Tsunokiette on June 24, 2005, 04:45:16 AM
err, anybody else want to add their input?
Title: currency bank [now including a demo]
Post by: Tsunokiette on June 24, 2005, 09:10:08 AM
EDIT: Fixed font
Title: currency bank [now including a demo]
Post by: Helper on June 26, 2005, 04:19:57 AM
Nice and simple.

I made a one like this in 2k3 except you had to have an ATM Card (by registering at any bank) and you had to remember a PIN Number otherwise you couldn't access the account. Of course you could get it back at a bank... for a price :P
Title: currency bank [now including a demo]
Post by: Leeroy_Jenkins on June 26, 2005, 07:59:12 AM
say you think you could pass that pin number thing on, for xp, tho?
Title: currency bank [now including a demo]
Post by: Tsunokiette on June 26, 2005, 05:01:14 PM
you could, have variable0008: pin (or whatever) be set to a random # between #1000000 and #3000000, then have it show the pin number, and turn switch (pin given) to on, so it doesn't give it to you more than once, then, make a conditional branch around the whole thing, storing the bank in the first part. then above the conditional branch, another one with (pin given) as the condition. And in the top part, have a message (pin) and have an input number option that stores the number you entered in variable0009:pin temp, and have the conditional branch  with the bank in it, have the condition be variable0009:pin temp == variable0008:pin and in the Else Handler, put,
<>Message:Incorrect Pin.

hope dis helps
Title: currency bank [now including a demo]
Post by: Tsunokiette on June 29, 2005, 08:06:12 AM
err maybe I should put it this way...

if you want a pin activated account replace the event that starts this common event with this-

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg99.echo.cx%2Fimg99%2F1705%2Fblahblah5wp.png&hash=e9a41559b1670b53792566b8de71aca9f1f9a26a)

it SHOULD work

EDIT:I forgot to place the subtract variable from money command when you pay to get a new pin, and I'm too tired to fix it right now, cause it's a picture lol.

<>Change Money: - variable: cost (or something like that...)
Title: currency bank [now including a demo]
Post by: Mr. DJ on June 29, 2005, 10:52:38 AM
Quote from: Tsunokiette
err maybe I should put it this way...

if you want a pin activated account replace the event that starts this common event with this-

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg99.echo.cx%2Fimg99%2F1705%2Fblahblah5wp.png&hash=e9a41559b1670b53792566b8de71aca9f1f9a26a)

it SHOULD work


correct
Title: Re: currency bank [now including a demo]
Post by: Martynator on April 10, 2007, 07:26:28 PM
Thanks, this really helped me al lot! I wanted a bank with only money, and not all the items and stuff, so thanks!
Title: Re: currency bank [now including a demo]
Post by: Deuresco on April 25, 2007, 11:38:48 PM
this is pretty cool, ill definietly have to give it a try sooner or later ;)
Title: Re: currency bank [now including a demo]
Post by: Demonic Blade on December 23, 2007, 10:48:44 AM
Nice, though there's a bug in the demo. After you get the 10000 Gilda, and you deposit 10000 Gilda, you can only choose to withdraw 1000 at a time. Choosing 10000 or All just makes the guy tell you that you don't have enough Gilda! Otherwise, really nice! Would it be possible to also store items? Or maybe be able buy a bank account? I like the idea with a PIN code too- makes it seem like a pro bank! All in all, I think it's a cool, yet kinda useless tutorial, since being defeated in combat doesn't mean you loose money. But I don't wanna seem like I don't like it!! Not at all! This rox, pal and I'm using it unless I find some bank where you can store items too! ;) :D
Title: Re: currency bank [now including a demo]
Post by: deathroy101 on August 06, 2008, 03:04:22 PM
OK I liked the whole regular bank and all but I'm trying to make a character bank in which you can create a new team whenever you want. the problem I'm running into is not storing or withdrawing it's withdrawing the same char at the level you deposited them at. for instance I have an actor preset to start at level 2 but on my character screen in the game he is level 5 when I withdraw him after depositing him he is back at level 2 again. If any one has any knoledge about fixing this problem I would be grateful.