Paying off a loan

Hello!

One of the details I'd like in my game is that the player has a loan, and in order to move on the load must be paid.

My vision is pretty simple: There is an in-game set quantity of gold that needs to be paid. When you talk to the right person, they ask, "How much would you like to pay?" and what pops up is a window above the conversation that lists 1) The amount of gold left to pay, 2) The amount of gold the player has with them, 3) A number that can be changed to a quantity of the player's choosing, without going over what they have. - Then, the character says "Pay XX gold towards your loan?" where XX is the chosen number and the player has the option to Accept, Change, or Cancel the payment. When they accept, the total quantity of gold left to pay is reduced by that number permanently and the player loses that much gold. The character thanks the player for the payment and hopes to see them soon. - When finally the player pays the entire quantity of gold, the character tells the player thanks and then a special switch turns on so the game can continue.

I haven't seen any other kind of script like it on this forum in the half hour I searched.

Anyone have one or know of how to build one?

Thank you in advance.
I've moved this thread to VX Ace Support. Please be sure to post your threads in the correct forum next time. Thank you.


You do not need a script for this. Understand that scripting is VERY different to eventing.


Also, can you confirm whether you are using VX or Ace? Your profile says one thing, but you posted in the script requests for the other.


Set a variable to the full amount of gold.


Every time the player pays an amount, deduct that amount from the variable.


Use Control Variables to determine how much gold the player currently has.


Use Number Input Processing along with a variable to allow the player to say how much they want to pay.


Use Show Choices to let the player accept, change or cancel the payment.


You can show a variable or the amount of gold by putting \V[5] or \G into the text box.


All of this is done via event commands.
I've been away from the makers for so long, I didn't realize all of those were possible in events.

I've got it working well, thanks, and updated my profile from the default settings.

Original thread: https://forums.rpgmakerweb.com/threads/paying-off-a-loan.41364/