Check if an event can move in a certain direction?

Yosiei

Villager
Member
Joined
Sep 30, 2021
Messages
14
Reaction score
1
First Language
Filipino
Primarily Uses
N/A
Is theres a way or script i can use to check if an event can move up,left,right or down? Im trying to make three even. That if player move up all three event will move up but if one of the three event cant move up all three event wont move. Same as if player cant move up all event wont move
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,812
Reaction score
9,117
First Language
Indonesian
Primarily Uses
RMVXA
JavaScript:
$gameMap.events()[event_id].canPass(x, y, direction)
// Replace direction with
// 2 = down
// 4 = left
// 6 = right
// 8 = up
 

Yosiei

Villager
Member
Joined
Sep 30, 2021
Messages
14
Reaction score
1
First Language
Filipino
Primarily Uses
N/A
JavaScript:
$gameMap.events()[event_id].canPass(x, y, direction)
// Replace direction with
// 2 = down
// 4 = left
// 6 = right
// 8 = up
Thanks for reply. How about x and y? Do i write it x and y or should i replace then with numbers?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,812
Reaction score
9,117
First Language
Indonesian
Primarily Uses
RMVXA
Replace it with a number. Or if you want to use it from the current position, it is going to be a bit longer.
Code:
e = $gameMap.events()[event_id]
e.canPass(e._x, e._y, direction)
// Replace direction with
// 2 = down
// 4 = left
// 6 = right
// 8 = up
 

Yosiei

Villager
Member
Joined
Sep 30, 2021
Messages
14
Reaction score
1
First Language
Filipino
Primarily Uses
N/A
Replace it with a number. Or if you want to use it from the current position, it is going to be a bit longer.
Code:
e = $gameMap.events()[event_id]
e.canPass(e._x, e._y, direction)
// Replace direction with
// 2 = down
// 4 = left
// 6 = right
// 8 = up
So basically x and y is the location of tile which i want to check. Then the designation is where the event will enter from?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,812
Reaction score
9,117
First Language
Indonesian
Primarily Uses
RMVXA
Yes. Actually, it is the opposite, but it can work either way.
If we are going to construct a sentence. It sounds like this.

"Can this event move <direction> from x, y?"
 

Latest Threads

Latest Posts

Latest Profile Posts

Current status screens for Shadows of the Earth: The Vrila'an Legend. Need to do something about the color scheme lol
Captura de pantalla (259).pngCaptura de pantalla (260).png
My first serious victim in game hacking - Pawnbarian.
Diana Path 2.png
I love these two design wise lol... The high school principal and the captain of the women's wrestling team. they team up as bosses to save the school's accreditation.
Kanori24 wrote on TheRamenGirl's profile.
I love your profile pic. Definitely one of my favorite scenes from OPM :D

Forum statistics

Threads
122,074
Messages
1,146,309
Members
160,360
Latest member
bleach
Top