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,688
Reaction score
13,321
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

How do you cure sleep problem? It has been 7 months and it's 3 AM now..
Darn you, Seals! Why do you gotta be so cute when on land?:kaoluv:
So dragonbones getting laggy xD
I even removed the fingers armatures.

Have to remake this guy after crashing ( corrupted file).
:rtear:

Although limited to only this shop for room decorations, I like this aspect for previewing items.
So yesterday I got a follower (follow my NSFW art account) who dmed me and said to me :
if you continue to be friends with [name of the artists] which make me uncomfortable I will have to unfollow and I am like :
... do it?

Forum statistics

Threads
100,837
Messages
980,115
Members
132,485
Latest member
jenifer027
Top