How do I...make it to where Custom Routes don't repeat after interaction?

Joined
Jul 12, 2020
Messages
96
Reaction score
18
First Language
English
Primarily Uses
RMMV
Here's a glimpse:

There's something that has a custom route (moving back and forth, repeating movements and skipping them if they can't move). This is an obstacle that travels with a priority set to "below the player"/


If the player touches it, something bad happens.


Unfortunately, I noticed that after the player touches the obstacle, its movement route resets! So it completely throws off any setups I can make out of the obstacle if I align it a certain way.
How do I fix this?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
not possible in default

there are a few tricky ways that use plugins for solving that problem, like adding a pathfinding plugin and then using that pathfinding script instead of a fixed moveroute, but it all depends on what exactly the event does - different situations may require different solutions...
 
Joined
Jul 12, 2020
Messages
96
Reaction score
18
First Language
English
Primarily Uses
RMMV
not possible in default

there are a few tricky ways that use plugins for solving that problem, like adding a pathfinding plugin and then using that pathfinding script instead of a fixed moveroute, but it all depends on what exactly the event does - different situations may require different solutions...
Ahh, I see. How unfortunate.

Yeah, the only thing the obstacle does is inflict the player with a bad status, and take away some HP. It kind of sucks cause like, I just want the obstacle to continue staying on its designated pathway even after the player accidentally touches it, but like you said...there's no way to do it by default it seems.

Do you know any possible plugins?
 

AdeptusUK

Veteran
Veteran
Joined
May 27, 2020
Messages
63
Reaction score
15
First Language
English
Primarily Uses
RMMV
Can you not do this by tracking the event X/y and the player X/y and running a parallel event on the map that checks for them to be the same and then applies the state/damage if they are? That way you're not interrupting the event's move path scripting.

Just off the top of my head, not able to test the theory currently.
 
Joined
Jul 12, 2020
Messages
96
Reaction score
18
First Language
English
Primarily Uses
RMMV
Can you not do this by tracking the event X/y and the player X/y and running a parallel event on the map that checks for them to be the same and then applies the state/damage if they are? That way you're not interrupting the event's move path scripting.

Just off the top of my head, not able to test the theory currently.
I see what you mean, though I'm not really sure how to tell the game to keep track of the (x,y) of the 2 events + player.
Also, wouldn't that cause lag?

I think it could be a potential solution for this one instance, but it miiiight be a bit of a stretch to use.
 

AdeptusUK

Veteran
Veteran
Joined
May 27, 2020
Messages
63
Reaction score
15
First Language
English
Primarily Uses
RMMV
You can actually just do it like this rather than tracking with variables. I'd be surprised if this was enough to cause lag on its own as it's quite a cheap operation for the processor.

JavaScript:
if ($gamePlayer.x == $gameMap.event(EVENT_ID).x && $gamePlayer.y == $gameMap.event(EVENT_ID).y){

//do stuff

}
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
'd be surprised if this was enough to cause lag on its own as it's quite a cheap operation for the processor.
the problem is not how much processing time a single iteration costs - that isn't much difference compared to using event commands and variables either.

the problemis how often the check is repeated per second, and that doesn't depend on either the script or the variables. That depends on how many waitframes are set for the parallel process.

For such a check I would suggest between 5 and 10 waitframes - you'll have to experiment a little because the optimum depends on what else happens on that map.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,627
Reaction score
1,196
First Language
English
Primarily Uses
RMMV
Maybe try 2 separate events, one for the dmg/state application and the other for the custom move route.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

On my journey of character rework: I had this character, she was meant to be just a princess that joins your party. And at long term she was just uninteresting... So I tweaked her to be a rebel agaisn't the royalty before meeting up with the party.

Quick tip for any other ametuer pixel artists! When trying to create a colour palette, enabling Antialiasing can speed up the process of creating different shades! Just place your lightest colour and your darkest colour next to each other, select both pixels, and stretch it out!
Revolutionizing the JRPG Industry: Knocking on Doors.

Take that, murderhobos.
Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.

Forum statistics

Threads
106,054
Messages
1,018,580
Members
137,843
Latest member
Betwixt000
Top