Aller au contenu

Photo

Clock Fix for large mods?


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

#1
Jargh193

Jargh193
  • Members
  • 18 messages
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.

#2
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
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.

#3
Jargh193

Jargh193
  • Members
  • 18 messages
well, I'm not using much on HB, so not sure how it can hurt...let's try it and find out :)

#4
Shadooow

Shadooow
  • Members
  • 4 470 messages
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...

#5
Jargh193

Jargh193
  • Members
  • 18 messages
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 .


#6
Fester Pot

Fester Pot
  • Members
  • 1 394 messages
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 .


#7
Jargh193

Jargh193
  • Members
  • 18 messages
right now I have very few scripts and over 700 areas

#8
Genisys

Genisys
  • Members
  • 525 messages
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 .


#9
Jargh193

Jargh193
  • Members
  • 18 messages
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.

#10
Genisys

Genisys
  • Members
  • 525 messages
700 Areas?! >.<




#11
ehye_khandee

ehye_khandee
  • Members
  • 855 messages
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