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,949
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 Posts

Latest Profile Posts

Ok i got the model New and I will develop a little more, I think my SV is not beautiful yet.
"I, Giorno Giovanna, have a dream". In all seriousness, spatial BGM feature is now complete for my audio plugin.
Stream will be live shortly with some game development followed by the return of the Interactive Text Adventure after a short hiatus! Feel free to drop by!
Lately, I've taken to smashing random nouns/verbs together as insults. It's sort of amusing how many people don't really know how to respond to that. You bottle shaker!
Would be nice to pick color code that is not exclusively for message event

Forum statistics

Threads
103,243
Messages
998,317
Members
134,734
Latest member
Avaross
Top