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.
Clock Fix for large mods?
Débuté par
Jargh193
, sept. 08 2010 05:19
#1
Posté 08 septembre 2010 - 05:19
#2
Posté 08 septembre 2010 - 06:04
Although this will probably only compound other problems that are making the clock stop working correctly, A function like this might work:
Hope that helps.
//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
Posté 08 septembre 2010 - 06:13
well, I'm not using much on HB, so not sure how it can hurt...let's try it and find out
#4
Posté 08 septembre 2010 - 06:13
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...
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
Posté 08 septembre 2010 - 06:22
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
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
Posté 08 septembre 2010 - 07:52
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!
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
Posté 08 septembre 2010 - 08:25
right now I have very few scripts and over 700 areas
#8
Posté 08 septembre 2010 - 10:43
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..
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
Posté 09 septembre 2010 - 03:40
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
Posté 09 septembre 2010 - 05:15
700 Areas?! >.<
#11
Posté 09 septembre 2010 - 08:57
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
Good luck cleaning the bad code.
Be well. Game on.
GM_ODA





Retour en haut






