Author Topic: Time problem  (Read 374 times)

Legacy_Talon

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
Time problem
« on: July 06, 2014, 10:38:44 am »


               

I had a strange problem in my module..the time don't pass..only if i force hours i could! :/


I don't know how check and what script influence it!



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Time problem
« Reply #1 on: July 06, 2014, 11:07:27 am »


               Try Edit > Module Properties > Advanced.

If Minutes/Hour is set to zero, it might explain your problem...

The default is 2.
               
               

               
            

Legacy_Talon

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
Time problem
« Reply #2 on: July 06, 2014, 11:21:14 am »


               

no..it's 10 :/



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Time problem
« Reply #3 on: July 06, 2014, 11:41:06 am »


               

In bigger modules time really doesnt pass. At least on the clocks, the real time is still correct and can be accessable from NWScript (GetTime GetDate)


 


the solution is to check for current time and if last stored hour changed then to set time by NWScript command.


 


Also, if you have this issue you will probably have issue also with slow closign doors and AOE spell heartbeat not functional...



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Time problem
« Reply #4 on: July 07, 2014, 06:28:56 pm »


               

Also do not advance the time in situations where the game can be paused (this mostly applies to single player modules),  the time seems to only be effectively changed when the time is already passing.



               
               

               
            

Legacy_Talon

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
Time problem
« Reply #5 on: July 21, 2014, 09:37:59 am »


               

I saw that night never coming and death corpse remain to ground forever.


there is a  script that control generally the time passed?



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Time problem
« Reply #6 on: July 22, 2014, 02:01:33 am »


               

The Ingame clock stopping or losing dawn to day and dusk to night transitions are the first signs of server wide lag. While it occurs on many PWs, if you're really picky, detailed, bah .. just outright anal in your building and scripting, your module could never suffer from it. For my own module, I had to do alot of things in conjunction to get the clock to be reliable. Palletes are trimmed, scripts optomized, area sizes decreased in many instances, building details like setting most objects to plot and static along with limiting placeables that interfere with pathfinding in hostile areas and tons more. By being almost obsessive in how I build nowadays, my module clock rarely if ever falters now (960 areas currently). Before I became obsessed with efficiency, my module clock would stop (only 250 or so areas then) quite often.


 


I do have a clock forcing script if needed though. I used it in my module's OnHeartBeat event until around a year and a half ago.


 


void main()
{
int iHour = GetTimeHour ();
int iMinute = GetTimeMinute ();
int iSecond = GetTimeSecond ();
int iMillisecond = GetTimeMillisecond();
SetTime(iHour, iMinute, iSecond, iMillisecond);
}


               
               

               
            

Legacy_Talon

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
Time problem
« Reply #7 on: July 22, 2014, 10:11:49 pm »


               

Seems now time pass again! thanks for help.


But dead corpse  and loot of enemy stay there forever..maybe i must change something else?



               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Time problem
« Reply #8 on: July 22, 2014, 11:19:15 pm »


               


Seems now time pass again! thanks for help.


But dead corpse  and loot of enemy stay there forever..maybe i must change something else?




Corpses have a fade time that can be set in the creature's properties. If the creature has items or coins found as treasure on them, their corpse will either remain until looted or a loot drop placeable (corpse/bones/etc) created where the creature died. Loot placeables that still have loot in them also will not fade out until empty. Most folks handle cleanup functions in an area's OnExit event.


               
               

               
            

Legacy_Talon

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
Time problem
« Reply #9 on: July 24, 2014, 10:03:02 am »


               

A cleanup functions in an area's OnExit event could be perfect! But i don't know how do it :/



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Time problem
« Reply #10 on: July 24, 2014, 11:43:41 am »


               


A cleanup functions in an area's OnExit event could be perfect! But i don't know how do it :/




this solution is a little exhaustive if you dont already use same script for every area OnEnter and OnExit which has several advantages


this is easy to do anytime by moneo/letoscript (when I get home I send a letoscript to add script into each area) but there is a different method which wil allow you do do this without need to modify every area - placeable with OnHeartbeat script - can send later if you are interested in this - its a single placeable you will place into any area and this cleans loots from whole module


               
               

               
            

Legacy_Talon

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
Time problem
« Reply #11 on: July 24, 2014, 12:23:43 pm »


               

Yes..the last could be easy way maybe!!'<img'>



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Time problem
« Reply #12 on: July 24, 2014, 01:57:10 pm »


               


Yes..the last could be easy way maybe!! '<img'>




trash_hb.nss



int GetIsPCInArea(object oArea)
{
object oPC = GetFirstPC();
 while(GetIsObjectValid(oPC))
 {
  if(GetArea(oPC) == oArea)
  {
  return TRUE;
  }
 oPC = GetNextPC();
 }
return FALSE;
}

void main()
{
int nTh = 1;
object oArea,oItem, oTrash = GetObjectByTag("BodyBag");
 while(GetIsObjectValid(oTrash))
 {
 oArea = GetArea(oTrash);
  if(GetIsObjectValid(oArea) && !GetIsPCInArea(oArea))
  {
  oItem = GetFirstItemInInventory(oTrash);
   while(GetIsObjectValid(oItem))
   {
   DestroyObject(oItem);
   oItem = GetNextItemInInventory(oTrash);
   }
  }
 oTrash = GetObjectByTag("BodyBag",nTh++);
 }
}

Place into any non-static (and prefferaly plot) placeable into OnHeartbeat event.


               
               

               
            

Legacy_Talon

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +0/-0
Time problem
« Reply #13 on: July 25, 2014, 10:58:04 am »


               

thanks '<img'>