![]() |
Well me and my friend KJL have started a great server but need to use the server time codeing to get some of our nocs to work right now i was wounding if mabe Stefan, And anyothers taht know it would help me out
-Thanks SLP Omega (PW Projects Team) |
Uhh, I belive you talk to Stefan about making your server P2P. Although, P2P often reduces the number of people that play on your server drastically.
|
Well less people = good. If I had a server I wouldn't want more than 15 people on at a time.
|
Quote:
|
bravo online... =p.. not OLD UGLY Bravo... the one that came back up... then became PW.. i used ta be GP Chief there and I knew EVERYONE because only about 20 people USED their accounts
|
Less people may be good, but decreasing players by going P2P has 2 possible effects.
A. You'll have less people, but still have a community of players. B. You'll have no players, and your server will crumble. Hopefully, effect A will be the effect going P2P will provide. |
Ok I can help you with the server time issue...
Currently, ALL servers (this includes non-pay servers) and clients have a build-in variable called "timevar". Every 5 seconds, timevar is incremented by 1 by the server. This is also saved by the server so that outages won't reset it :P On Graal 2001 this is how they have it setup: 30 ticks = 1 hour 720 = 1 day 17280 = 1 month 414720 = 1 year Now if you're a good scripter and want to do stuff with division to get each part, you'd probably want to do something like: NPC Code:this.time = timevar; BZZT! Won't work... Once it gets up to about 1 month, you start getting floating point errors with division. I recommend something like this: NPC Code: Do the same thing for month, day, etc etc... Of course something like HOUR would need you to start off at 0 and not 1, cause it's military time. Oh, and if someone like Kyle or Tyhm doesn't like this type of code, well... it's the best I could think of to get beyond the division problems. You may wanna put the time up too. You'd use: NPC Code:showimg 200,state.png,x,y; changeimgvis with a parameter of 4 lets you display stuff LOCALLY and in a fixed position. This way it can act like a status bar. Also more importantly: it makes the x/y PIXEL values, and not CELL values. So it's not 64x64 anymore with that, but it IS what you need. This should be all ya need to know. |
Example?
Could someone put an example of timevar and everything my head hurts TOO MANY NUMBERS...
|
Blah.
Timevar is an online variable which goes up with 1 every 5 seconds, it is counted globally.
|
...
I need an example... =( I am not to good at math.
|
I showed you examples... I put numbers that you can use for determining how many hours/days/etc have passed, and a general forumla for getting each part. Problem is you'll need to know SOME math to make such an NPC, since it's not exactly possible to do calculations without using math and all, and getting a useful number from "timevar" does require math.
|
| All times are GMT +2. The time now is 04:52 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.