Two event at same place

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
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.
 

Yurii

Villager
Member
Joined
Apr 10, 2016
Messages
21
Reaction score
2
Primarily Uses
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
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.
Basicly, in map i have some switch on the floor. When player or npc or objet was push on them that activate activate their switch.
I got a way for do that already without parralele proxy but its complicated and scan whol map..

I was thinking of using HIME custume page condution and inside, putting a appropriate condition.
I remember long time ago to have see a fucntion that return how many event was at a specific location.
With this function, I will be able to do it witout any parralele event in all situation and without comparing anyting =:0)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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).
 

XGuarden

Veteran
Veteran
Joined
May 10, 2016
Messages
446
Reaction score
17
First Language
French
Primarily Uses
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
$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.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top