[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,908
Reaction score
14,546
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

Work starts today at 2pm. I hate jeans, but the dress code says I have to wear them... That's how I discovered I was a plus size. Shopping for my first pair of jeans.
Anyhow, I'll post a new video on TheDazzlingsAreBack as soon as I'm able to.
dEj6ha4.png

WIP :)
Added some cliffs / walls / roofs to the tilesheet and am currently working on roof objects to make them prettier and more variable. And of course, windows and doors that fit to the game's style.
I also adjusted the grass color but i have some issues with my display, so if it looks weird, please let me know :)
Updated the dev logs for the game I'm working on! Check it out here
Alright, I left the modern girl in fantasy brain's hands while I get my - MODERN GIRL WHAT HAPPENED?! I blame fantasy brain for this.

WinaElemental.png
I just realized that, while I was waiting for our little Easter Game to be approved in the Completed Games Thread, the game was already listed for more than a week, without me noticing x.x

So ... very delayed happy easter to everyone I guess? : D

Forum statistics

Threads
110,562
Messages
1,054,272
Members
143,677
Latest member
ZackTheWolf
Top