The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: XtheExecutioner on March 18, 2007, 03:00:42 AM

Title: Help with bank [RESOLVED]
Post by: XtheExecutioner on March 18, 2007, 03:00:42 AM
ok i followed the Tut made for creating a bank and i've run into a few problems. I have RPGMXP PK. WHen i go talk to the guy i am using for the bank it says "balance: 5 gold, Gold on hand:0" then when i try to withdraw or deposit it does nothing it just says" you withdraw/deposit 0 gold"  I followed everything and checked it all twice. here is what i put in so some one please tell me what i did wrong. I know i didn't put in the ": cancel handler" but i don't know how.

EDIT: i just messed with it and everything works now just when i go to the guy it still says i have 5gold in the bank and 0 on hand. And when i with draw or deposit it still says "you deposit 0 gold, you now have a balance of 5 gold" and for withdrawing it says"you withdraw 0 gold, you have 0 gold on hand"


<>Variable: [003: Gold held] = Money
<>Message: Balance: \c[3]\v[3]\c[0]
:          :gold on hand:\c[3]\v[1]\c[0]
<>Show choices:Deposit,Withdraw,Do nothing
[deposit]handler
<>Conditional Branch:variable [003:gold held]==0
<>Message: You don't have any gold to deposit.
<>
: Else handler
<>Show Choices:Fixed Amount, Custom
[Fixed Amount]handler
<>Message: How much of \c[3]\v[1]\c[0] gold?
<>Show Choices:1000,10000,100000,All
[1000]handler
<>Variable: [004:Deposit]=1000
<>Conditional branch: Variable [004:Deposit]>variable[003:gold held]
<>Message: Not enough gold on hand.
<>
Else handler
<>Message: You deposit \c[3]\v[2]\c[0] gold
<>Variable: [005:bank]+= variable[004:deposit]
<>Change money: - variable: [004:Deposit]
<>Variable: [004:deposit]-=variable: [004:deposit]
<>Message: You now have a balance of \c[3]\v[3]\c[0]
<>
End
<>
[10000]handler
<>Variable: [004:Deposit]+=1000
<>Conditional branch: Variable [004:Deposit]>variable[003:gold held]
<>Message: Not enough gold on hand.
<>
Else handler
<>Message: You deposit \c[3]\v[2]\c[0] gold
<>Variable: [005:bank]+= variable[004:deposit]
<>Change money: - variable: [004:Deposit]
<>Variable: [004:deposit]-=variable: [004:deposit]
<>Message: You now have a balance of \c[3]\v[3]\c[0]
<>
End
<>
[100000]handler
<>Variable: [004:Deposit]+=100000
<>Conditional branch: Variable [004:Deposit]>variable[003:gold held]
<>Message: Not enough gold on hand.
<>
Else handler
<>Message: You deposit \c[3]\v[2]\c[0] gold
<>Variable: [005:bank]+= variable[004:deposit]
<>Change money: - variable: [004:Deposit]
<>Variable: [004:deposit]-=variable: [004:deposit]
<>Message: You now have a balance of \c[3]\v[3]\c[0]
<>
End
<>
[All]handler
<>Variable: [004:deposit]+= Variable: [003:gold held]
<>Conditional branch: Variable [004:Deposit]>variable[003:gold held]
<>Message: Not enough gold on hand.
<>
Else handler
<>Message: You deposit \c[3]\v[2]\c[0] gold
<>Variable: [005:bank]+= variable[004:deposit]
<>Change money: - variable: [004:Deposit]
<>Variable: [004:deposit]-=variable: [004:deposit]
<>Message: You now have a balance of \c[3]\v[3]\c[0]
<>
End
<>
End
<>
[Custom]handler
<>Message:Deposit how much of \c[3]\v[1]\c[0] gold?
Input number: [004:deposit]. 6 digits
<><>Conditional branch: Variable [004:Deposit]>variable[003:gold held]
<>Message: Not enough gold on hand.
<>
Else handler
<>Message: You deposit \c[3]\v[2]\c[0] gold
<>Variable: [005:bank]+= variable[004:deposit]
<>Change money: - variable: [004:Deposit]
<>Variable: [004:deposit]-=variable: [004:deposit]
<>Message: You now have a balance of \c[3]\v[3]\c[0]
<>
End
<>
End
<>
End
<>
[Withdraw] handler
<>Conditional branch: variable [005:bank]==0
<>Message: No money to withdraw
<>
Else handler
<>Show Choices: Fixed amount,Custom
[Fixed Amount]handler
<>Message: How much of \c[3]\v[1]\c[0] gold?
<>Show Choices:1000,10000,100000,All
[1000]handler
<>Variable: [006:Withdraw]=1000
<>Conditional branch: Variable [006:withdraw]>variable[005:bank]
<>Message: Not enough gold to withdraw
<>
Else handler
<>Message: You deposit \c[3]\v[4]\c[0] gold
<>Variable: [005:bank]-= variable[006:withdraw]
<>Change money: - variable: [006:withdraw]
<>Variable: [006:withdraw]-=variable: [006:withdraw]
<>Variable: [003: gold held]=money
<>Message: You now have a balance of \c[3]\v[1]\c[0]gold.
<>
End
<>
[10000]handler
<>Variable: [006:withdraw]+=1000
<>Conditional branch: Variable [006:withdraw]>variable[005:bank]
<>Message: Not enough gold to withdraw
<>
Else handler
<>Message: You deposit \c[3]\v[4]\c[0] gold
<>Variable: [005:bank]-= variable[006:withdraw]
<>Change money: - variable: [006:withdraw]
<>Variable: [006:withdraw]-=variable: [006:withdraw]
<>Variable: [003: gold held]=money
<>Message: You now have a balance of \c[3]\v[1]\c[0]
<>
End
<>
[100000]handler
<>Variable: [006:Withdraw]+=100000
<>Conditional branch: Variable [006:withdraw]>variable[005:bank]
<>Message: Not enough gold to withdraw
<>
Else handler
<>Message: You deposit \c[3]\v[4]\c[0] gold
<>Variable: [005:bank]-= variable[006:withdraw]
<>Change money: - variable: [006:withdraw]
<>Variable: [006:withdraw]-=variable: [006:withdraw]
<>Variable: [003: gold held]=money
<>Message: You now have a balance of \c[3]\v[1]\c[0]gold.
<>
End
<>
[all]handler
<>Variable: [006:withdraw]+= Variable: [005:bank]
<>Conditional branch: Variable [006:withdraw]>variable[005:bank]
<>Message: Not enough to withdraw
<>
Else handler
<>Message: You deposit \c[3]\v[4]\c[0] gold
<>Variable: [005:bank]-= variable[006:withdraw]
<>Change money: - variable: [006:withdraw]
<>Variable: [006:withdraw]-=variable: [006:withdraw]
<>Variable: [003: gold held]=money
<>Message: You now have a balance of \c[3]\v[1]\c[0]
<>
End
<>
End
<>
[Custom]Handler
<>Message:Withdraw how much of \c[3]\v[3]\c[0] gold?
Input number: [006:Withdraw]. 6 digits
<><>Conditional branch: Variable [006:withdraw]>variable[005:bank]
<>Message: Not enough gold to withdraw
<>
Else handler
<>Message: You deposit \c[3]\v[4]\c[0] gold
<>Variable: [005:bank]-= variable[006:withdraw]
<>Change money: + variable: [004:Deposit]
<>Variable: [006:withdraw]-=variable: [006:withdraw]
<>Variable: [003:gold held]= Money
<>Message: You now have a balance of \c[3]\v[1]\c[0]
<>
End
<>
End
<>
End
[Do nothing] handler
<>Message:If you wish
<>
End
<>



Also i know i didn't put another 0 with the numbers in the variables i just noticed and it not that big a deal so yea.
Title: Re: Help with bank
Post by: modern algebra on March 20, 2007, 12:08:35 AM
I'm not exactly sure what tut you are referring to, but one thing I notice immediately is that your "gold on hand" is displaying the wrong variable. Variable 3 is the one that shows how much gold you have on hand, not variable 1. So for your first message, instead of:

<>Message: Balance: \c[3]\v[3]\c[0]
:          :gold on hand:\c[3]\v[1]\c[0]

it should be

<>Message: Balance: \c[3]\v[5]\c[0]
:          :gold on hand:\c[3]\v[3]\c[0]

From quickly looking through your event, I think variable 5 is the one that is keeping track of your balance, not 1, as:

<>Message: You deposit \c[3]\v[2]\c[0] gold
<>Variable: [005:bank]+= variable[004:deposit]
<>Change money: - variable: [004:Deposit]
<>Variable: [004:deposit]-=variable: [004:deposit]
<>Message: You now have a balance of \c[3]\v[3]\c[0]

which makes it look like you are using variable 5 to keep track of your balance. In this case, this part of the event should look like:

<>Message: You deposit \c[3]\v[4]\c[0] gold
<>Variable: [005:bank]+= variable[004:deposit]
<>Change money: - variable: [004:Deposit]
<>Variable: [004:deposit]-=variable: [004:deposit]
<>Message: You now have a balance of \c[3]\v[5]\c[0]

I think that your problem lies in a mislabelling of your variables in the messages. So go through them and change them and post back if it turns out that isn't the problem
Title: Re: Help with bank
Post by: Tsunokiette on March 20, 2007, 12:19:55 AM
If I'm not mistaken, it looks a lot like the one I posted 2 years ago when I first came here.

If it is, I'm going to have to make an updated (and simpler) version.
Title: Re: Help with bank
Post by: XtheExecutioner on March 20, 2007, 06:23:47 PM
yea it is the one you posted a long time ago i was going through the tuts and found yours and decided to use it. Thank you both for helping me i will tell you if it is fixed the next time i get to work on it.
Title: Re: Help with bank
Post by: :) on March 20, 2007, 11:18:25 PM
http://rmrk.net/index.php/topic,14182.0.html
Title: Re: Help with bank
Post by: XtheExecutioner on March 25, 2007, 05:59:36 PM
I Fixed it YAY! It was the fact that i was just copying what was in the tut when i did /v[1] and stuff i forgot that i had to put the variables i made in replace of the numbers. I wasn't really paying attention. Thnx for helping!
Title: Re: Help with bank
Post by: :) on March 25, 2007, 06:00:05 PM
Solved? Add [RESOLVED] to topic title.
Title: Re: Help with bank [RESOLVED]
Post by: XtheExecutioner on March 26, 2007, 10:04:09 PM
its already there and i didn't do it....
Title: Re: Help with bank [RESOLVED]
Post by: :) on March 26, 2007, 10:35:06 PM
then a MOD had done it.  ;D