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,660
Reaction score
13,268
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

Finding it amusing that people are posting support questions in new threads for an engine that isn't even released yet. Touch and Archeia are the only ones authorised to say anything, and there's only one active thread where they'll be answering questions.
I think my goal for MZ ... is to actually release a game and not have twenty technical demos and debugging projects. Let's see if I can manage that. ;o
I am starting to enjoy writing. I never thought I would enjoy it since my dyslexia was holding me back so much.
Thanks to the community here :)
For those interested chapter 2 and 3 are available to read here:
I'm having a fun time working with the MZ RTP. The waterfall hasn't changed, though, so I'm wondering if they didn't make a new one or if they forgot to put it in...

good progress on the typescript Definitions files almost done all the Manager and yet I still have to do the Battle Manager...who is seriously so much data lol

Forum statistics

Threads
100,651
Messages
978,090
Members
132,260
Latest member
enciasduras
Top