Help - Search - Members - Calendar
Full Version: How do you access a game events x & y position in script
RPG RPG Revolution Forums > Scripting > Script Development and Support > RGSS
Ovan35
I'm trying to figure out how to access a event using script?I'm trying to cut down on the amount of in game variables I'm using and my current method uses two variables for every object that I plan to blow up.One for the x and one for the y value of each event.I want to use a conditional branch using the script part but I have no idea of the syntax to use.So basically I need the equivalent of

if(game_event[1].x == game_event[2].x )
if(game_event[1].y == dame_event[2].y)
{
//blow it up
}

Redd
Moved to RGSS Script Support
brewmeister
Try:

$game_map.events[1].x == $game_map.events[2].x and $game_map.events[1].y == $game_map.events[2].y


You also might want to check out: http://www.hbgames.org/forums/viewtopic.php?f=11&t=71187

Be Well
Ovan35
QUOTE (brewmeister @ Apr 19 2011, 10:01 AM) *
Try:

$game_map.events[1].x == $game_map.events[2].x and $game_map.events[1].y == $game_map.events[2].y


You also might want to check out: http://www.hbgames.org/forums/viewtopic.php?f=11&t=71187

Be Well

Thanks for the assist.It's working beautifully now.I tried asking you before on another post how you go about learning this stuff.I see some tutorials on rgss here but none of it has really stuck with me.Was there any tutorials you found that made it click?

Thanks for the link as well.I'll check it out.But from the face of it it looks pretty complicated to use.
brewmeister
I picked it up pretty quick. But I've been programming since 1981 (in Fortran IV)
I use the RGSS help that comes with RMXP, and the official Ruby sites www.ruby-lang.org & www.ruby-doc.org
You can read the entire RMXP help doc in one sitting. It may not all make sense right now, but you'll be aware of everything that's there.
But mostly I just studied the default scripts until I understood how they worked.

There are a few listed here:

http://www.hbgames.org/forums/viewtopic.php?f=48&t=1868

The other major RPG Maker support sites (Creation Asylum, Chaos Project, RMXP Unlimited, etc..) have tutorials & support as well
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.