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

Accendor

Veteran
Veteran
Joined
Aug 24, 2015
Messages
230
Reaction score
62
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
217
Reaction score
177
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
99
Reaction score
181
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
230
Reaction score
62
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,502
Reaction score
413
First Language
German
Primarily Uses
RMMV
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
217
Reaction score
177
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 Posts

Latest Profile Posts

Well, someone "reviewed" my game. Didn't credit me anywhere in the video and spent 2 minutes insulting it. Going to ignore that and move on.
To cut down on map lag, I've been researching how to implement a lighting layer as a single map overlay instead of a bunch of individual lights. Hopefully I'll have a screenshot soon!
Imagine having a game broken up into a whole bunch of chapters? Like Chapter 11 should be about the party members going bankrupt.
Over 1/4th of the calendars are already out :eek: Have you already put something to a good use?

Forum statistics

Threads
117,261
Messages
1,105,921
Members
153,431
Latest member
shadowking1901
Top