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

Joined
Jul 12, 2020
Messages
95
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,246
Reaction score
7,625
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
95
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
95
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,246
Reaction score
7,625
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,496
Reaction score
1,082
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

Oh no. That moment when you try to fix something you modified in your game, like, a year ago but didn't want to fix then, and you now have no idea what you even did. Me right now, trying to figure out why my gold window is over stretched?
LittlePIGGY wrote on atreyoray's profile.
Where are you TT^TT
We need ARP_InGameManual for MZ
Oh my gosh. Thank you, Macy's! Thank you so much! You have made me very happy!
Happy Thanksgiving everyone! What are you thankful for? I'm thankful that I no longer have PTSD, and that I get to enjoy a good meal with my mom and stepdad! It might not be the same as before COVID, but at least I still get to enjoy the holiday!

Forum statistics

Threads
105,550
Messages
1,014,568
Members
137,225
Latest member
Eryndor
Top