How to create a temporary Parallel Process Event at the start

Status
Not open for further replies.

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
This seems like it would be easy, but it's giving me some problems.  

I have a parallel process event I want to run every time the player re-enters the game.  But I don't want it to loop.  

My initial way of dealing with this was I created a loop in my parallel process after the initial sequence that I did not want to loop.  That worked.  But it seems that creating a loop within a parallel process causes my game to lag unacceptably.  So I need to find a work around.  

Any suggestions? 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
you need to switch from the non-looping parallel process to a different event page with the looping part of the parallel process after the one-time-sequence had been executed.


And no, you should never use the loop command inside a parrallel process unless you know exactly what you're doing and know how to prevent lag in that (which means that a loop command on a parallel process page is almost everytime wrong).


Edit:


Alternatively however you can part that into two events and have the first one erased after it was run, then it will run again once the player enters the same map again.


Depends on what exactly you want to be done.
 
Last edited by a moderator:

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
you need to switch from the non-looping parallel process to a different event page with the looping part of the parallel process after the one-time-sequence had been executed.

Edit:

Alternatively however you can part that into two events and have the first one erased after it was run, then it will run again once the player enters the same map again.

Depends on what exactly you want to be done. 
I tried this.  But the problem is I didn't know of a way to turn the switch OFF when the player exists the game so the sequence will run again when the player re-enters the game.

Is there a temp.switch I don't know about?

Response to the Edit:

I tried erase event also.  The problem with that though is the event seems to stay erased unless the player leaves the map itself and then re-enters.  Exiting the game itself doesn't appear to reset it.  And I need the event to run each time the player re-enters the game on the same map.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
so you mean like if I save right now and exit, then restart the game (so I'm still on that same map), the sequence should restart?


Hmm... probably use a switch, then go to the load script and add a line to switch off the switch ($game_switches[id] = false)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I would set it as a parallel process common event (assuming you want it to run regardless of which map you're on), conditioned by a switch. Turn the switch on initially if you want to run it when a new game is started. Then edit your DataManager.extract_save_contents method to turn the switch on - make it look like this:

Code:
  def self.extract_save_contents(contents)    $game_system        = contents[:system]    $game_timer         = contents[:timer]    $game_message       = contents[:message]    $game_switches      = contents[:switches]    $game_variables     = contents[:variables]    $game_self_switches = contents[:self_switches]    $game_actors        = contents[:actors]    $game_party         = contents[:party]    $game_troop         = contents[:troop]    $game_map           = contents[:map]    $game_player        = contents[:player]    $game_switches[id]  = true  end
And you're right - you should not have a loop encompassing the whole block of code inside a parallel process or autorun event, as they loop by default.
 
Last edited by a moderator:

Berylstone

Veteran
Veteran
Joined
Jun 3, 2013
Messages
642
Reaction score
62
First Language
English
Primarily Uses
This worked perfectly.  

Thank you both for the help, appreciate it.  Especially for the added details on how and where to edit the script contents, else I would have probably messed this up.
 

Fomar0153

Arkz
Restaff
Joined
Mar 13, 2012
Messages
1,327
Reaction score
473
First Language
English
Primarily Uses
RMMZ
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top