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,283
Reaction score
7,635
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,283
Reaction score
7,635
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,520
Reaction score
1,111
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

All of the auditions for our game are so good, I'm so glad I'm not in charge of choosing completely. lol I just can't with some of them. I listen to them on repeat. XD
Working on a Patch to integrate AlphaABS into random generated Dungeons. Was a bit tricky, but the outcome is a real Life Changer!!

Will release it the next days!
Been pretty busy... but I got a better headset for recording and listening today. Dad says that he'll consider taking me to Great Wolf Lodge for the first time once I finish summer classes (my final semester!) I'll be taking my plushie friends with me: Bendy, Lolbit, and Helen Henny. (I WUV PLUSHIES!)
SF_Monster3,4 added!


My only regret is the portal mirror effect is too subtle to show up in these GIFs. It probably just needs more sparkles. :LZSwink:

Forum statistics

Threads
105,651
Messages
1,015,292
Members
137,327
Latest member
Mezzy
Top