Is there a code to change variable when time progress?

Hi guys

I am playing around with time system

Is there a code to change variable/switch one time per time progression?

For example, in a time system, once change day 1 to day 2, variable A (switch A) automatically change without any player trigger

Thanks
there is no time in the default engine at all, so that would make no sense.

however, as soon as you implement a time system (either through eventing or through scripting, your choice) it is easy to apply such a change into that time system. But how that is done depends on how the time system was created, so you have to show or link your time system first.

evented time systems are generally with more options but limited in what they can do. time plugins depends on who programmed them, I never bothered with that.
Hi sorry I meant time system plugin. I am playing around with js from Mog time system

Look at line 593, for example,

var _alias_mog_timesys_gswtc_onChange = Game_Switches.prototype.onChange
Game_Switches.prototype.onChange = function() {
_alias_mog_timesys_gswtc_onChange.call(this);
if ($gameSystem._time_data) {$gameSystem.set_base_time_phase();};
};

Was this Game_Switches for time switching or just switches [aka $gameSwitches.value(x)}]

I am trying Game_Switches.onChange.day () = 2; or Game_Switches.day.onChange () = 2;

Does not seem to work

Any suggestions?
please link to the website of the plugin.

any reasonable time plugin is configurable (without any javascript knowledge) to have a variable for time and days. you should look where it is configured and check if you can adopt that before trying any change in the code itself.
The plugin can be found here https://atelierrgss.wordpress.com/rmv-time-system/ (not in English)

You are correct. Looking at configuration. There are switches and variable ID. (see the pictures)

Now the question would be how can I manipulate those IDs with my variables.

For example, season switches ID = 36. If I have my own switches = 36 created in the editor. Will my switch override this ID?
Now the question would be how can I manipulate those IDs with my variables.
it's the other way around. You misread how this works

you set these IDs to tell the plugin which switches and variables to change.
If for example you set the night switch ID to 99, then the time plugin will turn on the switch 99 whenever it becomes night and turn it off the next morning.

You need to name the switches whose IDs you have choosen for the plugin to make sure that they will not be used by something else, because the plugin will control those switches according to its programming.
And then you can use them to do whatever you want and however you want your eventing to react to them by simply use the same switches in conditions.

For example if you have a NPC-event that should have a working clothes sprite in the day and a nightwear sprite in the night, then you make it a two-page-event with the second page for the night sprite and conditioned to the night switch that you configured. And the sprite will automatically switch pages whenever the plugin tells it that it is now night by switching on the night switch.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-code-to-change-variable-when-time-progress.120096/