Save-Point
checking event coordinates? - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Code Support (https://www.save-point.org/forum-20.html)
+--- Thread: checking event coordinates? (/thread-191.html)



checking event coordinates? - shintashi - 05-27-2010

Code:
p $game_map.events[5].x  
p $game_map.events[5].y

so I figured out I could do something like the above,

when I tried to do a conditional for

Code:
$game_map.events[5].y == 29

I noticed nothing happened, even with the response was supposed to be simple, like

Code:
@>Conditional Branch: Script: $game_map.events[5].y == 29
@>Text: Testing
@>
:Else
@>
:Branch End
@>

How do I query the coordinates of an event and have the computer respond properly?


checking event coordinates? - Jaberwocky - 05-28-2010

Add an 'if' in front of that.
if $game_map.events[5].y == 29
The script thing in the conditional branch checks if the code in it returns true or not. Since '$game_map.events[5].y == 29' doesn't return anything on its own... nothing happens.


checking event coordinates? - shintashi - 05-28-2010

While I put the if in there, it didn't work. If doesn't work too often in XP programs, especially conditional event scripts.


checking event coordinates? - deValdr - 05-28-2010

If there is less than 5 events on the map the it will fail obviously.


checking event coordinates? - Jaberwocky - 05-28-2010

Alright, just checked, I guess that the conditional branch thing actually DOESN'T need the 'if'.
So... either the event with the conditional branch isn't running, or event 5's y is not 29.