RPG Maker VX Ace

RPG Maker VX Ace

View Stats:
95tyza Feb 8, 2019 @ 8:18pm
Continuous Event Processing
Sorry If this has been answered before, but I couldn't find anything on it. I am still pretty new to RPG Maker VX Ace. I am trying to figure out how to have time pass in all maps because the amount of time that has passed triggers certain events.

For example, I have a disease that I want to spread according to the amount of time that has passed, not tied to any specific event, whether the player sits there for 20 seconds or whether they go do things for 20 seconds the same outcome will happen.

At first i just created a general parallel process event to wait and then activate switches, but it doesn't work if i leave the map so I tried to create a common event with a wait command for 10 seconds that would turn on a switch and then another 10 seconds to trigger a separate event. If i just stand there everything seems to work fine, but If i leave that map and then wait the time it doesn't always work or if i leave the map and come back it'll still work but will take like 30 seconds after I get back. I tried calling the event and I've also tried it as a parallel process, but i can't seem to get it right.

So to summarize I want certain people (events) to get "sick" after a period of time and then to "die" after another period of time. I am ok with people not being sick at the same time if that's too complicated i.e. people can die and then get sick one at a time
< >
Showing 1-7 of 7 comments
Hajami Feb 9, 2019 @ 3:03am 
If i remember correctly, Common Events restart after a Mapchange.
So if you leave the Map, it isnt restarting the whole 10 Seconds Wait but only 1 Second in the following example:
----------------------------------------------------------------------------------------------
Paralell Common Event: (Activate at Game Start with its own Switch)

Wait 60 Frames
If Switch1 NPC_Berta_infected is On
yes: Control Variable1 add 1
If Var1 equals or more than 10
yes: Set Var1 to 0, Control Switch1 Off and Turn Switch11 ON (NPC Dead)
end

If Switch2 NPC_Hinkel_infected is On
yes: Control Variable2 add 1
If Var2 equals or more than 10
yes: Set Var2 to 0, Control Switch2 Off and Turn Switch12 ON (NPC Dead)
end

If Switch3 NPC_Siegfried_infected is On
yes: Control Variable3 add 1
If Var3 equals or more than 10
yes: Set Var3 to 0, Control Switch3 Off and Turn Switch13 ON (NPC Dead)
end
-------------------------------------------------------------------------------------------

When the NPC gets infected, turn its Infection Switch On, and create a Eventpage with Page condition Switch NPC Dead is ON. You could revive your Events by turning the Dead Switch Off and they could also be reinfected and Die again.

This is just a simple solution, for a smal amount of NPCs, i hope this Helps to start with, else let us know.
Last edited by Hajami; Feb 9, 2019 @ 11:12am
95tyza Feb 9, 2019 @ 10:57am 
So I did a common event with parallel processing that is as simple as this for right now;

Wait 60 frames
Control variable x +1

I then have my event (NPC) to have a variable switch at 10 and at 20 to simulate the sick and dead phases

It seems to be working pretty well, however when I have the timer out on my phone to test it, it seems to activate the switches at 5 and 10 seconds as opposed to 10 and 20 seconds. I thought 60 frames was one second, am I mistaken? Do i need to do something else with the common event? It seems to loop back through those two commands, but would it be better to add something else to it?

Thanks for the help so far!
Hajami Feb 9, 2019 @ 11:18am 
It would help if you try to rebuild the example i gave you.
If you have trouble recreating it, let us know and we can maybe help you by giving infos and answers.
If the Example is not doing what you want, than please tell us and explain what exactly is wrong and or missing.

- Yes 60 Frames are 1 Second.
- Did not realy understand your explanation.
- Your Event shows a simple Time Variable which counts up in seconds.
Thats also a start for a solution... there are often many different solutions for a Mechanic.
- Yes Paralell Events loop over there Codelines over and over again, 1 Time each Frame.

Sorry iam not native English, ask if i was to unclear with something.
Last edited by Hajami; Feb 9, 2019 @ 11:28am
95tyza Feb 9, 2019 @ 1:57pm 
Is there a way for me to post screenshots to this thread so I can show you what I have done?

Common events tab;

Wait 60 Frames
Control Varaible Trennon +1


Trennon NPC/Event;

Normal NPC
Variable Trennon is 10 or above (Now NPC is "Sick")
Variable Trennon is 20 or above (Now NPC is "Dead")

Do I need to do anything more complicated than that?
I think I have it working for the most part thanks to your explanation
Hajami Feb 9, 2019 @ 2:11pm 
Not sure how to upload screenshots to steam, but if you upload it as artwork it should work.
Windows Snipping Tool is good to make Pictures.

Quote: "Do I need to do anything more complicated than that?"
If its just 1 NPC and common Event gets activated after infection took place,than your stuff should work on first glimpse. But you should deactivate the Event after the NPC is Dead.
Not good having paralell process events continue to run when they are not needed.

If you got more than 1 NPC for example 20, with your Solution you would need 20Paralell Common Events, that could cause some Performance problems, because many paralell events active all the time, are draining performance reserves(something starters normaly should not worry to much about, but the initial example i mentioned, could be used for many NPCs).
EDIT:
If we talk about the "If", than we mean the Eventcommand "Conditional Branch".
Last edited by Hajami; Feb 9, 2019 @ 2:26pm
95tyza Feb 9, 2019 @ 2:38pm 
Alright I saved the NPC as "Trennon" and the Common Event just as "Common Event" but it should be the most recent one, and says "Red Death" at the top
95tyza Feb 11, 2019 @ 4:19pm 
Oh thank you for the "If-Conditional Branch" explanation that makes a lot of sense! I think I have a good base to start from now, I really appreciate all the help!
< >
Showing 1-7 of 7 comments
Per page: 1530 50

Date Posted: Feb 8, 2019 @ 8:18pm
Posts: 7