[Solved][RMVXAce] Conditional branch not working as intended

Pollopezz8

Villager
Member
Joined
Mar 14, 2020
Messages
7
Reaction score
3
First Language
Italian
Primarily Uses
RMVXA
Hi there, I'm having a problem with a conditional branch. It might be trivial, but I can't figure it out.

The problem is that I'm trying to trigger an event when an object is moved to a precise square on the map. It technically works, but the event triggers also when the object is moved to other certain squares.
The desired coordinates are 44x45 but the event does not work if I set those coordinates and works if I set 45x45 as coordinates.
EventSlide.png
EventSlide2.png
In particular, by setting the coordinates as 45x45 the event triggers when the objects coordinates are 44x45, 46x45 and 46x46.
More generally, if I set "nxm" as coordinates where n and m are natural numbers, those coordinates do not correspond in game to those I set.
I would like to understand why the coordinates I set do not correspond to the coordinates that work in game.
I hope I was clear. Thank you.
 
Last edited:

TheNewSon

Aspiring Game Designer
Veteran
Joined
Aug 24, 2019
Messages
75
Reaction score
125
First Language
Portuguese
Primarily Uses
RMMV
Problem is: you're moving the event AFTER saving the coordinates, so you're actually checking the event's PREVIOUS position instead of the current one. That's why the conditions are met when the event is moved to any adjacent tiles: because the event WAS on the right position. Place the "set move route" command above the variable settings and it should work. Good luck! o/
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,912
Reaction score
14,554
First Language
English
Primarily Uses
RMMV
You could also just draw with a region on the square you want it to move to, then after moving, use the variables to get the event's current X and Y position, then a Get Location Info command to put the region id at those coordinates into another variable. Finally, have your conditional branch check to see if that variable contains the correct region id.
 

Pollopezz8

Villager
Member
Joined
Mar 14, 2020
Messages
7
Reaction score
3
First Language
Italian
Primarily Uses
RMVXA
Problem is: you're moving the event AFTER saving the coordinates, so you're actually checking the event's PREVIOUS position instead of the current one. That's why the conditions are met when the event is moved to any adjacent tiles: because the event WAS on the right position. Place the "set move route" command above the variable settings and it should work. Good luck! o/
It worked and it was something trivial, as expected. Thank you!
 

Pollopezz8

Villager
Member
Joined
Mar 14, 2020
Messages
7
Reaction score
3
First Language
Italian
Primarily Uses
RMVXA
You could also just draw with a region on the square you want it to move to, then after moving, use the variables to get the event's current X and Y position, then a Get Location Info command to put the region id at those coordinates into another variable. Finally, have your conditional branch check to see if that variable contains the correct region id.
Thank you for the advice! I'm going to try it in another event!
 

Latest Threads

Latest Posts

Latest Profile Posts

I'm in a much better mood about my game than I was 2-3 days ago. I keep switching between sideview and front because of the amount of assets needed for side (I'm drawing it all myself)... but I've decided to stick with front, for my own sanity. sidenote... people, planning is important. I've spent so long on just getting my game's ideas off the ground because I didn't plan ahead.
unknown.png

"Fight me."
I'll finally wash my clothes today!
SA46ATTACK.gif :kaojoy:New Arab character in action.
I almost thought it wouldn't happen, but a miracle has occurred, and IT'S HAPPENING!!!

Forum statistics

Threads
110,607
Messages
1,054,671
Members
143,736
Latest member
EmBee
Top