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
562
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,950
Reaction score
13,585
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 Profile Posts

Hello folks, I'm an old member deciding to reenter the forum. Greetings :D
When a parent (of a less than adult aged child) is like
"Oh, I'm like a friend to my child. We're friends."
I'm like
"Oh, that kid's gonna suck...."
Baby tiger gets a belly rub! ^.^
Ami
--- Friendship System ---

(F.Mage and F.Healer's FP is 100)
F.Mage: We did it! we can beat the monster easily!
F.Healer: With the Friendship System,we got stronger thanks to you F.Mage (Hugging)
F.Mage: (Blushing) Ahh...don't say like that. we are Best Friend Forever.
(In Distand)
M.Mage: They look happy...
M.Healer: Yeah...always like that...

Forum statistics

Threads
103,286
Messages
998,593
Members
134,796
Latest member
CotE
Top