AisenArvalis Posted November 28, 2019 Share Posted November 28, 2019 Hey all, Aisen here. I came up with this Day Tracker while at work and decided to share it with you all. This is a base level system that can be improved on.  Pre-requisites: Global Variable Boolean - Day Added = False Global Variable Integer - Day = 0  Setup may vary slightly depending on server time setup.  Make a common event and create 2 pages, both with the trigger auto-run. On the first page, set the condition to Time Between midnight-midday (Depending on server time setup, as long as it's after midnight and before midday, it's fine) Then use the following logic:  This'll make it add 1 day to the counter and then set the value of Day Added to True so it won't do it again since it checks if it's false before adding the 1.  On the second page, set the condition to Time Between midday-midnight (Again, depending on server time setup this may differ slightly but as long as it's after midday and before midnight, it'll work) Then use similar logic to the first page:  This'll reset the Day Added to false IF it's true come midday, preventing it from adding more than 1 day at a time.  -LIMITATION- From testing this works ONLY when at least ONE player is online as the event system is tied to players. There may be a way to do this through the API but that will require more testing from my side. You could potentially also make a dummy account that is online 24/7 for this to actually tick. Ainz Ooal Gown 1 Link to comment Share on other sites More sharing options...
Guest Posted November 28, 2019 Share Posted November 28, 2019 This will only run if players are online I'm pretty sure... Link to comment Share on other sites More sharing options...
Ainz Ooal Gown Posted November 28, 2019 Share Posted November 28, 2019 2 hours ago, The Bunny Gamer said: This will only run if players are online I'm pretty sure... Â Global variables... so beleive it will run alsong as server is online wont it? Link to comment Share on other sites More sharing options...
Guest Posted November 29, 2019 Share Posted November 29, 2019 9 hours ago, Ainz Ooal Gown said: Â Global variables... so beleive it will run alsong as server is online wont it? Â The global variables will run fine, but not the common events, which are local. An autorun common event is a local autorun event for every player. So this system will only work if exactly one player is online at all times. Link to comment Share on other sites More sharing options...
Beefy Kasplant Posted November 29, 2019 Share Posted November 29, 2019 28 minutes ago, The Bunny Gamer said: Â The global variables will run fine, but not the common events, which are local. An autorun common event is a local autorun event for every player. So this system will only work if exactly one player is online at all times. Â Â 99% sure you're right Link to comment Share on other sites More sharing options...
AisenArvalis Posted November 29, 2019 Author Share Posted November 29, 2019 Player count shouldn't matter for this as it locks behind another variable (Boolean) type which is global as well. So once it adds a day it'll lock and won't be able to add again until midday unlocks the boolean. Â I'll run a test with 24x Server Speed, so in theory it should add 1 day every hour. Link to comment Share on other sites More sharing options...
Khaikaa Posted November 29, 2019 Share Posted November 29, 2019 Player count always matter since events(including common events) always run tied to a character. Basically, if there are no players, events won't run. A common event is just a normal event which isn't tied to a map so you can call it from anywhere, but if nobody calls it then it just doesnt run.  If you want something like this really working you have to consider the possibility of counting more than 1 day (since maybe there wont be players for 2 days or more). You can't trust the intersect time, but you can use SYSTEM time and compare current time with last day count execution time, if time difference is equals or higher than 24h you add 1 day and add 24h to the last day count execution time. This way it will update correctly when any player logs in, even if there were no players from weeks. Link to comment Share on other sites More sharing options...
AisenArvalis Posted November 29, 2019 Author Share Posted November 29, 2019 I have confirmed that it only adds days IF at least ONE player is online on the server. So I'll update the post with that information for now. Â Since this is tied to a common event there's the limitation. I will however also go over the API and a webserver that auto run a script and add to the variable through it but it seems wholly too complicated just for a day tracking system. Â In the meantime we could say time freezes when noone is on? Ainz Ooal Gown 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now