I have been looking to do something and I just can't figure out how to... Basically I want a chest that is approachable from all 4 directions. When you press enter, I want an NPC (which is standing a bit farther) to run to the chest and "take its contents" instead of you. The problem is that you could stand in the way of the NPC. So if I want to trigger the chest from the front, I want the NPC to know I am standing there thus going to the chest on a different route. Is this possible?
NPC knows where you stand
RPG Maker VXAce SupportWhen you create an event, under conditional branch, the 3rd page has if Character is facing x, replace x with the direction the player should be facing. Then, set the NPC to use a specific route, depending on what way the player is facing. You can do this four times and set specific move routes for all four ways the character can be facing even.
Also since technically the npc is not a player the chest won't need to have any items in it. Since from your description the npc takes it for ever direction you are facing.
That seems to work indeed but it seems so long. Isn't there a way to make a variable with x and y coordinates of the player and use them with other events?
yes, that can be done with control variable:Game data. However, that would be even longer as a command sequence than a simple check on the facing.
One tip: if the position of the NPC is always the same, then you don't need to check all directions. If the position is always the same, only one player position (and thereby only one facing) will require the longer move route around. So you can check that corresponding facing for the longer route and place the route for the other three direction in the else-branch.
One tip: if the position of the NPC is always the same, then you don't need to check all directions. If the position is always the same, only one player position (and thereby only one facing) will require the longer move route around. So you can check that corresponding facing for the longer route and place the route for the other three direction in the else-branch.
Alright thanks a lot 🙂 This helped me out a lot.
Original thread: https://forums.rpgmakerweb.com/threads/npc-knows-where-you-stand.41268/