Event System Support (expert users only)

Status
Not open for further replies.

Celianna

Tileset artist
Global Mod
Joined
Mar 1, 2012
Messages
10,543
Reaction score
5,551
First Language
Dutch
Primarily Uses
RMMV
Since the engine runs at 60 frames per second, unless you want it to disappear in a blink of an eye, I would suggest 300 frames to show on the screen, and then erase it.
 

Murd

Apprentice
Member
Joined
Jan 28, 2015
Messages
112
Reaction score
7
First Language
Thai
Primarily Uses
I'm thinking to implement Instance like WoW to my project where you can farm bosses for better equipments. However; accessing instance at will is not what I want. So I need to add a timer to each instance. Players need to wait for example 1 hour before re-access to an instance.

I know about how to create evented timer by using varibles in common event page. Some scripts allow me to keep the timer run when change map. But I just wonder if players save their log and quit the game, the timer is still running. Is there anyway to do such thing?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
I suggest using a parallel process common event which uses a switch as it's condition. wait maybe 60 frames, increases a variable by 1 then once the variable reaches 3600 (which is the number of seconds in an hour) turn off that switch and set the variable back to 0. Then on your instance, check if the switch is OFF, if it's off then you can go to the instance, afterwards, turn the switch back ON so that the timer now runs again and you won't be able to go to the instance.


It's a common event so it will continue to run in any map.


oh wait

But I just wonder if players save their log and quit the game, the timer is still running.
You mean like even if the game is closed the timer still goes? Well you could save the PC's time using the Time class into a variable during save then check the time when he loads the save file and compare... But that means the player can just change his PC clock to avoid waiting for an hour...
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
38,807
Reaction score
12,225
First Language
English
Primarily Uses
RMMV
Use my Multi Timer script. Many events can have their own timers, they continue when you leave the map, and they are saved when the player saves their game.
 

Murd

Apprentice
Member
Joined
Jan 28, 2015
Messages
112
Reaction score
7
First Language
Thai
Primarily Uses
I suggest using a parallel process common event which uses a switch as it's condition. wait maybe 60 frames, increases a variable by 1 then once the variable reaches 3600 (which is the number of seconds in an hour) turn off that switch and set the variable back to 0. Then on your instance, check if the switch is OFF, if it's off then you can go to the instance, afterwards, turn the switch back ON so that the timer now runs again and you won't be able to go to the instance.It's a common event so it will continue to run in any map.oh waitYou mean like even if the game is closed the timer still goes? Well you could save the PC's time using the Time class into a variable during save then check the time when he loads the save file and compare... But that means the player can just change his PC clock to avoid waiting for an hour...
Thank you for your suggestion but it still has a drawback if the player does what you say...

Use my Multi Timer script. Many events can have their own timers, they continue when you leave the map, and they are saved when the player saves their game.
Sounds very interesting!! I prefer trying to create a system by events as much as possible to avoid script conflicts. However; it seems to be no choice for me but to check out your timer script!

Thanks a lot to telling me this.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
so did you mean running timers if the game is already off or not? Coz if not, then my evented solution should already work since it uses switches and variables which is saved by default on the save file. If yes, I don't think the script does that too. IDK of any script that does that actually.
 
Last edited by a moderator:

Murd

Apprentice
Member
Joined
Jan 28, 2015
Messages
112
Reaction score
7
First Language
Thai
Primarily Uses
so did you mean running timers if the game is already off or not? Coz if not, then my evented solution should already work since it uses switches and variables which is saved by default on the save file. If yes, I don't think the script does that too. IDK of any script that does that actually.
I really wish there is a way to keep timer running even the game is shutdown but I don't think it is possible..

And for your evented timer, I have tried to do but the timer stops when in a combat. I guess I must find a script that makes timer running even changing map or engaging in combats to support my project.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Ah yes, because the interpreter that runs common events only run during maps... If you want it to run on other scenes (menu, battle etc), you'd need something like Tsukihime's Scene Interpreter
 

Murd

Apprentice
Member
Joined
Jan 28, 2015
Messages
112
Reaction score
7
First Language
Thai
Primarily Uses
Ah yes, because the interpreter that runs common events only run during maps... If you want it to run on other scenes (menu, battle etc), you'd need something like Tsukihime's Scene Interpreter
I think I have to rely on evented timer plus the script you recommend which best suits my project. Thanks again!!
 

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,941
Reaction score
2,562
First Language
Greek
Primarily Uses
RMMV
So, I was wondering.

I collaborated with Hotfirelegend, to participate on the latest forum contest, which was an awesome event really.  :)   :thumbsup-right:

While Hotfirelegend and I were making our game, he wanted to implement a timer.

So we used the timer and we wanted to just call a common event on time 0.

It never happened.  :dizzy:

No matter what I tried, no matter what I did, I couldn't set it to work.

Can someone show me how to do it?

Or even just post a demo with a 30 seconds timer that can successfuly call a common event at time 0?

I concluded that it was bugged.

And it seems I am not the only one with the same issue....  :(

Did a small research, found only the following post but had not been answered.  :(

Older post here.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,671
Reaction score
2,993
First Language
Tagalog
Primarily Uses
Personally, what I would do is make a parallel common event that counts to 30 seconds (using a few frames wait and increasing a variable, rather than wait for 30 seconds as that could be troublesome actually), then do whatever I want when that happens, then turn off that common event

anyway, can you post what you have tried so far with the Timer?
 
Last edited by a moderator:

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,941
Reaction score
2,562
First Language
Greek
Primarily Uses
RMMV
Personally, what I would do is make a parallel common event that counts to 30 seconds (using a few frames wait and increasing a variable, rather than wait for 30 seconds as that could be troublesome actually), then do whatever I want when that happens, then turn off that common event

anyway, can you post what you have tried so far with the Timer?
Of course.

A silent timer can be done that way, indeed.

But what if you wanna use the Timer Event Command?

Is the event command work properly?

That is my question really.

For instance, what would you do if you wanna show a timer downcounting from 30 seconds to 0 and at 0 it's a game over?

Logically you use the Event command, convenient enough.

But the command does not work properly, no matter how you event it.

Can I set it up properly?

Or is it just bugged?  :(
 

Ralpf

Veteran
Veteran
Joined
Jun 5, 2014
Messages
597
Reaction score
153
First Language
English
I don't know what you have yet, but you could go with something like this:

Timer.jpg

You may not need the erase picture commend depending on how your pictures are set up. If they will completely cover up each other you don't need it but (in the case of the simple pictures I made to test it) if they don't completely cover each other you will need the erase picture command.
 
Last edited by a moderator:

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,941
Reaction score
2,562
First Language
Greek
Primarily Uses
RMMV
I don't know what you have yet, but you could go with something like this:
That's a good idea, it might need about 12 small pictures involved for the counter but it is a good solution. :p

As I said,
Unfortunately no. I can not. 

There was an issue with who can edit the project. I will PM you to explain the situation.

What I am asking EXACTLY, is:

Can you use Timer into an event into a map, like a Parallel Proccess? And when I mean timer, I mean the Event Command timer.

Does it work properly? That is what I wanna know.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
29,526
Reaction score
6,870
First Language
German
Primarily Uses
RMMV
I haven't heard about any bug with how the timer works itself, BUT that timer has some restrictions and there are problems when someone tries to use it outside those restrictions.


The main problem is that there is ONE timer and all commands and conditions about it go to that single timer. And as always it's a bad idea to use any of the delayed functions/commands inside a parallel process, and that includes the start timer command. That is extremely tricky because parallel processes automatically loop and are started outside any regular sequence - if you don't know exactly what you're doing, you'll end up with the timer being restarted due to repeated commands in the PP or similiar things.
 
Last edited by a moderator:

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,941
Reaction score
2,562
First Language
Greek
Primarily Uses
RMMV
 That is extremely tricky because parallel processes automatically loop and are started outside any regular sequence - if you don't know exactly what you're doing, you'll end up with the timer being restarted due to repeated commands in the PP or similiar things.
So If I wanna make a timer using that command, how can I set it up?Yeah... I am an idiot, let me give you also one scenario, a case, because... how the hell would you know what I am asking for:

Okay, let's say we had three maps. all in all.

The game starts and the timer starts too.

We got 5 minutes of oxygen. On zero, an event should run that shows a text let;s say "Goodbye." and then Game Over happens.

Case 1: I want this timer to run once and stay running on the same map. When timer ends, these two things I mentioned happen.

Case 2: I want this timer to run once, and keep updating even of I change room, without getting initialized or something.When timer ends, these two things I mentioned happen. A message and a game over.

Both cases should be built strictly using event commands only AND USING THE TIMER RELATED COMMAND.

Can this thing be built and work properly?

I could not build that and work as intended.

Problem: No matter where I evented that, It reached zero and NOTHING happened. :(

EDIT:

 

The main problem is that there is ONE timer and all commands and conditions about it go to that single timer. 

 
I will keep that in mind. I had no issues by using two timers (never tried), but Parallel Proccess would break eventually looping and redefining the Timer. Okay, got it.

If I use Auto Run and a self switch, will the timer still exist running into RAM running after Auto run change to a blank event page 2 ?  :o  Gonna try this out NOW!
 
Last edited by a moderator:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,350
Reaction score
332
First Language
German
Primarily Uses
RMMV
Cool so many Ways for this Timer thingy.

I have also one :) a simple Time Stamp.

After WOW ini is Won:

Control Variable1 = Others (Game Time)

You do this once, thisway you have a Timestamp after your Ini.

Next Time you want to Enter the WOW Ini you make Conditional Branch at Entrance with Eventcode like this:

Variable2 = Variable1

Variable3= Others (Game Time)

Variable3 -= Variable2

Conditional Branch Variable3 equal or more than  (write down how long it needs to be)

Game Time is counted in Frames. That means 60 is 1Seccond. I would devide the number before checking, because Variables in Eventcommands only got 8 digits if i remember right.

But i thought it should also be mentioned.
 
Last edited by a moderator:

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,941
Reaction score
2,562
First Language
Greek
Primarily Uses
RMMV
@Bex I was actually researching how can I properly use Timer, since it is a... strange Event command.

Thanks for your help though!  ;)

My Question:

"If I use Auto Run and a self switch, will the timer still exist running into RAM running after Auto run change to a blank event page 2 ? "

YES IT DOES! Half of the problem is solved.

I never set timer into a Parallel Proccess. Or did I?  :dizzy:

I was checking the timer using a Parallel proccess.

But never worked right.

What @Andar told me though lead me on the solution.

I know that I surely did something wrong.

I just can not recall what it was.

But I got the solution here!

Since timer is an object that has only one instance, when called to do something it should stay on RAM no matter what.

If somehow you refer on the timer, you refer to this very instance.

So we should always remember there is only ONE timer.

Thus I made it work properly. If anyone wants to see how, he/she can press the spoiler.

I have a step by step picture supported way.

@Andar, thank you! You have lead me to the correct direction!

I have 5 pictures in here:

https://www.dropbox.com/sh/o1nxlojr741oqqm/AACDG92yFVo_EjUta90lIJEba?dl=0

Don't get confused by color use:

Picture 1: Red and Blue squares indicate two different events.

Picture 2: The red Event is shown here. Blue is its first page and red the second, that is shown on Picture 3.

Picture 4: It is the Blue event of Picture 1.

Picture 5: Shows that the event of Picture 4 must exist on both maps.

Oasis and Pyramid are Transfer events between two maps.

First we make an event with two pages.

The first page is set to Auto run.

To give control back to the player, we have to set Self Switch A ON on the Page 1 of this event, after Setting the timer.

Then page 2 of the event is a blank page, with condition Self Switch A ON to override page 1 after Page 1 will be executed once.

Timer runs on the RAM.

By default it keeps updating between maps!

You can use a Parallel Proccess to test every second if the timer reached a certain time or not (here I set to check time 00:00)

The Conditional beanch will only Execute something if that thing occurs.

This Parallel proccess must exist on every map the player has access during the Timer running, to make the check.

Parallel Processes must NOT be overused though because lag on the detection will happen.

Thanks again @Andar!

It works smooth!  :D   :thumbsup-right:
 
Last edited by a moderator:

Murd

Apprentice
Member
Joined
Jan 28, 2015
Messages
112
Reaction score
7
First Language
Thai
Primarily Uses
@Dreadshadow

What will happen to the built-in timer if somehow you can save game and shutdown while the timer is running?
 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Writing out an idea for the No Travel Game Jam. I have a general plot and challenge written out, it's just a matter of filling the rest in and making it interesting.
A definite difficult time right now. How is everyone doing during this pandemic? I already have seen furloughs and layoffs.
Hollow 1977 wrote on Archeia's profile.
Hope you and your family are doing well during this difficult time. :)
My elderly neighbor whom I've been buying groceries for just got carried out of his home on a stretcher by guys with hazmat suits. Considering I've been his only point of contact for the past month it's probably safe to say my boss was right to tell me to stay home once I developed a mild cough after all.
Damn. All these new features to the forums. Takes some getting used to.

Forum statistics

Threads
95,642
Messages
930,680
Members
125,964
Latest member
giuliani
Top