Event that go throught player but collide with everything else

DarielZer0

Villager
Member
Joined
Oct 16, 2021
Messages
27
Reaction score
8
First Language
Spanish
Primarily Uses
RMMV
i want to make a event that collide with other events and walls but go throught the player. it's possible?
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
1,544
Reaction score
1,034
First Language
Polish
Primarily Uses
RMMV
Yes. It's possible, but there are two major questions before implementing such feature:

#1 Does player can interact with that event later?
#2 Are there more than 1 such events on map?

If there is only one event you want to apply then you need to create an empty parallel event on map and in Script... option paste this code:
Code:
this._px = $gamePlayer._x; //Get X position of player
this._py = $gamePlayer._y; //Get Y position of player
this._ex = $gameMap.event(eventId).x; //Get X of your specific Event
this._ey = $gameMap.event(eventId).y; //Get Y of your specific Event

then in event you need to use Conditional branch and in 4th tab select Script and type:
Code:
$gameMap.distance(this._px, this._py, this._ex, this._ey) <= 1
Remember to check option Create Else Branch and below Script type:
Code:
$gameMap.event(eventId)._through = true;
and finally below Else type
Code:
$gameMap.event(eventId)._through = false;

Remeber to keep this event parallel otherwise it won't trigger.

Whole empty event should look like this:
xO3LjHt.png


(in place of number 99 and eventId you put ID of your event you want to make it through player, but collide with everything else.
 
Last edited:

DarielZer0

Villager
Member
Joined
Oct 16, 2021
Messages
27
Reaction score
8
First Language
Spanish
Primarily Uses
RMMV
Yes. It's possible, but there are two major questions before implementing such feature:

#1 Does player can interact with that event later?
#2 Are there more than 1 such events on map?

If there is only one event you want to apply then you need to create an empty parallel event on map and in Script... option paste this code:
Code:
this._px = $gamePlayer._x; //Get X position of player
this._py = $gamePlayer._y; //Get Y position of player
this._ex = $gameMap.event(eventId).x; //Get X of your specific Event
this._ey = $gameMap.event(eventId).y; //Get Y of your specific Event

then in event you need to use Conditional branch and in 4th tab select Script and type:
Code:
$gameMap.distance(this._px, this._py, this._ex, this._ey) <= 1
Remember to check option Create Else Branch and below Script type:
Code:
$gameMap.event(eventId)._through = true;
and finally below Else type
Code:
$gameMap.event(eventId)._through = false;

Remeber to keep this event parallel otherwise it won't trigger.

Whole empty event should look like this:
xO3LjHt.png


(in place of number 99 and eventId you put ID of your event you want to make it through player, but collide with everything else.
i already did something similar to this,only that i did it with variables but the result is almost the same,when i am 1 grid of distance the event go through everything and since it moves in ramdom directions sometimes it get stuck in a wall or another event,and also there are multiple events of this kind in the map
 

Latest Threads

Latest Profile Posts

Mcniner wrote on Umbriel's profile.
Hello! It seems the Zelda sprites you sent me were removed by a moderator. Could you gmail them to me here: steinjaltman@gmail.com? Thanks!
Remember to do your 0,01% progress on your game today!
Went to see Jujutsu Kaisen 0 yesterday, it was cool. The movie wasnt really a masterpiece, it had some pacing and characterization problems, but overall I enjoyed it, maybe because it was the first anime film I have ever been to in the cinema lol. The battle animation & music were top-notch. I havent seen much of the anime so people who watched the entire season would probably like it more.
MainMenu.PNG
Finally satisfied with the main menu xD

The plan was to have battle sprites in the menu...But these faces from Ocean's Nostalgia look pretty damn good imo. (Will have to adjust for them ofc and maybe recolor to match the overworld/battle sprites more)

Forum statistics

Threads
121,996
Messages
1,145,770
Members
160,264
Latest member
diexue
Top