Orange Time System

^ Hey, thanks but the common event I have now works fine with the varible hours = 6, its just I want a script to change time when my player goes to bed.


I want them to wake up at like 5.59 so the event resets as soon as they wake basically.


However if I use the code mentioned before to change the time to 6am, it doesn't register it as a new day, it still considers it day 1.


I would like it to register that its a new day.


Heres my code: (super simple) (go to sleep, +1 day, go to six next day.)


but once it skips time, it reverts the day back to day 1.

feafe.png
Go back one page. I asked Hudell the same thing. The code is there in their answer! 🙂  
Go back one page. I asked Hudell the same thing. The code is there in their answer! 🙂  



You saved me an hour of frustration, thanks so much! 😀   <3


This may be a harder question but, do you know how to have the time change time to like, 5:30 instead of just 6? Its okay if not!
can someone explain in noob terms how I change the clock to 12 hours? i downloaded the demo but i dont see where it explains how to do that....
this time system is very lag if use mobile android, any solutions?


i hope this system have lite version, which update every secon not microsec, i think that will make fast.
I've downloaded the plugins reccomended to run a day and night cycle but I can't get it to work, I set it to real time and put my own clock forward but night never came :/ Any chance at a helping hand?
I've downloaded the plugins reccomended to run a day and night cycle but I can't get it to work, I set it to real time and put my own clock forward but night never came :/ Any chance at a helping hand?



I used a clock hud to make sure time was passing and it is but night still doesn't happen 🙁
Now with plugin commands. Some example of commands:



run common event 10 every hour
run common event 1 every minute
run common event 2 every second
run common event 3 every day
run common event 4 every month
run common event 5 every year

Is it possible to stop this command?
and how do I edit the clock / clock window etc? to look more like a GUI clock rather than floating text in the left corner?
I’m currently using this add-on/plugin.


Yep-engiencore


Yep-savecore.


Orange hud


Orange Time System


Orange hud clock/date


Orange timesystem to variable.


At the start of my game I use the script OrangeTimeSystem.on('changeHour', 1); where once an hour some stat change. (Works perfectly) the problem is when I save a game the script won’t load when I load a game.  The Yep savecore isn’t the problem have turned it off and have the same problem when its off.


How can this be fixed?
Im getting a error of : Length Undefined. It is taking me to OrangeSystem.js line 1175: if (args.length < 4) return;


What can be the cause of this? It was working just minutes ago.

EDIT: I fixed it by putting it at top of my plugin list
I feel amazingly stupid right now.  So, newbie question, but, does this actually display the time or no? 🤔  
If you add the OrangeHud it can display your timevariables 🙂
Thank you so much for creating this! I have been hunting for something like this for ages.
Is there a video one could watch on how to use these amazing plugins? As I'd like a certain character to change dialogue and for a certain event to change with the time of day. For example in the morning he greets his wife with breakfast and at night dinner
var TimeSystemExtensions = {};

(function($){
$.registerCommand = function(variableId, switchId, hours) {
var time = OrangeTimeSystem.getDateTime();
time.hour += hours;
OrangeTimeSystem.validateDateTimeValues(time);

var timestamp = OrangeTimeSystem.convertConfigToTimestamp(time);

time.callback = 'S' + switchId + ',FALSE';
OrangeTimeSystem.registerAfterTimeEvent(time);

$gameVariables.setValue(variableId, timestamp);
};

$.getTimeLeft = function(variableId) {
var currentTimestamp = OrangeTimeSystem.convertConfigToTimestamp(OrangeTimeSystem.getDateTime());

return timestamp - currentTimestamp;
};

$.splitTimeDifference = function(variableId, daysVariable, hoursVariable, minutesVariable, secondsVariable) {
var timestamp = $.getTimeLeft(variableId);
var data = OrangeTimeSystem.convertTimestampToConfig(timestamp);

if (daysVariable > 0) {
$gameVariables.setValue(daysVariable, data.day);
}
if (hoursVariable > 0) {
$gameVariables.setValue(hoursVariable, data.hour);
}
if (minutesVariable > 0) {
$gameVariables.setValue(minutesVariable, data.minute);
}
if (secondsVariable > 0) {
$gameVariables.setValue(secondsVariable, data.seconds);
}

return timestamp;
};
})(TimeSystemExtensions);



I'd love to take advantage of this script to return the time different to the player, but instead of changing a Switch in X amount of hours I'd like to use it to change a Self Switch.


Unfortunately I'm having a hard time figuring out what the time.callback in the above script should be set to, after digging through Orange Time System js and Orange Event Manager, I'm guessing something like this:


Change:


time.callback =  'S' + switchId + ',FALSE';


To


time.callback =  'SS' + mapID + ',' + eventID + ',' + switchLetter + ',TRUE';


Obviously while also passing eventID, mapID, and switchLetter variable as a parameter into the function. Is that incorrect? Am I missing something else?


Any guidance would be greatly appreciated.
Change:


time.callback =  'S' + switchId + ',FALSE';


To


time.callback =  'SS' + mapID + ',' + eventID + ',' + switchLetter + ',TRUE';



That's right. Did you get any error when you tried?
That's right. Did you get any error when you tried?



Well, I was getting a "timestamp not defined" error but I found you hadn't actually set that variable in the $.getTimeLeft function. I took the liberty to just set that value to the variableID value and it fixed that issue.

Then, instead of using the plugin command "disable switch 14 in 168 hours", use the following script call:


Correct me if I'm wrong but I was under the assumption the $.registerCommand could be run in-place of the plugin command due to your above instructions. However, I'm still required to use the plugin command in addition to that script if I hope of the switch to actually toggle. At least after making the minor change I mentioned above.


Thanks for your help Hudell 🙂
Well, I was getting a "timestamp not defined" error but I found you hadn't actually set that variable in the $.getTimeLeft function. I took the liberty to just set that value to the variableID value and it fixed that issue.

Oh right, it was missing this line:


var timestamp = $gameVariables.value(variableId);



Correct me if I'm wrong but I was under the assumption the $.registerCommand could be run in-place of the plugin command due to your above instructions.

Yes, it's supposed to be run in-place of the plugin command. But if it didn't work, you can use the plugin command and remove those two lines instead:

Code:
    time.callback = 'S' + switchId + ',FALSE';
    OrangeTimeSystem.registerAfterTimeEvent(time);
Hudell, could you help another fellow brazilian? Lol


I simply can't download your demo, could you have it uploaded to another mirror?


Your server does not support resuming and it always breaks. 


I've been trying to download it for 5 days now, it's the only reason I'm asking.


Or maybe someone who has the latest demos, if anybody could upload it...


Obrigado!

Original thread: https://forums.rpgmakerweb.com/threads/orange-time-system.46509/