So, I've never actually posted on a forum before, so forgive me if I posted this in the wrong place or something.
Anyway, would someone please tell me how to trigger an event only if you buy a certain item from a shop?
There's a guy in front of the store that says you cannot leave until you buy 2 Potions. So I want to be able to trigger an event after buying 2 potions that allows you to pass him. Please help, thank you 😀
Moved to VX Ace Support (the Tutorials forum is for actual tutorials, not for asking for assistance.)
On the guy at the front of the store, add a Control Variables event, choose a variable (and name it, so you don't use it for something different later), and set it to Item [Potion] in Inventory (this is in Game Data).
Then have a Conditional Branch, choose the same variable again, and say "greater than or equal to 2".
In the "true" block (the first one below the condition), make him move to the side or something so you can pass.
In the "false" block (the one below the else), have him say you must buy 2 potions.
Thank you so much, it worked! Sorry about posting in the wrong forum. Also thanks for the quick reply!
You WILL have an issue where the guy will still be in front of the door next time you come in. Here's what you do to fix that:
Create a second event in the place where you want him to move TO. Add his sprite, and in the Conditions (above the sprite), choose a switch and name it - call it something like 'guy moved'. Then in the original event, when he moves out of the way, turn on that switch after he moves. Now create a new event page on that event with NO sprite, set it to Below Characters, and set its condition to the same switch.
What you're basically doing is saying "when the switch is off, he's going to be standing in front of the door; when the switch is on, he's going to be standing somewhere else". It's done with 2 events, but the player only sees it as one.
If you don't do something like that, he'll be standing in front of the door EVERY time you enter the shop, and he won't let you leave unless you have 2 potions each time.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.