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!
 

Latest Threads

Latest Posts

Latest Profile Posts

Guys, I made a trailer! And, I also launched the Steam page! If you would like to support the game, please Wishlist it :ahappy: ->
working on some tilesets _ノ乙(、ン、)_

CIBl8xT.png


Oq8WKHX.png
aww man, color hex code #C4C4C4 doesn't work for the tint value in this scene I need something darker, which stinks just because I liked that one it was my favorite plastic explosive three times...#696969 (nice) should work better (WHY IS MY BRAIN LIKE THIS)
Tell it to me straight, doc. If I've been trying to piece together a "shorter" game to learn stuff outside of game jams... am I just running away from my WIP? :v

Forum statistics

Threads
117,284
Messages
1,106,123
Members
153,467
Latest member
Kip_
Top