Author Topic: Clock Fix for large mods?  (Read 405 times)

Legacy_Jargh193

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Clock Fix for large mods?
« on: September 08, 2010, 06:19:18 pm »


               anyone have a fix that is small and fast for the clock stopping issue with mods with alot of areas?  I lost what I was using.
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Clock Fix for large mods?
« Reply #1 on: September 08, 2010, 07:04:17 pm »


               Although this will probably only compound other problems that are making the clock stop working correctly, A function like this might work:

//Function to add to the modules "OnHeartbeat" event.

void UpdateTime()

{

   int iHour = GetTimeHour ();

   int iMinute = GetTimeMinute ();

   int iSecond = GetTimeSecond ();

   int iMillisecond = GetTimeMillisecond();

   SetTime(iHour, iMinute, iSecond, iMillisecond);

}



//Modules "OnHeartbeat" script

void main()

{

   UpdateTime();

}


Hope that helps.
               
               

               
            

Legacy_Jargh193

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Clock Fix for large mods?
« Reply #2 on: September 08, 2010, 07:13:17 pm »


               well, I'm not using much on HB, so not sure how it can hurt...let's try it and find out '<img'>
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Clock Fix for large mods?
« Reply #3 on: September 08, 2010, 07:13:52 pm »


               You tested it? I would guess it does not work and also set time to one day in future, since when GetTimeHour return lets say 5, then I think there is 5 hours in the clocks already. If you set the time to 5 again, date will go to one day more.

I think the issue there is that clocks do not show 5 but still 4, so neither GetTimeHour will return 5, but still 4...
               
               

               
            

Legacy_Jargh193

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Clock Fix for large mods?
« Reply #4 on: September 08, 2010, 07:22:40 pm »


               does anyone know the reason for the clocks to stop ? just wondering while I build and test this.

ok...just tested it, and for me it worked, now I am only using 4 minutes per hour, not sure if that is what Shadow was refering to or not, but it works...Thanks GoG
               
               

               


                     Modifié par Jargh193, 08 septembre 2010 - 06:37 .
                     
                  


            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Clock Fix for large mods?
« Reply #5 on: September 08, 2010, 08:52:20 pm »


               The clock stops from poor scripting for the most part, sucking up resources that it needs to keep such scripts running all the time. Scripts that fire when they shouldn't (an empty area serves a script no purpose if it runs when no one is there to see it). As the clock is not essential to keep a module running, when resources are required, the clock stopping is a good warning sign.

Using a script to update the clock won't solve the bigger problem you already have.

FP!
               
               

               


                     Modifié par Fester Pot, 08 septembre 2010 - 07:52 .
                     
                  


            

Legacy_Jargh193

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Clock Fix for large mods?
« Reply #6 on: September 08, 2010, 09:25:14 pm »


               right now I have very few scripts and over 700 areas
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Clock Fix for large mods?
« Reply #7 on: September 08, 2010, 11:43:42 pm »


               I use my own module time keeper script to keep track everything, it works off a heartbeat, and it has never failed for me..

Heartbeat is the best way to track time flow in game, if the core game is unstable that is, or you have other problems, the variables set on an object in game doesn't fail..


btw, you may want to open your module in the tooslet, then open up your module folder, right click on the "temp0" folder select properties and read how many files you have, this is an indication of how many resources you are using.

I know there is a cap for the # of resources you can have, and if you go over this your module will start acting funky..
               
               

               


                     Modifié par Genisys, 08 septembre 2010 - 11:06 .
                     
                  


            

Legacy_Jargh193

  • Newbie
  • *
  • Posts: 36
  • Karma: +0/-0
Clock Fix for large mods?
« Reply #8 on: September 09, 2010, 04:40:44 am »


               I've always been a big fan of the 16K limit....ok, not really, which is why I always watch it closely, you need to as a builder or you'll end up heartbroken.
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Clock Fix for large mods?
« Reply #9 on: September 09, 2010, 06:15:33 am »


               700 Areas?!  >.<



               
               

               
            

Legacy_ehye_khandee

  • Hero Member
  • *****
  • Posts: 1415
  • Karma: +0/-0
Clock Fix for large mods?
« Reply #10 on: September 09, 2010, 09:57:31 pm »


               700 Areas is NOT TOO MANY, my own module runs fine, even the clock with over 1100 areas. The trouble with time is in your code, it is not always about too many files/objects/scripts but more often about what the scripts are doing (poorly) that is drawing resources off the clock and other 'expendable functions.'



Good luck cleaning the bad code.



Be well. Game on.

GM_ODA