Save-Point

Full Version: checking event coordinates?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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.
While I put the if in there, it didn't work. If doesn't work too often in XP programs, especially conditional event scripts.
If there is less than 5 events on the map the it will fail obviously.
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.