DazzaJay Posted January 15, 2008 Author Share Posted January 15, 2008 that script is syncing time server side, if change my server pc's time, and relaod the script, the time in game is sync'd to it, and not my client pc. This screenshot has Xfire's Clock Overlay turned on, showing my Client PC's time "7:30 PM" (19:30) where at the game is clearly syncing time to the server "5:32" (17:32) http://files.potholestudios.com/dazzaja ... -times.jpg this is the script i am using: function syncTime() local realTime = getRealTime() local hour = realTime.hour local minute = realTime.minute setTime( hour , minute ) end setTimer ( syncTime, 1000, 0 ) as for the weather changing, i can nock up some screenshots to prove my thoery. Heres a download of TimeSync Tool V1.81 http://files.potholestudios.com/dazzaja ... ncTool.zip load it up, make sure that "Weather Fix" is unchecked, and you will see the weather changine when it syncs the time, once per second. alt tab out, check Weather Fix, go back in, and you will see that it is still syncing time once a second, but there is no flicker, or anything like that. :::EDIT::: The following links are 9 Sequential Frame Captures, taken from a video filmed with Fraps at 25FPS. With the Time script set to update time once a second. Ok, this first screenshot shows everything normal, just before a time update. the time in the top corner is 16:56 http://files.potholestudios.com/dazzaja ... ther/1.jpg This next image shows that the time has changed to the next second... (16:57) http://files.potholestudios.com/dazzaja ... ther/2.jpg Third image shows game time being updated by script, setting it back to (16:56) Noote, the sky has gone dark and the car lights are on. This here is your "Sky Flash" http://files.potholestudios.com/dazzaja ... ther/3.jpg This 4th image shows that the weather has fixed itself, but there is now water spray comming from the tyres. http://files.potholestudios.com/dazzaja ... ther/4.jpg more water spray http://files.potholestudios.com/dazzaja ... ther/5.jpg more water spray http://files.potholestudios.com/dazzaja ... ther/6.jpg more water spray http://files.potholestudios.com/dazzaja ... ther/7.jpg more water spray http://files.potholestudios.com/dazzaja ... ther/8.jpg more water spray http://files.potholestudios.com/dazzaja ... ther/9.jpg as you can see in those 9 frames of footage, the weather changed when the time updated, for only 1 frame of gameplay. i have been playing quite a bit with this, and pretty much every time update, the game goes to a random weather setting for 1 frame, then goes back. That my friend, is the sky flicker. So..... how do we go about stopping this from happening. My gues is we could get it to check what weather setting the game is currently at, and reset the same weather when the time is set. that SHOULD keep it from changing the weather for a brief second. which should stop the flickering. Link to comment
DazzaJay Posted January 15, 2008 Author Share Posted January 15, 2008 How would i go about getting this script to check to see what the weather is set to, and set the weather to the same setting at the same time as setting the time? Link to comment
[SKC]Whiskey Posted January 15, 2008 Share Posted January 15, 2008 # function syncTime() # local realTime = getRealTime() # local hour = realTime.hour # local minute = realTime.minute # local weatherID = getWeather() # setTime( hour , minute ) # setWeather(weatherID) # end # # setTimer ( syncTime, 1000, 0 ) Im a complete noob at scripting, so i dont have a clue if that even works. However if it does i still doubt it will stop the flickering. It will prolly just flicker faster since the weather will still be changed by setting the time ( if your theory is correct and it does indeed do that). Link to comment
Jumba' Posted January 15, 2008 Share Posted January 15, 2008 # function syncTime() # local realTime = getRealTime() # local hour = realTime.hour # local minute = realTime.minute # local weatherID = getWeather() # setTime( hour , minute ) # setWeather(weatherID) # end # # setTimer ( syncTime, 1000, 0 ) Im a complete noob at scripting, so i dont have a clue if that even works. However if it does i still doubt it will stop the flickering. It will prolly just flicker faster since the weather will still be changed by setting the time ( if your theory is correct and it does indeed do that). i tried that. but it flickers even more as the weather is "changed" (to the same one) every 500 milliseconds. Link to comment
[SKC]Whiskey Posted January 15, 2008 Share Posted January 15, 2008 Thats what i thought was going to happen. Link to comment
DazzaJay Posted January 15, 2008 Author Share Posted January 15, 2008 (edited) i have somthing that works! altho, its at a sacrifice of framerate...... function syncTime() local realTime = getRealTime() local hour = realTime.hour local minute = realTime.minute setTime( hour , minute ) end setTimer ( syncTime, 1000, 0 ) function syncweather() local weatherID = getWeather() setWeather( weatherID ) end setTimer ( syncweather, 1, 0 ) i have been testing it for a half hour, and it works really well, [sLR]Racer told me to put the weather check and sync into a seperate function, that does the check and update every 1MS. it starts to get a bit flashy if you go under 20FPS. how much of my FPS is lost to this method is, my normal FPS is 48, with the script like that, im down to 38~ so its a fair drop in performance. but it works. Edited January 15, 2008 by Guest Link to comment
Jumba' Posted January 15, 2008 Share Posted January 15, 2008 i have somthing that works! altho, its at a sacrifice of framerate...... function syncTime() local realTime = getRealTime() local hour = realTime.hour local minute = realTime.minute setTime( hour , minute ) end setTimer ( syncTime, 1000, 0 ) function syncweather() local weatherID = getWeather() setWeather( weatherID ) end setTimer ( syncweather, 1, 0 ) i have been testing it for a half hour, and it works really well, [sLR]Racer told me to put the weather check and sync into a seperate function, that does the check and update every 1MS. it starts to get a bit flashy if you go under 20FPS. how much of my FPS is lost to this method is, my normal FPS is 48, with the script like that, im down to 38~ so its a fair drop in performance. but it works. :::EDIT:::: well, after reloading the game, the flashing was back. grrrrr. you're setting the weather ever 1 ms? tbh, thats just crazy Link to comment
DazzaJay Posted January 15, 2008 Author Share Posted January 15, 2008 the main idea behind the 1ms updates was to do them "faster than the eye could see" it was working fine for a half an hour with no flasking, or flickering.... then.... after reloading the game, the flashing was back. grrrrr. so im back to square one on this. Link to comment
norby89 Posted January 16, 2008 Share Posted January 16, 2008 the main idea behind the 1ms updates was to do them "faster than the eye could see" the timer can't call the function that fast, minimum time interval is 50ms Link to comment
DazzaJay Posted January 16, 2008 Author Share Posted January 16, 2008 well, i know that the "Time Sync Tool" for Single Player has a "Weather Fix" to fix a similar problem, so thats proof that this thing can be fixed, and work properly, but i cant come up with any other ideas on how to get it to work without the flickers of weather changes. Link to comment
Mr.Hankey Posted May 16, 2008 Share Posted May 16, 2008 Hey look what i just found http://development.mtasa.com/index.php? ... teDuration With dp3 synced time will finally be possible =) Link to comment
Mr.Hankey Posted May 16, 2008 Share Posted May 16, 2008 Hey look what i just found http://development.mtasa.com/index.php? ... teDuration With dp3 synced time will finally be possible =) Link to comment
DazzaJay Posted May 16, 2008 Author Share Posted May 16, 2008 its fine now, all except for the weather flicking on each update. Link to comment
DazzaJay Posted May 16, 2008 Author Share Posted May 16, 2008 its fine now, all except for the weather flicking on each update. Link to comment
Brophy Posted May 16, 2008 Share Posted May 16, 2008 we will have the proper functions for it on dp3 http://development.mtasa.com/index.php? ... teDuration http://development.mtasa.com/index.php? ... teDuration Link to comment
Brophy Posted May 16, 2008 Share Posted May 16, 2008 we will have the proper functions for it on dp3 http://development.mtasa.com/index.php? ... teDuration http://development.mtasa.com/index.php? ... teDuration Link to comment
Recommended Posts