Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-28-2001, 10:50 AM
Komieko Komieko is offline
Registered User
Join Date: Mar 2001
Posts: 494
Komieko is on a distinguished road
Post

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)
Reply With Quote
  #2  
Old 03-28-2001, 11:09 PM
freddyfox freddyfox is offline
Banned
freddyfox's Avatar
Join Date: Mar 2001
Posts: 6,705
freddyfox is on a distinguished road
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.
Reply With Quote
  #3  
Old 03-29-2001, 12:48 AM
Fai Fai is offline
!!!!!!!!!!!!!!!!!!!!!!!!!
Fai's Avatar
Join Date: Mar 2001
Location: New York
Posts: 4,491
Fai will become famous soon enough
Send a message via ICQ to Fai Send a message via AIM to Fai
Well less people = good. If I had a server I wouldn't want more than 15 people on at a time.
__________________
SIGNATURE
Reply With Quote
  #4  
Old 03-29-2001, 02:54 AM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by Fai
Well less people = good. If I had a server I wouldn't want more than 15 people on at a time.
Yup, I agree on that, plus less people means less lag and you actually know everybody who plays.
__________________

Reply With Quote
  #5  
Old 03-29-2001, 08:44 AM
Mustang1988 Mustang1988 is offline
Registered User
Mustang1988's Avatar
Join Date: Mar 2001
Location: California
Posts: 0
Mustang1988 is on a distinguished road
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
__________________
Reply With Quote
  #6  
Old 03-30-2001, 09:39 AM
Crono Illusion Crono Illusion is offline
no. just no.
Crono Illusion's Avatar
Join Date: Mar 2001
Posts: 3,088
Crono Illusion will become famous soon enough
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.
__________________
NOTHING prances like a pony.
Reply With Quote
  #7  
Old 03-31-2001, 01:23 AM
JoMomma JoMomma is offline
Registered User
Join Date: Mar 2001
Posts: 43
JoMomma is on a distinguished road
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;
this.year = int(this.year/414720);



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:
for (this.year=1;this.time<414720;this.year++) {
this.time -= 414720;
}



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;
changeimgpart 200,x,y,width,height;
changeimgvis 200,4;



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.
__________________
Temporary disabled
Stefan Knorr
Reply With Quote
  #8  
Old 03-31-2001, 11:50 PM
Grey_Mage Grey_Mage is offline
Registered User
Join Date: Mar 2001
Location: Graal
Posts: 72
Grey_Mage is on a distinguished road
Send a message via AIM to Grey_Mage Send a message via Yahoo to Grey_Mage
Example?

Could someone put an example of timevar and everything my head hurts TOO MANY NUMBERS...
__________________

Quote:
Mess with the best, die like the rest...
Reply With Quote
  #9  
Old 04-01-2001, 01:18 AM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Blah.

Timevar is an online variable which goes up with 1 every 5 seconds, it is counted globally.
__________________

Reply With Quote
  #10  
Old 04-01-2001, 01:19 AM
Grey_Mage Grey_Mage is offline
Registered User
Join Date: Mar 2001
Location: Graal
Posts: 72
Grey_Mage is on a distinguished road
Send a message via AIM to Grey_Mage Send a message via Yahoo to Grey_Mage
...

I need an example... =( I am not to good at math.
__________________

Quote:
Mess with the best, die like the rest...
Reply With Quote
  #11  
Old 04-01-2001, 04:15 AM
JoMomma JoMomma is offline
Registered User
Join Date: Mar 2001
Posts: 43
JoMomma is on a distinguished road
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.
__________________
Temporary disabled
Stefan Knorr
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:38 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.