Parallel Interrupt

Unsure how to do this. Or at least how to process this.

Say I want to have a sleeping guard that has the "ZZZ" bubble above his head so players know he's sleeping. If they interact with him, they get a text box that has him mumbling info before resetting back to his sleeping state.

To have him with the sleeping bubble, I use Parallel process. This makes sense but then I'm stuck in how do I break it out of that even before going back to it. I suppose I could have events next to him that flip a switch on the Sleeper's event to shift him out of Parallel but that could be adding in far more events than I want.

Ideas?
So you want to have one event and you can't figure out how to interrupt it when the player interacts?
I guess you can check for the player and the guard's distance in the same parallel event.
You can store the distance in a variable like this:
Code:
$gameVariables.setValue(x,$gameMap.distance($gameMap.event(this.eventId()).x, $gameMap.event(this.eventId()).y, $gamePlayer.x, $gamePlayer.y));
Or you can just skip the variable and do this:
Code:
var dist= $gameMap.distance($gameMap.event(this.eventId()).x, $gameMap.event(this.eventId()).y, $gamePlayer.x, $gamePlayer.y);
if (dist==1 && Input.isTriggered('ok')){
$gameSelfSwitches.setValue([this._mapId, this.eventId(), 'A'], true);
}
When the distance is 1 AND when player presses enter (you want to check for interaction), you can turn on a self switch which takes you to a new event page where the guard is awake/mumbles stuff. After the show text, turn the self switch off. Now the guard should go back to sleep.
There might be an easier way but this is what I can come up with now.
So you want to have one parallel event and you can't figure out how to interrupt it when the player interacts?
I guess you can check for the player and the guard's distance in the same parallel event.
You can store the distance in a variable like this:
$gameVariables.setValue(x,$gameMap.distance($gameMap.event(guard).x, $gameMap.event(guard).y, $gamePlayer.x, $gamePlayer.y));
When the distance is 1 AND when player presses enter (you want to check for interaction), you can turn on a self switch which takes you to a new event page where the guard is awake/mumbles stuff. After the show text, turn the self switch off. Now the guard should go back to sleep.
There might be an easier way but this is what I can come up with now.

Actually I figured out a work around after sitting there looking at it and going "Oh wait. I'm dumb."

I simply put an event on the floor(Below player) and had that intractable. When stepping up to the Guard, a player will try to talk and get the Ground event to fire instead.

Still might want to ask this question sooner or later. I've only used Parallels to move more than one event at a time.
So when you say the player interacts with the guard, do you mean they walk up and press the action key, then he plays his message? If that's the case, just turn on a switch right before the message plays, and turn it back off after the message. On your Parallel Process event that's playing the sleeping emote, have a 2nd blank page that activates when the switch is On.
I would have just done a script call in the autonomous movement for the Zzz bubble, and left the event with an action button trigger, the mumbling, then ended with a Set Movement Route back to the Zzz bubble again, set to repeat.

No extra event, no parallel process.
Shaz means this on Line 96 of the Scriptcall list. This List is very helpful.
Code:
character.requestBalloon(id); this.setWaitMode('balloon');
Replace character with one of these: $gamePlayer; $gameMap.event(ID);
For example: $gameMap.event(6).requestBalloon(3); this.setWaitMode('balloon');
Shaz means this on Line 96 of the Scriptcall list. This List is very helpful.
Code:
character.requestBalloon(id); this.setWaitMode('balloon');
Replace character with one of these: $gamePlayer; $gameMap.event(ID);
For example: $gameMap.event(6).requestBalloon(3); this.setWaitMode('balloon');
Note that the this keyword is context-dependent. In a move route script, this would be simply:
JavaScript:
this.requestBalloon(3);
And now I can't seem to figure out how to move away from Parallel firing event.

20200813184006_1.jpg

What happens is that the guard has a sleeping icon above his head while the group runs around. But no matter what I do, this process will continue to run. That's fine it's what I want.

But then say I want the guard to wake up, or remove his model after a fight. Nope. Parallel keeps firing. Even with the Erase event command it's still firing. Does Parallel superseded everything else? How do I actually stop this?
You should do what Shaz said and use Custom autonomous movement instead of parallel. Much easier.
But considering your issue, turn on a self switch and make a new event page with that self switch as condition.
You should do what Shaz said and use Custom autonomous movement instead of parallel. Much easier.
But considering your issue, turn on a self switch and make a new event page with that self switch as condition.

I tried that. Didn't work. No matter what page I sent the event to, the bubble that was on the Parallel process would remain.

I could try the scripting method but might also have to rework the entire set up now.
Can you post screenshots of every page related to this system? There's got to be something wrong somewhere.
Can you post screenshots of every page related to this system? There's got to be something wrong somewhere.
*flip table*

Oh it works now. Grumble grumble grumble. Must have been just small but important piece I didn't flip on or put the right number in to the point I missed it the first ime around. Setting it up a second time seems to have worked.
XD Pay attention to variable numbers/self switches. People make lots of silly mistakes if they don't and run around thinking what's wrong for a long time ^^ Anyways, good to know it's solved.

Original thread: https://forums.rpgmakerweb.com/threads/parallel-interrupt.125167/