Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> How do you access a game events x & y position in script
Ovan35
post Apr 18 2011, 09:58 PM
Post #1


Level 4
Group Icon

Group: Member
Posts: 51
Type: Developer
RM Skill: Intermediate




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
}



__________________________
Go to the top of the page
 
+Quote Post
   
Redd
post Apr 19 2011, 05:19 AM
Post #2


:<
Group Icon

Group: Revolutionary
Posts: 2,314
Type: Developer
RM Skill: Advanced




Moved to RGSS Script Support


__________________________
Go to the top of the page
 
+Quote Post
   
brewmeister
post Apr 19 2011, 06:01 AM
Post #3


Paste above Main
Group Icon

Group: Revolutionary
Posts: 408
Type: Scripter
RM Skill: Skilled




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


__________________________
Go to the top of the page
 
+Quote Post
   
Ovan35
post Apr 19 2011, 07:16 AM
Post #4


Level 4
Group Icon

Group: Member
Posts: 51
Type: Developer
RM Skill: Intermediate




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.


__________________________
Go to the top of the page
 
+Quote Post
   
brewmeister
post Apr 19 2011, 04:35 PM
Post #5


Paste above Main
Group Icon

Group: Revolutionary
Posts: 408
Type: Scripter
RM Skill: Skilled




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


__________________________
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 05:09 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker