RPG Maker Forums

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!

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top