Parallel Interrupt

MerlinCross

Veteran
Veteran
Joined
Jun 8, 2015
Messages
149
Reaction score
57
First Language
English
Primarily Uses
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?
 

Hyouryuu-Na

Procrastinator
Veteran
Joined
Jun 15, 2017
Messages
769
Reaction score
1,731
First Language
Not English
Primarily Uses
RMMV
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.
 
Last edited:

MerlinCross

Veteran
Veteran
Joined
Jun 8, 2015
Messages
149
Reaction score
57
First Language
English
Primarily Uses
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.
 

Ace of Spades

Veteran
Veteran
Joined
Jan 19, 2017
Messages
138
Reaction score
199
First Language
English
Primarily Uses
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,930
Reaction score
13,567
First Language
English
Primarily Uses
RMMV
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.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
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');
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,804
Reaction score
1,264
First Language
EN
Primarily Uses
RMMZ
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);
 
  • Like
Reactions: Bex

MerlinCross

Veteran
Veteran
Joined
Jun 8, 2015
Messages
149
Reaction score
57
First Language
English
Primarily Uses
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?
 

Hyouryuu-Na

Procrastinator
Veteran
Joined
Jun 15, 2017
Messages
769
Reaction score
1,731
First Language
Not English
Primarily Uses
RMMV
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.
 

MerlinCross

Veteran
Veteran
Joined
Jun 8, 2015
Messages
149
Reaction score
57
First Language
English
Primarily Uses
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.
 

Hyouryuu-Na

Procrastinator
Veteran
Joined
Jun 15, 2017
Messages
769
Reaction score
1,731
First Language
Not English
Primarily Uses
RMMV
Can you post screenshots of every page related to this system? There's got to be something wrong somewhere.
 

MerlinCross

Veteran
Veteran
Joined
Jun 8, 2015
Messages
149
Reaction score
57
First Language
English
Primarily Uses
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.
 

Hyouryuu-Na

Procrastinator
Veteran
Joined
Jun 15, 2017
Messages
769
Reaction score
1,731
First Language
Not English
Primarily Uses
RMMV
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Recent threads, and my very poor algorithm for my minimap plugin have made me face the fact that I need to review algorithms and such.

Going through Cracking the Coding Interview now. I am so excited.
Kes
I've seen a reference to a Community Lighting plugin for MZ, but cannot find it. Is it still in beta?

Todo:
Add fog of war
Add enemy indicators
Make window draggable
Optimise map drawing algorithm (5 seconds to load the map you see, so it's a... poo-poo algorithm)

Any suggestions? :kaoblush:
bleh studio hell job haha at least they like it didnt had time to do much laundry tho ;w;'....YES I DO AT LEAST TAKE A SHOWER everyday!
Ami
--- Food Ingredients ---

Hero: Since the Chef are in Hospital,we can't eat his Dish in 3 Days.
F.Mage: What we have to Eat?
M.Healer: Don't worry,we can Eat the Food Ingredients.
Hero & F.Mage
: Really?

(3 Days Later)

Chef: Hi,Guys. I'm Ba---
(Entire Party Collapse After Eat Raw Meat)
Chef: Wha...WHAT GOING ON HERE!!!!!!

Forum statistics

Threads
102,913
Messages
995,920
Members
134,363
Latest member
Wilsonliz
Top