parallel process won't always work as intended...

seyfer110

Veteran
Veteran
Joined
Jan 9, 2014
Messages
32
Reaction score
1
Primarily Uses
Hello!
So...I have a little issue with a parallel process event:
The idea is to make a "stealth run" minigame, where the player must avoid the people's sight view range.
The problem is that sometimes the event actually trigger while I move in front of it, while other times I can just walk past it without any response...
bandicam 2020-07-06 18-52-38-079.jpg
The first conditional brach script is this:
Code:
($game_map.events[@event_id].y - $game_player.y).abs <= 3 && $game_map.events[@event_id].x == $game_player.x || ($game_map.events[@event_id].x - $game_player.x).abs <= 3 && $game_map.events[@event_id].y == $game_player.y
while the second one is this:
Code:
$game_map.events[@event_id].direction == 2 && $game_map.events[@event_id].y < $game_player.y || $game_map.events[@event_id].direction == 8 && $game_map.events[@event_id].y > $game_player.y || $game_map.events[@event_id].direction == 4 && $game_map.events[@event_id].x > $game_player.x ||  $game_map.events[@event_id].direction == 6 && $game_map.events[@event_id].x < $game_player.x
Any idea what the problem might be?
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
561
Reaction score
273
First Language
German
Primarily Uses
My first guess would be that the gap between two position checks might be too big.

Assuming normal movement speed the player character needs 16 frames to walk one tile or 8 frames when dashing. If your conditional branch is run less frequently than that the player would be able to walk past the event when the timing is right.

Currently the gap between two conditional branch checks includes waiting for an animation (animation frames times 4 plus 2) and a short delay after the event finishes before it is restarted (2 frames). Assuming the player is allowed to dash your animation would need to consist of a single frame to meet the schedule.

One way to solve this might be to split the event, having one parallel process to update the animation and one for checking the players position.
 
Last edited:

seyfer110

Veteran
Veteran
Joined
Jan 9, 2014
Messages
32
Reaction score
1
Primarily Uses
I'm a total noob when it comes to script (I found this one around here on the forum) can you help me sort this out, please?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,672
Reaction score
13,282
First Language
English
Primarily Uses
RMMV
Put proper parentheses around your conditions.

You've got an && and an || and another && in the first one, and even more in the second, with nothing to say which ones belong together.
 

seyfer110

Veteran
Veteran
Joined
Jan 9, 2014
Messages
32
Reaction score
1
Primarily Uses
It seems like the culprit was the "wait until done" on an animation;
I'll do a bit more tests, but that seemed to be the main culprit.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

And back. Trying to work online with no internet for 1.5 days was...interesting. I felt like a character in a old Sierra game trying to find internet due to all the hoops I had to jump through just to get online for work.
grief... if MV didn't have certain plugins already, I think I'd upgrade to MZ. seeing like 10 MV plugins in 1 MZ one is hilariously convenient lol.
Have you already checkes out my mapping tutorial on the blog? I would love to hear your feedback and things you'd like to see in the future!

one of character for my upcoming game idk how to design o_O

Designing patches that can 'augmented' to clothing based armor. Such good fun. A bit time consuming due to the need to create image displays, but the patches are limited so it's not too tiring.
Note: lol, posting this made me find a couple mistakes.

Forum statistics

Threads
100,737
Messages
978,948
Members
132,359
Latest member
PhilKeepItReal
Top