- Joined
- Dec 6, 2015

- Messages
- 188

- Reaction score
- 325

- First Language
- English

- Primarily Uses
- RMVXA

I am Vectra. I've gotten a request from a friend to do this. I did this for someone else a long time ago so i figured I'll make a tutorial for all who wants to know how.

4 Variables

4 Conditional Branches

X-Coord1

Y-Coord1

X-Coord2

Y-Coord2

To find the x & y-coord of the rock/person

Go to Control Variable

Go to Game Data <= only skip this ONE step if you use Vx

Go to Character

Pick the character (player or the event)

On the right pick MAP Y or MAP X

Red is where you pick which event you want to know the coordinates of and the blue is whether you want MAP X or MAP Y. There are other choices, but they are irrelevant. Don't use Screen X or Y because that uses coordinates on-screen and you don't want that.

PL is Player and RO is the rock.

X-Coord = X coordinate

Y-Coord = Y coordinate

You subtract the X-Coords to find the distance horizontally and you subtract the Y-Coords to find the distance vertically.

The multiplying by -1 is so that the number will become positive if the answer happens to be a negative. In mathematics, distance cannot be a negative number.

Due to the X-Coord and Y-Coord check needing to be 1, the system checks for diagonals too.

You minus the rock's coordinates with the player's coordinates. If the answer is 1 or 0 then they're touching. If you want it like have it where if the rock is 5 steps away then you simply make the condition branches 5 or less instead of 1 or less.

It'll look like this:

This checks if it's 5 steps away horizontally and then checks vertically.

Then you replace player with another event. For example, If i wanted the distance between 2 rocks then I simply replace X and Y Coord1 with another event's X and Y Coord instead. If you want to know the distance of more than 2 events then every event added needs 2 variables(X & Y Coord).

Only difference is you scrap the Y-Coord PL check and add X-Coord and Y-Coord right before the proximity (which is now distance) check.

Note: Make sure both types are on parallel process unless you want it to check the distance once.

**Here's what you need:**4 Variables

4 Conditional Branches

**What are the 4 variables?:**X-Coord1

Y-Coord1

X-Coord2

Y-Coord2

__Let's say you want to detect the distance between the player and a rock:__To find the x & y-coord of the rock/person

Go to Control Variable

Go to Game Data <= only skip this ONE step if you use Vx

Go to Character

Pick the character (player or the event)

On the right pick MAP Y or MAP X

Red is where you pick which event you want to know the coordinates of and the blue is whether you want MAP X or MAP Y. There are other choices, but they are irrelevant. Don't use Screen X or Y because that uses coordinates on-screen and you don't want that.

PL is Player and RO is the rock.

X-Coord = X coordinate

Y-Coord = Y coordinate

You subtract the X-Coords to find the distance horizontally and you subtract the Y-Coords to find the distance vertically.

The multiplying by -1 is so that the number will become positive if the answer happens to be a negative. In mathematics, distance cannot be a negative number.

Due to the X-Coord and Y-Coord check needing to be 1, the system checks for diagonals too.

You minus the rock's coordinates with the player's coordinates. If the answer is 1 or 0 then they're touching. If you want it like have it where if the rock is 5 steps away then you simply make the condition branches 5 or less instead of 1 or less.

It'll look like this:

This checks if it's 5 steps away horizontally and then checks vertically.

**Wait, but what if I want distance between two events?**Then you replace player with another event. For example, If i wanted the distance between 2 rocks then I simply replace X and Y Coord1 with another event's X and Y Coord instead. If you want to know the distance of more than 2 events then every event added needs 2 variables(X & Y Coord).

**SUB-TUTORIAL: DISTANCE**Only difference is you scrap the Y-Coord PL check and add X-Coord and Y-Coord right before the proximity (which is now distance) check.

Note: Make sure both types are on parallel process unless you want it to check the distance once.

**If you have ANY questions plz ask.**
Last edited: