Checking Coordinates

Mr. Minister

Veteran
Veteran
Joined
Mar 14, 2012
Messages
33
Reaction score
2
First Language
English
Primarily Uses
RMMV
Let me start out by admitting to how ignorant I am when it comes to javascript. I'm trying to stick to evening, but every now and then you have to throw a little code in to get what you want. I'm trying to figure out the correct code to throw in the script field of a conditional branch in an event that will check and see if that event's x&y coordinates equal another event's x&y coordinates (a monster and a projectile, for example). I know I can use variables to record the x&y of each event and have the monster take a hit when its coordinates intersect with the projectile. That's simple enough and sort of what I'm doing, Sort of. I'm trying to avoid having to create so many different variables for so many monsters. The monsters will spawn from a spawn point, so I'm using the OrangeCustomEvents script to place multiple instances of a single monster event from one map (an enemy inventory map) onto the play map. I figured I'd have an event page on the Monster Event set to Parallel and add a conditional branch set to use a bit of script. That's where I am completely clueless. I figured it would look something like this...


$gameMap._events[this._eventId]._x; = $gameMap._events[1]._x;


[this._eventId] is the monster and [1] is the projectile. And then I guess I'd make a similar conditional branch inside that for y, and then I'd take it from there. Again, I'm mega ignorant, so this might not even be possible. I just want the monster event to check its own coordinates rather than a variable that is attached to the coordinates of an event that has up to 10 copies running around on a single screen. I hope I've explained everything clearly. Thank you so much for reading!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People1.png & SF_People1.png added!!!!

Adventurer:
"Why your body looks like a bird?"

Stranger:
"Because I'm harpy"

Adventurer:
"Clap along if you feel like a room without a roof"

*Both dancing to Pharrell Williams song*
Stream will be live shortly with a make-up session of the Interactive Text Adventure! Feel free to drop by!
Pootscooter wrote on Pharonix's profile.
Hey @Pharonix, just wondering what you're up to lately and if you've had an opportunity to check out the LTBS thread in the past few days...(a couple of us could really use your expertise). Hope you are well and Happy Thanksgiving!

Forum statistics

Threads
105,506
Messages
1,014,263
Members
137,173
Latest member
zoetsoi
Top