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
> [Help] How to get coordinates of event?
Hedgehog
post Apr 18 2010, 10:05 AM
Post #1



Group Icon

Group: Member
Posts: 1
Type: None
RM Skill: Beginner




Hello everyone.

Basically I have event movable by player and want to know its current position. I already know about "x" and "y" members of event class but how can I get them while processing the event?
I need them inside the conditional branch. Of course I can write custom condition checking them but I don't know how to get a pointer (or what else ruby has for this case) to this event. "Self" returns only the interpreter.
Another way to solve the problem is tracing movement of event and storing its position in variables. It is possible but I wanted to avoid such a solution.

So, what should I do?

P.S. Sorry for uneven handwriting.
Go to the top of the page
 
+Quote Post
   
Unka Josh
post Apr 18 2010, 03:41 PM
Post #2


Level 32
Group Icon

Group: Revolutionary
Posts: 771
Type: Developer
RM Skill: Skilled




The way to do this (that involves events) is to use Control Variable to assign the those numbers to a variable. There really isn't any other way.
Go to the top of the page
 
+Quote Post
   
woratana
post Apr 19 2010, 11:15 AM
Post #3


Looking for scripter to hire? PM me *O*
Group Icon

Group: +Gold Member
Posts: 1,038
Type: Scripter
RM Skill: Undisclosed




Try this:
CODE
$game_map.events[(event_id)].x

e.g.
CODE
$game_map.events[1].x


For "This" event,
CODE
$game_map.events[@event_id].x


Don't blame me if this doesn't work. I don't have RPG Maker on this mac at the moment, unfortunately.


__________________________
Check out my NEW blog!!!



MVP (Most Valuable Poster) Award 2008


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: 22nd May 2013 - 02:40 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker