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

Joined
Jul 12, 2020
Messages
111
Reaction score
20
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,789
Reaction score
7,876
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
111
Reaction score
20
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
111
Reaction score
20
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,789
Reaction score
7,876
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,846
Reaction score
1,599
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.
 

Latest Threads

Latest Profile Posts

I remember once when I was at Disney's Animal Kingdom and I got to dance with some of the cast members! It was so much fun! After the show my dad and I got frozen lemonade and some ice cream. It makes me feel better remembering the good things about my dad... maybe I will return to Orlando.
spending almost entire day to mod skyrim but it still couldn't run properly :(
My friend has become one with the glitter. @ImaginaryVillain, got any room in the Cult of the Sporkle?
I still cannot wrap my head around how to edit and use arrays in RPG Maker MV o_O
Gamemaking has been slower, but I do my best to make small progress every day. :)

Forum statistics

Threads
107,717
Messages
1,031,631
Members
139,856
Latest member
ShadowGray
Top