MZ Displaying Lights as Pictures above screen tint is driving me crazy

Hi, I'm using DKP's Game Time and Game Time Day/Night to have the game screen change tints in real time. I want to have the lights from things like street lamps and windows be displayed as a picture bound to the map, which will allow them to be seen above the tint of the screen. My problem is that I can't seem to figure out how to make these picture layers display when they're supposed to. I want them to be active from 6pm to 6am, which according to how these times are saved as a variable, would be 18 to 6. If I wanted to exclude the daytime from having these lights displayed, I'd use the values 7 to 17. How would I be able to do this? Even putting (dayPeriod == Game_Time.NIGHT) in the conditions field for a switch to be enabled hasn't given me the results I'm looking for.

Sorry if this isn't posted in the exact right place, I'm a bit disoriented at the moment from trying to figure this out.
No worries. There are a ton of sections. I gotchu. I’ve moved this thread from RPG Maker MZ Support to JavaScript/Plugin Support.
Update! I've figured out how to get the switch to turn on and off at the right times:
help.PNG

As for actually getting the picture to display properly based on said switch... no clue.
please give links to the two plugins you're using, and screenshots of the events you're currently at with displaying the light picture.
we can't help you without details of what you've done.
DK Game Time System
DK Game Time Day/Night
bad event.PNG

This event right here is pretty much what I've been trying. Having the event condition be tied to the switch and have it run parallel. Even when entering and exiting the map, the picture still doesn't pop up. I know the switch is turning on at this point, and that the picture is properly aligned when it's forced to show up in other ways.
I'd want the light layer to show up automatically, and shut off automatically as well.
the picture still doesn't pop up.
the picture most likely doesn't show up because you are overwriting and resetting the process sixty times per second - and loading the picture probably requires more time than 1/60 of a second.

parallel processes loop sixty times per second, and you only want to give the command once per game-day.
depending on how your game is structured you either need to use erase event or a wait(100) or so after the show picture
nothing.PNG

I decided to go with this route, as I don't know if the erased event will regenerate and I need the lights to be there each night. I set the game time to night, which sets the switch on that activates this event. and...
dark.PNG

No lamp lights.
possible solution.PNG

This is one idea I had, to have it changed when going in and out of loading zones. However, the day/night system is tied to the actual computer given time, so someone playing in the night who last played during the day wouldn't have lights, while someone playing in the day who last played at night would have the lights.
then please show the full event screenshot, not cutting away the properties - that allows us to check if there is something else wrong.
I did add a plug-in command, but all it does is bind the picture to the map so it doesn't move with the character. Whether it's there or not, it has the same result
full.PNG
Still not enough info. Whatever is defined in page 2 could potentially prevent page 1 from being active. We also need to see the exact code and trigger conditions that handles switching on and off your Night Time switch.

Bugs are often not caused by the code itself, but the context of the code as well.

Pressing F9 during playtest also gives you a debug window where you can directly see and edit the values of all switches and variables.
blank page.PNG

Page 2 is entirely blank, intended to be for when the switch isn't active.
switch cond.PNG

This is the condition that controls the switch, which I've confirmed does activate the switch
grhgd.PNG

The switch works. I've disabled real time in the plug-in at the moment to actually test it. The switch is working perfectly fine. I just don't know how to get the event to cooperate.
There's our problem. Event pages go to the page with the largest index that fulfills all its conditions. Because page 2 is blank, that event is always on page 2. If we delete page 2, the light should work.

There should be an additional bug involved with the pictures not deleting themselves upon switching from night to day but we can worry about that later
There's our problem. Event pages go to the page with the largest index that fulfills all its conditions. Because page 2 is blank, that event is always on page 2. If we delete page 2, the light should work.

There should be an additional bug involved with the pictures not deleting themselves upon switching from night to day but we can worry about that later
Ah, nothing like troubleshooting in RPG Maker to make me feel like an absolute moron. This fixed that problem, thank you

Now, about that mentioned additional bug. If I made a second switch that flips on during the day hours, and had it in charge of a second page that deletes that picture/doesn't add it, would that work?
Ah, nothing like troubleshooting in RPG Maker to make me feel like an absolute moron. This fixed that problem, thank you

Now, about that mentioned additional bug. If I made a second switch that flips on during the day hours, and had it in charge of a second page that deletes that picture/doesn't add it, would that work?
Depending on execution may lead to wasted CPU cycles, but likely nobody would notice unless you started piling up more code that eventually leads to frame rate drops. Overall yes, that would work. Only catch is that you have to be super organized as to which picture ID is assigned to a light picture

EDIT: Also, programming of any sort is full of potential for 'dumb' mistakes. It's almost unavoidable
Depending on execution may lead to wasted CPU cycles, but likely nobody would notice unless you started piling up more code that eventually leads to frame rate drops. Overall yes, that would work. Only catch is that you have to be super organized as to which picture ID is assigned to a light picture
Would each map need a different picture ID for their lighting then? Also, would adding "end event processing" help in this instance while using parallel processing? Or would it just start up again?
Would each map need a different picture ID for their lighting then? Also, would adding "end event processing" help in this instance while using parallel processing? Or would it just start up again?
Each individual light needs its own picture Id. Picture Id's can be recycled across maps as long as they're used only once per map.

I did a quick test and "end event processing" does not stop the parallel process from happening once the event ends. As a programmer my ideal solution would be to update the light pictures only on the moment it refreshes the pages but RPGmaker does not support running events "between" pages, only on the pages if that make sense.

You could use a script call in a custom move route that has its repeat flag unchecked so that it starts like a parallel event but runs only once. The script call you would use is $gameScreen.erasePicture(id); I don't know how that script call interacts with the plugin you're using to bind pictures on the map, so good luck!
Very interesting problem I have now. I set it to wait 180 frames so it isn't running 60 times a second. Now every 3 seconds it flickers
flicker.PNG

Is there a way I can have it detect when there's a picture displayed and have it skip the show picture command if it's already there?
yes, you can use a conditional branch.
however the check is a bit more complicated because you can't directly check on pictures with eventing, you would need a switch that is set when the picture is shown and unset when the picture is removed.

EDIT: the flicker is most likely loading delay, so you might be able to reduce it by making the picture filesize smaller (higher compression) or by using a preloader (rather tricky with timing)
yes, you can use a conditional branch.
however the check is a bit more complicated because you can't directly check on pictures with eventing, you would need a switch that is set when the picture is shown and unset when the picture is removed.

EDIT: the flicker is most likely loading delay, so you might be able to reduce it by making the picture filesize smaller (higher compression) or by using a preloader (rather tricky with timing)
The first time I tried a conditional branch, the flicker got slower. However, I decided to try it again, this time with a label jump if a certain switch was enabled, and now it works.
proven  a fool.PNG

Edit: the very moment I tried to get the event to be shut off during the day, it's decided to stop working.

Original thread: https://forums.rpgmakerweb.com/threads/displaying-lights-as-pictures-above-screen-tint-is-driving-me-crazy.164302/