BRANCHING AN EVENT TRIGGERED BY PURCHACE

Posts

Pages: 1
charblar
"wait you made this a career?"
3574
Hi! I'm currently trying to made an event for a vending machine where if you purchase something from the machine it will display text that the product was dispensed. Is there a way using the basic event maker in vx ace that would allow me to trigger that?
Yup. It will require the use of variables.

Basically you use a variable to check the amount of the items you can buy in the vending machine before purchasing the items.
Then after the purchase, have a series of conditional branches checking to see if those numbers have changed at all. If so, then add the message. If not, leave it blank. So, say you have three items - Soda, Juice and Water.

You'd have one variable for each: VSoda, VJuice, VWater.
- Check how many VSoda you have (so VSoda set Amount Soda Item owned)
- Check how many VJuice you have (so VJuice set Amount Juice Item owned)
- Check how many VWater you have (so VWater set Amount Water Item owned)

Then have the shop screen - BUY: Soda/Juice/Water

After that conditional branches.

IF VSoda LESS THAN Amount Soda Item owned Then
MAKE MESSAGE HERE
END

IF VJuice LESS THAN Amount Juice Item owned Then
MAKE MESSAGE HERE
END

IF VWater LESS THAN Amount Water Item owned Then
MAKE MESSAGE HERE
END

charblar
"wait you made this a career?"
3574
author=Liberty
Yup. It will require the use of variables.

Basically you use a variable to check the amount of the items you can buy in the vending machine before purchasing the items.
Then after the purchase, have a series of conditional branches checking to see if those numbers have changed at all. If so, then add the message. If not, leave it blank. So, say you have three items - Soda, Juice and Water.

You'd have one variable for each: VSoda, VJuice, VWater.
- Check how many VSoda you have (so VSoda set Amount Soda Item owned)
- Check how many VJuice you have (so VJuice set Amount Juice Item owned)
- Check how many VWater you have (so VWater set Amount Water Item owned)

Then have the shop screen - BUY: Soda/Juice/Water

After that conditional branches.

IF VSoda LESS THAN Amount Soda Item owned Then
MAKE MESSAGE HERE
END

IF VJuice LESS THAN Amount Juice Item owned Then
MAKE MESSAGE HERE
END

IF VWater LESS THAN Amount Water Item owned Then
MAKE MESSAGE HERE
END


Thank you very much!
Pages: 1