![]() |
time
here's my current time/day/night script, I wanted to make it so it was more like real time, and possible modify it so it matched current time in real time. How would I do this?
NPC Code://#CLIENTSIDE |
Make a script that counts, I guess.
That, or make creative use of timevar. It increases by one every 5 seconds. Use it to your advantage, boy. |
Quote:
|
If you want to be the real time, use timevar2,
PHP Code:
|
Quote:
|
Quote:
|
I just need it to count hours and such, the other stuff would be easy to add anyway, I am still having trouble setting the time though. Can you edit the timevar? Or is there another way? Like:
NPC Code: Any help? |
Quote:
|
Quote:
|
Quote:
|
Hmm, not gonna restart my server anyway XD, but is there a way to modify this, without disabling the ammount for hours min, etc?
|
Quote:
NPC Code: |
On Classic we have a 24 hour clock for doing accurate day/night. We use timevar2 on clientside (seconds since they turned thier computer on). To change this into somthing synced for everyone, we calculate the offset to the serverside timevar2 (unix time) when they log in, and then adjust for this before calculating the actual time.
Theoretically, everyone is then getting thier times as unix time, give or take a small error for lag reasons. |
here's what I'm using right now, but everyone has different times, and I think the time changes when you log on x_X suggestions?
NPC Code://#CLIENTSIDE |
Time changes when you log in, different times for everyone x_X bad
|
Quote:
As for excaliber7388's problem, i don't see anything that would cause everyone to have different times. However, setbackpal is very outdated and should no longer be used. Instead, replace with seteffect. |
How do you sync it???(And it changes EVERY time you log on in my current script
|
Quote:
|
Quote:
|
I've tried it serverside...didn't work, explain how I could do this :\ (all i did was move the //#CLIENTSIDE line to the middle, where the text is displayed, etc.
|
Quote:
The calculation is not summing an ammount of seconds periodically anyway, it is always resalsculating the time from the stored offset, and the clientside timevar2. If we count the difference caused by the delay transmitting the offset back to the player as negligable, then the clock is acurate enough to create evolving day/night and weather effects. We can even creat extra snow in winter for example, by correctly identifying weather changes and simulating these as sinusoids (using the synced clock, with varying offsets and periods). As for players playing in the dark, as weather and day/night are not central to the theme of Classic, users have the option to disable them (infact, for all players these effects are disabled by default). |
Everyone talks about syncing the clock x_x I have no idea how to do this :\
|
Note: setbackpal is BAD BAD BAD BAD BAD BAD -Shoots it-
Do not use this command. Ever. Ever! Or behold the wrath of Rabid's projectile kitties! :D (Don't ask) Anyway, use seteffect(red,green,blue,alpha);, all numbers are between 0 and 1, and Alpha is the darkness of the level. Fiddle with it! Set all four values to 0 to reset it. |
Quote:
triggeraction 0,0,clientside,WEAPONNAME,#v(timevar2); } //#CLIENTSIDE if (created) { triggeraction 0,0,serverside,WEAPONNAME,; } if (actionclientside) { this.timingthingamajig=strtofloat(#p(0)); } |
Quote:
Quote:
|
Quote:
|
Quote:
|
Thanks, sorry I havn't been able to explain this much, I was at school, and the teacher came over a lot x_X . Thanks for the help though guys, I'll see if it works (it should)
It works, (i think) changed a bit (added timeout) thanks! |
excaliber7388.... one small notice never ever ever use setbackpal
Its an old outdated retarted command that simply replaces the colours from the tileset... wich is unnessasery in your case. Just use seteffect and so on.. ontop of that setbackpal is removed in g2 as far as I recall >.> |
I don't like backpal anyway, I only used it because i wasn't thinking, I thought the effect would replace other effects, etc. Like I said...not thinking XD
|
Quote:
[EDIT] Another thing, excaliber, don't delete your threads when the problem is solved, people might have the same problem as you, and can use your threads for help. [/EDIT] |
Quote:
Excaliber, you would probably be doing yourself a number of favours by learning to script before trying to create a playerworld. If it must be said, scripts that are created during the development of scripting skills often don't compare to a script that is written, with sufficient knowledge from the beginning. So far, you have asked the forums to fix a large number of scripts for your playerworld. I don't think this is really a good idea. |
Quote:
|
Yeah, I'll admit I am unfamiliar with online scripting, as you may notice, all my scripts would have worked offline, but not online, this is because i learned offline for years, without ever reading a guide, etc. so sorry, but I find this is the best way to learn, to see correct scripts, to change them, etc. Sorry I've been a pain in the ass, soon you won't hear much from me here (untill i switch my server to GS2 x_x not looking foward to THAT)
|
Quote:
|
But i like old script =*(
I wish it was 100% useable when GS2 is activated on that server, that way i can switch NOW and start putting scripts in GS2, then once I'm good at it, switch it back |
Quote:
|
Quote:
|
wait, completly? I heard some things were removed, that only a few worked, (though these were things that no longer we used in GS i think) so I could have
something like destroy instead of, destroy(), even with GS2 enabled? |
Quote:
|
| All times are GMT +2. The time now is 04:31 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.