YEP_EventChasePlayer does not make the Event go back to the original position after switching Event Page.

xpluffy

Villager
Member
Joined
Jul 3, 2016
Messages
13
Reaction score
0
First Language
English
Primarily Uses
Hi, I am trying to use the plugin, YEP_EventChasePlayer, to be able to chase the player at LOS proximity. When the Event touches the player, it initiates a battle sequence. When the player chooses ESCAPE, it will pause the Event, allowing the player to have time to get out of sight. When the player is out of the Event's chase range, the Event will go back to its original position by calling Yanfly's $gameMap._events[this.eventId].startReturnPhase() via script command.
Handling Chase sequence:
1589567915062.png
Handling Battle sequence after escaping:
1589567981072.png
Now, this only works if I am using a single Event page. But, when I try to use multiple pages, it no longer put the event back to it's original position.
I am super new to writing codes, but I tried to do a bit of google to understand simple things. And I realized the variables $gameMap._events[this.eventId]._startLocationX and $gameMap._events[this.eventId]._startLocationY gets updated every time the Event switch pages, at least that is what the console log is showing. These two variables are being use by startReturnPhase(). For some reason every time the Event switch pages, it updates the location to where the Event is now after the chase sequence happen instead of just leaving it a lone. I am not sure what I'm doing at the moment, but I thought adjusting the code to something like this would work:
1589568164163.png
but it does not seem to. Any help would be appreciated.
 

Attachments

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
535
First Language
English
Primarily Uses
N/A
Have you tried storing the spot where the event detected the player into variables? Then, when the event switches back. There might be a way to refrence those variables to tell the event where to go

Edit: The downside to this method is you wouldn't be able to do too many of these events on a map unless you also use a self variables script
 

xpluffy

Villager
Member
Joined
Jul 3, 2016
Messages
13
Reaction score
0
First Language
English
Primarily Uses
Have you tried storing the spot where the event detected the player into variables? Then, when the event switches back. There might be a way to refrence those variables to tell the event where to go

Edit: The downside to this method is you wouldn't be able to do too many of these events on a map unless you also use a self variables script
So ended up using a self variable scripting, as you said. I'd mess and watch a 3-hour tutorial on how Javascripting works, and I edited Yanfly's YEP_EventChasePlayer plugin, and it seems to work now. The Event store's original location at $gameMap._events[this.eventId]._newLocationX and Y. The Event chases the player. On Event touch, it switches to an event page to handle battle and escape sequences. On escape, Event pauses, giving the player to get out of the Event's chase range.

Here's what I add and change just in case anyone spots anything wrong with it or better recommendation.
1589588381960.png

1589588432269.png
1589588491830.png
Handling Chase sequence:

1589567915062.png


Handling Battle sequence after escaping:

1589567981072.png
 

Attachments

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top