A problem with a loop event set up for a timer

Wren

Veteran
Veteran
Joined
Jun 25, 2013
Messages
94
Reaction score
16
First Language
English
Does anyone know why when I set up a loop that works like:


loop


wait 60


set variable second -1


if second =or< 0


set second = 60


set minute -1


if minute =or< 0


run common event clock out


end loop


And in my common event I have set up a screen fade out, I change the clock back to 10 minutes and enter a text message about the timer had run out, then I use a script command to switch parties in tsukihime's party manager, and then fade back in the screen.


However when I test, the time reaches 0 and the screen fades out, the text message runs but none of the variable changes are made and the screen stays black and the party switch doesn't happen.


When I call the same common event using a button event I set up it works fine, when I use a menu option to call the common event I set up in yanfly's menu manager it also works fine.


I think it has something to do with the fact it is in a loop, but I have tried break loop commands and it doesn't change anything.


Any ideas?  If you need more info, Screenshots are below.


Thanks for any advice or help!

ClockCommonEvent.PNGClockCommonEvent2.PNGClockCommonEventTest1.PNGClockCommonEventTest2.PNG
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
Please post screenshots of your events - there are several things that might have happened, but we can't tell because you omitted several important informations on that text writeup.


Posting a screenshot is usually faster and easier than retyping your event contents, and it is always complete (there are a lot of people who are missing half their event, including their errors, when typing an event that way).
 

Wren

Veteran
Veteran
Joined
Jun 25, 2013
Messages
94
Reaction score
16
First Language
English
I added screenshots to the original post.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
several problems visible at first glance:


1) parallel processes automatically loop - placing an additional loop command inside the parallel process will always throw off timing, remove that loop.


2) where is the initial setting for the minute? if there is no other command, the event will start with minute=0


3) hhow and where do you check for the changes? please include the event or plugin that displays your time.
 

Wren

Veteran
Veteran
Joined
Jun 25, 2013
Messages
94
Reaction score
16
First Language
English
The time works normally, I initialize the minutes and seconds when I turn on the switch on initial load into the map.  The clock counts down normally and successfully all the way to 0 minutes and 1 seconds and then it goes to the common event, where the screen fades out, it plays the message about "player \v[12] your turn will begin when you accept" and then nothing, the screen stays black, the variables don't get updated to 10 minutes, and the variabale for actual party doesn't get set to 2, the screen never is faded in.


This same common event works normally for a manual call of the common event through a menu option or when I create an event that is activated by the player.


That is the problem, not the timer counting down.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
you don't understand - you have to remove the loop, because that causes timing problems that are absolutely not neccessary, and I strongly suspect that those timing problems are part of the cause of your problem. Especially as such a loop can disable other parts of the game sequence.


Because any common event can only be called once per frame, and the loop can force multiple calls in the same frame - besides a lot of other problems.


Please remove the loop from your main event and then test again if that is enough to solve your problem, or if you have to continue searching for other problems.


I also suggest you follow the link to the bughunting tutorial in my signature to understand why all errors have to be solved, no matter if they do something at the moment or not.
 

Wren

Veteran
Veteran
Joined
Jun 25, 2013
Messages
94
Reaction score
16
First Language
English
I removed the loop, the exact same results.


Edit:


I turned the second end of turn common event into a parallel as well with a switch.

ClockCommonEvent5.PNGClockCommonEvent6.PNG





Tested and works correctly now.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
Please update the screenshots to the current version, and please add text to the inner showtext for showing the variable values.


And give full screenshots for the second common event - we don't need repeating player messages, but we need to see how it ends
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If you get the same (unwanted) results when you remove the loop, why did you mark your post as solving the problem?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,019
Members
137,564
Latest member
McFinnaPants
Top