Possible to stop the execution of a common event during other events?

Accendor

Veteran
Veteran
Joined
Aug 24, 2015
Messages
242
Reaction score
71
First Language
german
Primarily Uses
N/A
I have a common event that updates some player stats in the background every few seconds.
I would like to pause that during the execution of other events.

I know I can simply turn of the switch that is used or it and activate it again once I am done, but this seems like a lot of work for every single interactive event I would like to put in the game.

Is there a more simply way to do this?
 

FirestormNeos

Veteran
Veteran
Joined
Jul 23, 2019
Messages
274
Reaction score
254
First Language
English
Primarily Uses
RMMV
iirc parralel process events don't run when a non-parallel-process event is running, so maybe just make the common event a parralel process, while making all the events you don't want it active during to be non-parallel process?
 

spec3

blep
Veteran
Joined
Jun 20, 2020
Messages
49
Reaction score
108
First Language
portuguese
Primarily Uses
RMMV
Maybe it's not exactly what you are looking for, but can help you figure something out.
You could use a variable gate that "locks" conditions you want to stop and only "free" them whenever you want them to be free. See spoilers for example.

common event:

Code:
things you want to run always go here
    if var a = 0
        then run whatever you want and need it to stop sometime
        var a = 1
    else
        (you could also put any other condition you want here if you want it, ignore this else if you want it to change it in the events on the map)
        var a = 0

This way you can set a lot of conditioning to your parallel events.
 

Devildimos

I ruin memes for a living
Veteran
Joined
Jul 11, 2014
Messages
109
Reaction score
182
First Language
Eglish
Primarily Uses
RMVXA
I use something similar but I do it with my curse effects.
The 0051 switch (Pause Effects) will simply pause the effects of everything but the Parallel is still running. In which you can update more things during the pause.
This pause effect can be a variable.
Parallel Pro.png
 

Accendor

Veteran
Veteran
Joined
Aug 24, 2015
Messages
242
Reaction score
71
First Language
german
Primarily Uses
N/A
iirc parralel process events don't run when a non-parallel-process event is running, so maybe just make the common event a parralel process, while making all the events you don't want it active during to be non-parallel process?

They actually do. The Common event is a parallel process and while it does not actively do something DURING the event, it "stores" the event and then executes it afterwards.
E.g.:
There is a common event running ni the background that lets the main actor lose 10HP every 5 seconds.
If you now create a simple event (e.g. a text message) that is NOT a parallel process the HP will not be subtracted immediately, but accumulate in the background.
E.g. if you now let the message box open for 20 seconds, the main actor will lose 40HP as soon as you close it and the common event "ticks" the next time.
The desired result here would be of course that the next "tick" again just removes 10HP and not all that was "lost" before.

The other two suggestions are basically what I am already doing - just a little different, but it does not really change the amount of "unnecessary" work.
I mean in the end it is not really a bit problem, I was just hoping there might me an even more simple solution.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,907
Reaction score
731
First Language
German
Primarily Uses
RMMZ
What the others said , but with a Scriptline used in Eventcommand.
Sadly this is for VX-Ace and some is fantasy code, someone would need to translate it:

If game message is busy?
if yes do: Fiber.yield while $game_message.busy?
else do OPs code...
 

FirestormNeos

Veteran
Veteran
Joined
Jul 23, 2019
Messages
274
Reaction score
254
First Language
English
Primarily Uses
RMMV
They actually do. The Common event is a parallel process and while it does not actively do something DURING the event, it "stores" the event and then executes it afterwards.
E.g.:
There is a common event running in the background that lets the main actor lose 10HP every 5 seconds.
If you now create a simple event (e.g. a text message) that is NOT a parallel process the HP will not be subtracted immediately, but accumulate in the background.
E.g. if you now let the message box open for 20 seconds, the main actor will lose 40HP as soon as you close it and the common event "ticks" the next time.
The desired result here would be of course that the next "tick" again just removes 10HP and not all that was "lost" before.

oh. glad i figured that out now, or playtesting would've been... yikes.
 

Latest Threads

Latest Profile Posts

I was surprised to see a email from Safeway that my grocery have been delivered when they have not. The email was a noreply message. So enjoy the $88 of free food random person.
Well friends, I'm happy to announce that I've officially completed 1 plugin and am running compatability tests and writing the documentation for the second tomorrow morning!
Vegan post. Pic of a pig in a suit and tie like he is laying in a coffin but it's a sandwich. 'One meal soon forgotten, in exchange for a whole life." Really don't think rolling around in poop your whole life would be so valuable.
Guys, Tutorials is for posting tutorials you have written, not for asking for help. Use the Support forums for that please.
Trailer is almost done for the game i can't wait to show it to everyone

Forum statistics

Threads
129,868
Messages
1,205,801
Members
171,040
Latest member
Otshhi
Top