• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed Leveling: Divide By Zero Error Log

Pieter Boelen

Navigation Officer
Administrator
Storm Modder
Hearts of Oak Donator
@Levis: Here's an error.log entry for you:
Code:
RUNTIME ERROR - file: Leveling.c; line: 368
Divide by zero
Refers to this line:
Code:
void UpdateSkillImportance(ref chref, string expName, int skillExp)
{
   if(sti(chref.skill.(expName)) >= SKILL_MAX) return;
   //small bursts of experience will probably increase your importance more then one large burst.
   //At least thats what this function is aiming for.
   int nextSkill = makeint(CalculateSkillExperienceFromRank(sti(chref.skill.(expName))+1));
   //We want to know the percentage of experience we gathered for the nextskill
   //We take a random number from the skillExp to have randomization in it and favor small bursts
   float percentage = rand(skillExp) / nextSkill * 100; // <---------- HERE -------------
I also had a CTD during boarding just prior to seeing that issue, though I don't actually believe this is related to the crash.
Still, if it can be fixed, I'm sure it wouldn't hurt. ;)
 
@Levis: Here's an error.log entry for you:
Code:
RUNTIME ERROR - file: Leveling.c; line: 368
Divide by zero
Refers to this line:
Code:
void UpdateSkillImportance(ref chref, string expName, int skillExp)
{
   if(sti(chref.skill.(expName)) >= SKILL_MAX) return;
   //small bursts of experience will probably increase your importance more then one large burst.
   //At least thats what this function is aiming for.
   int nextSkill = makeint(CalculateSkillExperienceFromRank(sti(chref.skill.(expName))+1));
   //We want to know the percentage of experience we gathered for the nextskill
   //We take a random number from the skillExp to have randomization in it and favor small bursts
   float percentage = rand(skillExp) / nextSkill * 100; // <---------- HERE -------------
I also had a CTD during boarding just prior to seeing that issue, though I don't actually believe this is related to the crash.
Still, if it can be fixed, I'm sure it wouldn't hurt. ;)
hmmm....this shouldn't happen unless someone has a skill level of 0 somewhere ...
This means he didn't go trough the checks at the start of the init. This is only skipped for questchars. So could it be you where loading a scene where a quest character was?
 
hmmm....this shouldn't happen unless someone has a skill level of 0 somewhere ...
This means he didn't go trough the checks at the start of the init. This is only skipped for questchars. So could it be you where loading a scene where a quest character was?
Nope, no quest characters there. It was a boarding scene with me, some random crew of mine and a bunch of enemy soldiers.
 
This could very well be linked to the dead captains. Can someone confirm this is still an issue?
 
If that were so, how could it have been happening to me right at the beginning of a new game?
because the sea is initialized during the first load and the ships round you are checked already I believe.

If not please tell me which storyline etc so I can test myself
 
because the sea is initialized during the first load and the ships round you are checked already I believe.
My point was more: How can those captains be considered already dead at the beginning of the game? Nobody killed them yet.
And the worldmap encounters still worked at the start, suggesting that they weren't yet affected by that problem.

Unless.... They may not have been dead, but they were never correctly initialized to begin with.
And my "fix" may have helped there too. Possibly?

If not please tell me which storyline etc so I can test myself
I was doing my tests on Assassin.
 
Has anyone been checking their error.log after playing recently?
Does that error from the opening post still occur?
 
I just sailed from Tortue to San Juan and just looked and have no error.log. I also had skill ups before leaving Tortue.
 
When I got that error, I think it was during early game sea battles.
It doesn't seem to apply to the player, but probably to the enemy captains.
The suspicion is that this is now fixed by the same change I did to solve the empty worldmap encounters and crashes.
But it'll be good to have confirmation that players no longer see this one. :cheers
 
Haven't seen this error pop up in a while. think I fixed it.
 
Back
Top