Map location changing an event

Hello again!

I'll try to go "direct" to the point, I am having problems trying to make an event that changes it's conditions depending on its location on the map, for example: I created an object "box" and I would like to make this "box" move, so I put it to moves away from the player, but there is a point on the map that I would like it to change the conditions of this event (box), instead of the box moving away from the player, the player could jump on top of it and get an item

The thing is... Is this possible? Change switches depending on an object X reaching a position Y on the map?

I don't have a screenshot because I failed completely trying to do it...
Yes, this is absolutely possible!

I've recommended this before in similar threads, and while there are many methods to going about this, I think the easiest thing to do is use Variables, because you can copy and paste this setup pretty easily if you have multiple instances like this in your game.

Here the following setup:

Spoiler: Setup for tracking an Object at (X,Y) location
1) Create a new parallel event on the map the box is on, and start by create 2 variables. Call them Object X, and Object Y.

2) Set the Object X Variable to where it tracks the X Coordinate of the Object(aka, event) you want to track.
This can be done by simply going to:
Control Variables > Game Data > Character > (Event you want to track, in this case, your "box)
> Map X


3) Do the same thing as 2), but this time, do it with the Variable of Object Y, and make sure it tracks Map Y. Same exact process as 2).

4) You now have two variables that are constantly tracking the X and Y coordinate of your object (box) since this is a parallel event.

5) Right underneath these two Controlled Variables, setup a Conditional branch that has the following:

If Object X = (the X coordinate you want the box to be at)
{If Object Y = (the Y coordinate you want the box to be at)}
{-Control Switch to ON}
{-Self-Switch A ON}


*Notice how the Object Y is to be nested inside of your Object X coordinate condition in order for your Switch to turn ON.


If you follow this exact procedure, you should easily be able to have a parallel event that, when the box is at the (X,Y) location on the map, will trigger a Switch to turn on.

And thus, you can adjust the Box's properties of the player being able to stand up on it using your triggered switch.
Just make sure to turn the Parallel Event OFF once the box is there so that it doesn't cause issues.



I always like recommending this strategy because in my opinion, while it is a little tedious to setup at first, it's one of the easiest methods to track object locations without interference from other events or ID setups.
Thanks for the help!

This may be a little dumb from my part, but I couldn't find the conditional branch:

If Object X = (the X coordinate you want the box to be at)
{If Object Y = (the Y coordinate you want the box to be at)}

like, I couldn't find any conditional branch that relates to any object, or it's location
---> "purple" is the box

Can you send me a picture if possible? (if you can't okay) just to have a visual guide

Yes, this is absolutely possible!

I've recommended this before in similar threads, and while there are many methods to going about this, I think the easiest thing to do is use Variables, because you can copy and paste this setup pretty easily if you have multiple instances like this in your game.

Here the following setup:

Spoiler: Setup for tracking an Object at (X,Y) location
1) Create a new parallel event on the map the box is on, and start by create 2 variables. Call them Object X, and Object Y.

2) Set the Object X Variable to where it tracks the X Coordinate of the Object(aka, event) you want to track.
This can be done by simply going to:
Control Variables > Game Data > Character > (Event you want to track, in this case, your "box)
> Map X


3) Do the same thing as 2), but this time, do it with the Variable of Object Y, and make sure it tracks Map Y. Same exact process as 2).

4) You now have two variables that are constantly tracking the X and Y coordinate of your object (box) since this is a parallel event.

5) Right underneath these two Controlled Variables, setup a Conditional branch that has the following:

If Object X = (the X coordinate you want the box to be at)
{If Object Y = (the Y coordinate you want the box to be at)}
{-Control Switch to ON}
{-Self-Switch A ON}


*Notice how the Object Y is to be nested inside of your Object X coordinate condition in order for your Switch to turn ON.


If you follow this exact procedure, you should easily be able to have a parallel event that, when the box is at the (X,Y) location on the map, will trigger a Switch to turn on.

And thus, you can adjust the Box's properties of the player being able to stand up on it using your triggered switch.
Just make sure to turn the Parallel Event OFF once the box is there so that it doesn't cause issues.



I always like recommending this strategy because in my opinion, while it is a little tedious to setup at first, it's one of the easiest methods to track object locations without interference from other events or ID setups.
Thanks for the help!

This may be a little dumb from my part, but I couldn't find the conditional branch:

If Object X = (the X coordinate you want the box to be at)
{If Object Y = (the Y coordinate you want the box to be at)}

like, I couldn't find any conditional branch that relates to any object, or it's location
---> "purple" is the box

Can you send me a picture if possible? (if you can't okay) just to have a visual guide

Not a problem! The options can look confusing sometimes.

Here's kind of what the event would look like. (I took this screenshot from my 1st game).
Example.png

(Here, I have a hole at (2,7) that you need to push a snowball into. The moment the snowball lands there, it disappears and causes a ladder to fall down, and Control Self Switch A turns this parallel event OFF on the next page to avoid lag).


Anyway, to answer your question:

Screen Shot 2022-07-28 at 8.46.45 AM.png


It is located on the 1st page of Event Commands, and is the 1st Option underneath Flow Control.
(Conditional Branch).

Once you get there, you should be able to set the Variable X and Variable Y to the exact coordinate numbers where the box needs to be! And follow your events within those nested conditions..

Original thread: https://forums.rpgmakerweb.com/threads/map-location-changing-an-event.149867/