I want to activate something like SelfSwitch D when tow event are at same location.
Any pluggin that can help this way?
Th idea is to handle tht without using any parralele process for be faster.
Also that will make code more clear.
Thanks for your help
rpg maker mv.
For event 001 and 002. Map 007. Coordinates x = 6 and y = 4
if (($gameMap.event(1)._x==6 && $gameMap.event(1)._y==4) &&
($gameMap.event(2)._x==6 && $gameMap.event(2)._y==4)) {
$gameSelfSwitches.value([7, 1, 'D'];
$gameSelfSwitches.value([7, 2, 'D'];
};
This should be either auto-checked in a parallel common event, or manually by a script/plugin command call when you want.
If you don't want to use a parallel process event, then you need to know when the events are moving. If only one event moves, you can put the logic onto that event, after its movement command. If they can both move, you put the logic into both events, after the movement command. If you've got autonomous movement turned on, I don't think there's any way to get out of a parallel process.
If only one moves, you can simply use a region on the non-moving event, and each time the other event moves, use Get Location Info to get its region id. Then compare it with the region id you used.
If they both move, you'd need to use a conditional branch to see if event A's X is the same as event B's X and event A's Y is the same as event B's Y.
You'd need to provide more information on what the events are and what they are doing, for further help. And what event needs to have self switch D turned on?
You can use a parallel process event for this, but add a Wait 5 Frames as the very first command, as events are not going to move over 60 tiles per second, so you don't have to do the test on every frame.
Do you mean when the player steps on the switch it should activate, and when an event (doesn't matter whether it's an NPC or an object - they're just events) moves onto it, it activates?
For the player, set the switch event to Below Characters and Player Touch. When the player moves onto the switch it will activate.
For the events, each time they move, get the event's region id and see if it matches the one you drew under the switch event. If it does, turn on a switch (not a self switch, unless you want to use the plugin or a script call).
Also, you posted immediately after me. You don't need to quote my post. And if you do quote, remove everything that you're not directly replying to (which is pretty much all of my post except where I asked you to explain what you're trying to achieve).
Thanks for tour solution, it's better then paralele event and can be done...
But I can't stop thinking about something I see a lot of time ago. I rememver it's possible to look how many event was at a specific x y position.
RPG maker have a call for that. But I did't remember it.
$gameMap.eventsXy(x, y).length or $gameMap.eventsXyNt(x, y).length will tell you how many events are at the location x, y.
The Nt version gives you the number without the Through switch checked.