Advanced Game Time

ah I see... then yeah, conditional branches XD


actually you might want to have it such that you have 1 Controller Common event that runs on parallel and constantly checks the time/day/whatever which then calls the correct common events during the correct times
ah I see... then yeah, conditional branches XD

actually you might want to have it such that you have 1 Controller Common event that runs on parallel and constantly checks the time/day/whatever which then calls the correct common events during the correct times
That's a good idea 😮 I'll definitely try that! Thanks!!!
be careful though to make sure that no two events can run with only a small time frame (like two events that only has a 1 minute game time difference)
Okay so I'm 100% sure I'm doing this wrong

I decided to try the first method to get a hang of things

Here is my common event

Spoiler
8uvpANr.png
I'm guessing (and only guessing) to do this I'd need to make an event on a map that I'd like the common event on happen on. What I want to happen is at that time (9:00) the player is prompted to go to school. I'm not entirely sure if I'm doing it right though 🙁
GameTime.hour? == 9


also turn the switch off afterwards else unless the hour changes fast, you'd be looping that event
GameTime.hour? == 9

also turn the switch off afterwards else unless the hour changes fast, you'd be looping that event
Okay I did that, but then when the event was supposed to be triggered I got this error

Spoiler
mDwSWud.png
Sorry for all the stupid questions. 🙁
what's line 450?
what's line 450?
Spoiler
uhrN3Mp.png
wait, did you add the == to the next condition too? if not, add it first
wait, did you add the == to the next condition too? if not, add it first
That fixed it, thanks!!

I'll be sure to put you in the "Special Thanks" credit section of my game for taking the time to answer all my questions!!
Okay sorry to bother the thread again but I'm really stumped on this one.

I want the player to not be able to exit the door at a certain time. And when I try to exit the room during the designated time, it works. But the text doesn't show up saying that the player can't leave school.

Here's a picture of my event

Spoiler
gCCH0W4.png
It's not just this event either, I tried to make a comment event where a boy is on one map in between 7 AM and 9 AM, and it works. But when I try to talk to him, nothing happens...

Can someone shed light on this?
Look at the way your conditionals are nested:

 First you're checking to make sure the hour is greater than 12. Then, inside of that branch, you're checking if it's less than 13.

There's no possible way for both of those statements to be true, so the second conditional (the <13) will always evaluate to false.

You need to pull it out of the other one (actually just remove the outside conditional entirely) and have it as the else part. (pseudocode coming)

If  >12 transfer player

else say "You're stuck here, Mwa Ha Ha Ha!!!"

Edit: Nested conditionals are a PITA. That's why God made case statements.

In my personal code, there's a few places when eventing where I go the nested conditional route (dialog based on certain switch combinations). Before I put anything else in, I comment every branch so I know what combination of things has to be true for anything I put there to happen. That lets me know two things: that I've included all the possibilities, and that I haven't set up 'impossible' branches like the one you created above.
I have a few questions, and I was wondering if someone could help me :3

Is it possible to also tint any parallax overlays? Mine aren't being covered but is there an option to cover pictures of a certain number?

I can't get the script call to work in turning on and off the tint when entering houses - should I be putting the call in before or after transporting, or should it not matter? 😮

Also, is there any chance (If you're still actively adding to this script) of coding it so that when a certain phrase were written in the comments box of map properties, the tint would be inactivated automatically? I don't know how these things work, but thought I'd ask 😮
Thank you Mouser and Engr. Adiktuzmiko for keeping up here while I wasn't paying attention~

As for you Baylo... There are no options to not tint pictures, and for parallax overlays, I assume those are done via script, so it's dependent on how those scripts are done. Unless you meant parallax background, the built in feature which does work. 

For the next two statements, the pausetint script call only pauses the tinting process and does not clear it. And if you look near the end of the header of the script, you should see the available note tags for map properties. One of those might help.
Hey Vlue. I've tried putting your script into my game and I'm getting an error code. I start the game and after clicking new game, it instantly says:

"line 345: Name Error occurred uninitialized constant GameTime::Current_Time::TIMELAPSE_VARIABLE"

I'm a relatively new scripter and maybe I missed the way to fix it in the Config.
That would happen if you accidentally erased or changed the name of, the customization option on line 144 (of the unedited script).


It normally reads: TIMELAPSE_VARIABLE = 80
Hey all! First of i wanna say Vlue, this is an amazing script. I was working on something similar myself but this is far in advanced.

I have a problem when  using this with Khas's Lighting effects. The problem is, it is 1pm and its light outside, i enter a dungeon and use:

GameTime.pause_tint(true)Which works fine! I can then keep the timer running (Crucial) and change the tint of the map, however when i leave the dungeon. During the event that transfers the player to the world i put:

GameTime.pause_tint(false)However it does not change the screen tint until i use a script to move the time forward by an hour. Then the new tint kicks in.

Any ideas on a work around or am i just being stupid and its easily doable in the right format.

I was wondering if there was a way to re-initialize the tinting process on returning to the outside.

Thanks for your time.
Fix one thing, break another!


Updated the pastebin, should hopefully tint properly when pausing/unpausing now.
Fix one thing, break another!

Updated the pastebin, should hopefully tint properly when pausing/unpausing now.
Haha always the way! Will test now and let you know the results.

Edit:

Problem is still there. Here is my setup:

Map 1 (World).

Event 1: Parallel Process

 - - - Fadein

 - - - Erase Event

Event 2: Player Touch

 - - - Fadeout

 - - - Transfer player to map 2 (Dungeon)

 - - - Call script

GameTime.pause_tint(true)Map 2 (Dungeon)

Event 1: Parallel Process

 - - - Call script

s = $game_map.effect_surfaces.change_color(1,0,0,0,80) - - - Fadein

 - - - Erase event

Event 2: Player Touch

 - - - Fadeout

 - - - Call Script

GameTime.pause_tint(false) - - - Transfer player to map 1.

On going back to the World, the tint is still the same as set for in the dungeon.


Edit 2

Thought it might be easier for you to have the system i am working with. Here is a very basic model. https://www.dropbox.com/s/czquzvfxgemguop/lightTest.rar


Edit 3

Got it working! I looked through the code and had a little play around with printing debug messages to the console to check which functions was being called, and how far through they was getting. Also looking at the variables within the script to see changes (Or no changes for this instance)

Here is the solution for others. (Remember i am using Khas Awesome Lighting)

On line: 503

def use_khas begin temp = $game_map.light_surface.opacity rescue return end self.visible = false $game_map.effect_surface.change_color(1,0,0,0,0) if no_tint return if no_tint $game_map.effect_surface.change_color(1,0,0,0,0) if @old_time min = $game_time.min return if min == @old_time @old_time = min rgba = get_new_tint(min) return if rgba == @old_tint @old_tint = rgba $game_map.effect_surface.change_color(1,rgba[0],rgba[1],rgba[2],rgba[3]) endreplace with:

    def use_khas      begin      temp = $game_map.light_surface.opacity      rescue      return      end      self.visible = false      $game_map.effect_surface.change_color(1,0,0,0,0) if no_tint      return if no_tint      min = $game_time.min      return if min == @old_time      @older_time = @old_time;      @old_time = min      rgba = get_new_tint(min)      if rgba == @old_tint        if @older_time = -1          @older_time = 0          @old_tint = rgba          $game_map.effect_surface.change_color(1,rgba[0],rgba[1],rgba[2],rgba[3])        end        return      end      @old_tint = rgba      $game_map.effect_surface.change_color(1,rgba[0],rgba[1],rgba[2],rgba[3])    end

The differences are

@older_time = @old_time;and

if rgba == @old_tint if @older_time = -1 @older_time = 0 @old_tint = rgba $game_map.effect_surface.change_color(1,rgba[0],rgba[1],rgba[2],rgba[3]) end returnendExplanation:

I noticed that in the force_update function it was setting @old_time to -1. I could see this was to force the script to re-initialize the tint, however this piece of code was stopping it;

@old_time = minrgba = get_new_tint(min)return if rgba == @old_tintrgba and old_tint was still the same, even knowing you set the shade differently before and it was still showing as a different shade. It would keep printing out the old rgba.

So i gathered by pausing the tint process, then setting a new tint through khas had confused this script into thinking it was still the same as before, so i added in another check using the -1 value set earlier. Works perfectly now.
Hi Vlue, great script as always. Thank you very much for that.
Though I have a question,
-the month doesn't appear on clock window.
There are only dayname, dayinmonth, year, year post :at bottom: Hours, Minute.
How can i show month in the clock window?
Sorry for the question if it seems simple to do, coz i don't have any idea how to make month is displayed.
 
Edit:
-In the script, I use START_TIME = [0,0,21,3,7,1200] . Somehow it shows 4 August. Though what i want is 3 July. This is actually a small problem that could be ignored.
-The clock window in menu are blocking the currency window. how to change this?
 
Edit again:
-The first problem is fixed, I actually didn't see your instruction and sorry for that.
-The third problem is on the compability. I use N.A.S.T.Y. Animated Main Menu, that make menu window appears by smooth sliding from random direction. Sometimes the clock window appear above the currency window, sometimes it doesn't appear, and sometimes it blocks the currency window. Is there any chance that you make a compability for it? i hope you do. btw I forget to say this : You Are Awesome.

Here's the screen shot for the third problem.

Spoiler
Error1.png

Original thread: https://forums.rpgmakerweb.com/threads/advanced-game-time.3851/