Aller au contenu

Photo

Module Clock Not Working Correctly


  • Veuillez vous connecter pour répondre
15 réponses à ce sujet

#1
Sadira of Tyr

Sadira of Tyr
  • Members
  • 172 messages
In our module, we have the time set at 5 minutes per hour. However when playing the module on our server, the time goes much slower, and sometimes it just stops. I recall playing over an hour yesterday, and the time did not change at all. Our players have noticed this as well. I have checked the toolset, and I could find nothing wrong with the module settings.

Is there anything that could cause the module time to stop? Any help would be appreciated.

Thank you.

#2
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
I think you need a persistent clock script for your mod.I use this one that was reccommended to me.


http://nwvault.ign.c....Detail&id=2721

#3
Sadira of Tyr

Sadira of Tyr
  • Members
  • 172 messages
Thank you, but the link is not working.

#4
Sadira of Tyr

Sadira of Tyr
  • Members
  • 172 messages
Well, I got the link to work. Thank you. Posted Image

I'm not sure if this will help, but I will try it in the module.

#5
Fester Pot

Fester Pot
  • Members
  • 1 393 messages
Clock stoppage in a module is due to too much going on, that the module resorts the clock resources as unimportant, taking up that resource to keep up with the demand of the server.

Poorly written scripts that eat lots of resources is normally the problem. Scripts that are left running when no players are present in an area, to NPCs AI being set to LOW so they continue to cross ATs or move about if no players are present in an area. Two small examples, of course that chew up resources.

You can get around it by updating the clock in your module's heartbeat, but this is only a short fix for a more serious problem.

int iHour = GetTimeHour ();
int iMinute = GetTimeMinute ();
int iSecond = GetTimeSecond ();
int iMillisecond = GetTimeMillisecond();

SetTime(iHour, iMinute, iSecond, iMillisecond);


FP!

#6
Sadira of Tyr

Sadira of Tyr
  • Members
  • 172 messages
Thank you for helping.

That could be the heartbeat scripts I put in outdoor areas for vampire sun damage. The scripts must be still running when people leave the areas. That would explain the server crashing more often lately.

I'm not great at scripting, but I usually get what I need with the script generator. I put the scripts in the heartbeat section of each of the outdoor areas. They check for subrace vampire, and give damage if needed. Would these scripts keep running after the area is empty? It is about when I added those scripts, that the clock problems started.

#7
Knight_Shield

Knight_Shield
  • Members
  • 444 messages
 @Fester Pot

Ok so let me try to get tis straight.

1)Doesnt matter module size as long as scripts are working correctly?

2)The link I posted keeps time persistent and advances?http://nwvault.ign.c....Detail&id=2721

3)Your script only advances but is not persitent?

int iHour = GetTimeHour ();
int iMinute = GetTimeMinute ();
int iSecond = GetTimeSecond ();
int iMillisecond = GetTimeMillisecond();
SetTime(iHour, iMinute, iSecond, iMillisecond);

So I need both scripts?

Modifié par Knight_Shield, 02 août 2012 - 05:04 .


#8
Thayan

Thayan
  • Members
  • 244 messages
A word of warning about using the SetTime(iHour, iMinute, iSecond, iMillisecond) workaround though - if the unmodified, module-wide version of Time Stop is cast at just the right moment when that function is called, the Time Stop spell will last indefinitely, necessitating a module reboot since no one other than DMs will be able to do anything.

Modifié par Thayan, 02 août 2012 - 06:48 .


#9
Sadira of Tyr

Sadira of Tyr
  • Members
  • 172 messages
Thanks guys. Posted Image

I've disabled the heartbeat scripts for now, to see if the problem persists. If it continues, then I will add the scripts you posted.

#10
Groove Widdit

Groove Widdit
  • Members
  • 378 messages
Fester, I have the same issue - time stopping at midnight. I used your script to fix it. Are you saying that the scripts are running in all areas all the time? How do you fix that?

#11
virusman

virusman
  • Members
  • 282 messages
If your server is running on Linux, you can use NWNX Fixes to get rid of this bug.

Modifié par virusman, 11 août 2012 - 12:34 .


#12
ehye_khandee

ehye_khandee
  • Members
  • 855 messages
Lean clean scripting is the cure and best solution. Find the cause and clear that up, you will find your game runs better all around for the effort. Size is not really much of an issue. We run a server with 1337+ Areas, feature rich, with no lag, no clock issues, no crashes and generally no restarts needed (DM's events can sometimes leave artifacts that merit a restart, but still, under general play, we've left it run for months without a restart). Linux server too.

Be well. Game on.
GM_ODA

http://playnwn.com

#13
Sadira of Tyr

Sadira of Tyr
  • Members
  • 172 messages
Well, I've been trying to find the cause, but no luck so far. Is there a way to check which scripts are running?

#14
ehye_khandee

ehye_khandee
  • Members
  • 855 messages
Check your messages.

G

#15
Sadira of Tyr

Sadira of Tyr
  • Members
  • 172 messages
Thank you ehye_khandee, for helping with my script troubles. Posted Image 

Modifié par Sadira of Tyr, 15 août 2012 - 11:49 .


#16
ehye_khandee

ehye_khandee
  • Members
  • 855 messages
*blushes*

You're very welcome. Sometimes it is fun to debug other peoples stuff (cause you run into issues that may be new) - a good mental exercise. With luck, I'll find the resource drain and we'll get your module running like a race engine again. Be patient with me tho, I'm putting about an hour a day on this and it may take a few days, a few tests and a few tries to get to the goal.

Be well. Game on.
GM_ODA