Help - Search - Members - Calendar
Full Version: Timed event occurance and reoccurance
RPG RPG Revolution Forums > Game Engines > RPG Maker VX Discussion
zubin73
I read many tutorials on this but can't seem to get this working. I created and edited the event page a number of times and at the end got so frustrated that I deleted all of them...now hoping for some help in desperation.

here is what I'm trying to implement-

1) a chest will open after every 10 seconds and close.the chest,when opens,will remain open for only 5 seconds and then close.this loop will continue unless-
the player presses the action button to retrieve the item it generates after a random amount of time.then the chest will stop the loop of opening and closing and remain open.

2) if the player is unable to retrieve the item,the loop will continue.

please help me implement this.
BasharTeg6
You need to operate the timer using a separate event on parallel process. Something like this:

Wait 600 frames (10 seconds)
Conditional Branch: If "ChestStateON" is true
---Wait 300 frames (5 seconds)
---Set "ChestStateON" = false
ELSE
---Set "ChestStateON" = true

Now in your event have 3 pages, all of them set to run on "Action Button." On the first page leave the condition switches blank. This is the page you'll need for when the chest is in the closed state. Pick the graphic of the closed chest. For the second page, set the condition switch to "ChestStateON" and make the graphic the one with the chest opened. For the third page, set the condition switch to Self Switch A.

Now set up the events as you wish. If the player uses the action button while the event is on the first page (i.e. ChestStateON is false) give him his Lovely Magical Sword of Death Blows (or whatever) and set Self Switch A = ON. This will open the chest and cause it to remain open for all of eternity (or until you turn Self Switch A off.) You can also tie your parallel process event to a switch and disable that when the player opens the chest if you wish. It would at least stop the parallel process event from taking up CPU power.

For page 2 you can either leave it blank or give a message saying "OOPS NO ITEM FOR YOU HAHAHA" or whatever. That page represents the chest when it's open but still running off of the parallel process event.

Good luck!
Ale Goth
(Looks like someone else posted while I took forerver to write this lol, Bashar's explanation is shorter.)
I have a solution to what your trying to make. It uses to event's...
Here's how to fix it...

Make A Variable Called Chest Open(1)/Close(2)
Or whatever you want to name it.
Have 4 event pages for your treasure.

First page leave blank.

Second Page=Is when treasure chest is open. Require in the conditions of the page for the variable "Chest Open(1)/Close(2)" to equal 1 or greater.
Obtain whatever item you get and then change the variable "Chest Open(1)/Close(2)" to equal 3.

Third Page=Is when treasure chest is closed. Require in the conditions of the page for the variable "Chest Open(1)/Close(2)" to equal 2 or greater.
Say the chest is locked or say nothing. Or whatever.

Fourth Page=Is when you've collected the item and the treasure chest no longer opens or re-opens. Require in the conditions of the page for the variable "Chest Open(1)/Close(2)" to equal 3 or greater.
Say the chest is empty or anything.

That's the treasure chest event.

Now make another event with no graphic next to the treasure chest.

Make 3 pages for that event.

First Page=Make this page a parallel process...Add a change variable for "Chest Open(1)/Close(2)" and set it to 1. Add a wait frame of 600. That will equal 10 seconds.
Change the variable "Chest Open(1)/Close(2)" to 2.

Second Page=Make this page a parallel process....Add a wait 300 frames for 5 seconds. Change the variable "Chest Open(1)/Close(2) to 1.

Third Page=This page is for when the chest is open and will remain open. Require in the conditions of the page for the variable "Chest Open(1)/Close(2)" to equal 3 or greater. That way the chest will not close again and restart.

Sorry if this explanation is too long. Heh happy.gif
zubin73
Hey thanks,I tried implementing HatredLust's method but couldn't get it to work.then I tried Bashar's method with success (Thanks to HatredLust for your detailed description though,it helped me to understand the process).I made a minor edit to Bashar's method to get the exact desired result.Here's what I did-

chest event (triggered by action button,priority same as characters)-
1st event page- nothing (graphic= chest closed)
2nd page- condition- ChestOpen switch 'On'. code-chest opening process,self switch 'A' set to 'on'. (graphic=chest half open)
3rd page- condition- self switch 'A' is 'on'.(graphic=chest full open)

other event setup(trigger:parallel process)-
one page event: conditional branch:if ChestOpen switch 'on'
wait for 30 frames
control switch:ChestOpen set to 'off'

else
wait for 180 frames
control switch:ChestOpen is set to 'on'


Hurray! biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.