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
216
Reaction score
176
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
216
Reaction score
176
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

Surprising nobody, it turns out "next Friday" for the next Jump into Javascript has become "possibly Sunday if you're lucky" XD
Folks, if anyone sends you a message inviting you to add their API to your game, please report them. We don't want people spamming our members asking them to add stuff to their games for their own (or others') benefit. We've updated the forum rules to confirm this.
I'm listening to iiluminaughtii talking about the secrets behind shady businesses and scams. Meanwhile I'm writing a fanfic about Sephiroth from FF7, one specifically for my stepmom. I'll get to give it to her, too, because my boss said I could take the holidays off! Dec. 22-27 I will be in Orlando, and maybe Fort Myers too, visiting my dad and stepmom!
Of course, I bought a handful of games on the Steam Black Friday sale. Will I try them? Will I complete any? Who knows...
I don't really have any neat updates today about how I screwed up programming... But if you want to observe the intensenes of me programming, then you can check out my stream :)

Forum statistics

Threads
117,013
Messages
1,103,814
Members
152,911
Latest member
WakeNBake
Top