• 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 Error Logs with Maxed Out Skills

Talisman

Smuggler
Storm Modder
I have been looking at the Levelling & the amount of XP involved in each level.

I was using Numberpad 4 to add levels to my character

When I got the attached error report
with entries:-

Code:
RUNTIME ERROR - file: Leveling.c; line: 260
Divide by zero
RUNTIME ERROR - file: Leveling.c; line: 260
Divide by zero
RUNTIME ERROR - file: Leveling.c; line: 260
Divide by zero
RUNTIME ERROR - file: Leveling.c; line: 260
Divide by zero
RUNTIME ERROR - file: Leveling.c; line: 260
Divide by zero
RUNTIME ERROR - file: Leveling.c; line: 260
Divide by zero
RUNTIME ERROR - file: Leveling.c; line: 260


:read
 

Attachments

  • compile.log
    5.2 KB · Views: 68
  • system.log
    4.2 KB · Views: 79
  • error.log
    27 KB · Views: 90
chref.skillimportancetotal is probably missing or empty then for some reason.
@Levis: Where is that supposed to be set?
 
Did you use an old savegame?
 
As far as i could see this can only happen if you are maxed on all skills. Is that the case?
 
As far as i could see this can only happen if you are maxed on all skills. Is that the case?

This was at the start of a new game - so :no did not use an old Save game.

:yes - yes all the skills were eventually maxed out - I was using Numberpad 4 to see how much XP was required for a player to be a certain Level. So I went up from Level 1 to Level 105 - by which time all the skills had been maxed out for a while.

I though it might be something to do with that but was not sure - so I thought i had better check - just in case :napoleon.

:nerbz
 
Its not such a problem but maybe @Pieter Boelen could make a check in front of it. If the total is zero, mult should be zero
 
Its not such a problem but maybe @Pieter Boelen could make a check in front of it. If the total is zero, mult should be zero
I was just looking at that. If 'mult' is zero, is it still possible to level up at all?
If not, then it is REALLY important that the skills and ability points are matched up correctly.
That probably also means you would stop gaining HP, wouldn't it?
Are we going to have a fixed limit on the character level then?

I'm just doing some small tests now using Numpad 4 and noticed I do NOT get two skill points for each level-up any longer.
Perhaps on average I do, but I had to level-up a few times before getting any skill points at all.
Of course I did gain some percentages when doing it.
 
I can think of two solutions. This is @Levis' suggestion:
Code:
  int importance = 0;
   float importance_total = stf(chref.skillimportancetotal);
//   if (importance_total == 0.0) importance_total = 1.0; // PB: Prevent 'divide by zero' error
   float mult;
   float xp = 0;
   for(int n = 0; n < numskills; n++)
   {
     skill = GetAttributeName(GetAttributeN(skills, n));
     if(skill == "freeskill") continue;
     importance = sti(chref.skill.(skill).importance);
     //We got a total amount of XP to spend. We divide this over the different skills based on the importance of the skill
     if (importance_total > 0.0) mult = makefloat(importance) / importance_total;
     else             mult = 0.0;
This is an alternate option:
Code:
  int importance = 0;
   float importance_total = stf(chref.skillimportancetotal);
   if (importance_total == 0.0) importance_total = 1.0; // PB: Prevent 'divide by zero' error
   float mult;
   float xp = 0;
   for(int n = 0; n < numskills; n++)
   {
     skill = GetAttributeName(GetAttributeN(skills, n));
     if(skill == "freeskill") continue;
     importance = sti(chref.skill.(skill).importance);
     //We got a total amount of XP to spend. We divide this over the different skills based on the importance of the skill
     mult = makefloat(importance) / importance_total;
Both prevent error log entries. I originally made that second one with the idea that perhaps it doesn't prevent level-ups that way.

Of course Numpad 4 is a forced level-up so continues to work. But I have no idea if it would still work through regular play.

Additional notes:

I maxed out on my skills at level 60. Don't you use 100 ability points now to get all of those?
If so, no more level-ups once your skills are maxed out would mean you cannot gain all abilities yourself.

It is definitely not an "even 2 abilities per level-up" any longer. The first few level-ups I gained no abilities at all. And at some point I got 5 ability points in one go.
This doesn't necessarily need to be a bad thing; I said only last week that I didn't think the levels and abilities needed to be in line in the first place.
But I would like to check if that is intentional and whether this might have any large impact on the game further down the line?
 
Of course Numpad 4 is a forced level-up so continues to work. But I have no idea if it would still work through regular play.

Additional notes:

I maxed out on my skills at level 60. Don't you use 100 ability points now to get all of those?
If so, no more level-ups once your skills are maxed out would mean you cannot gain all abilities yourself.

It is definitely not an "even 2 abilities per level-up" any longer. The first few level-ups I gained no abilities at all. And at some point I got 5 ability points in one go.
This doesn't necessarily need to be a bad thing; I said only last week that I didn't think the levels and abilities needed to be in line in the first place.
But I would like to check if that is intentional and whether this might have any large impact on the game further down the line?


When I was using Numberpad 4 - I got one ability point per Level up consistently from Level 1 to Level 100.

:read
 
For ability points, yes. I was referring to skill points of which you used to get two per level.

As for that repair value, I take it you think the number looks rather high?
I saw that too; @Levis should be able to clarify on that one.
 
@Pieter Boelen if you use the old system you should get 2 skillpoints per level which you can distribute yourself. Else you will get xp for certain skills and it's possible to get 5 skill levels up for 1 normal level if you had them all pretty high already. It is balanced now. When there is no multiplier what so ever and you are playing on the 2nd or 3th difficulty you should reach all skill levels maxed out round level 50 I believe. But depending on multipliers (the 1.25x etc) and difficulty this can vary, but it should always be round level 50/60
Ability points you get 1 per Level and you need 100 to get maxed out indeed. First I changed the skills to be maxed out round 100 also but most people felt that was to hard so thats why you get 2 skill points per level. Changing this will also make sure you max out later.

About the fixed. You need the first fix. You will still level up. This function only determines which skills get the experience gained if there is no specific skill given. And when all skills are maxed out it else doesn't know which skill to give the XP, and this is right cause now all xp will be mutliplied with 0 which is right cause the skill is at level 10 already and we don't want it to get higher.
 
@Pieter Boelen if you use the old system you should get 2 skillpoints per level which you can distribute yourself. Else you will get xp for certain skills and it's possible to get 5 skill levels up for 1 normal level if you had them all pretty high already. It is balanced now. When there is no multiplier what so ever and you are playing on the 2nd or 3th difficulty you should reach all skill levels maxed out round level 50 I believe. But depending on multipliers (the 1.25x etc) and difficulty this can vary, but it should always be round level 50/60
Ability points you get 1 per Level and you need 100 to get maxed out indeed. First I changed the skills to be maxed out round 100 also but most people felt that was to hard so thats why you get 2 skill points per level. Changing this will also make sure you max out later.
Ah, so it is indeed intended now that you may get more or less than 2 skill points per level-up.
Then basically levelling up is quite a different thing from increasing your skills altogether.
In a way that does make sense as I doubt there is any sensible way to keep both systems in line yet also have the "low skills progress faster" idea.
Probably much, much simpler to have them independent. :onya

I wonder what would happen if people change difficulty in mid-game like you can. But I can't imagine that doing any harm either.
So then my earlier observations were no actual concerns and we should be good on them! :onya

You need the first fix. You will still level up. This function only determines which skills get the experience gained if there is no specific skill given. And when all skills are maxed out it else doesn't know which skill to give the XP, and this is right cause now all xp will be mutliplied with 0 which is right cause the skill is at level 10 already and we don't want it to get higher.
That is definitely good to have confirmed! Thanks for that. :cheers
 
the difficulty is checked when the XP is processed. It's not depended on the needed XP. So when you will changed your difficuly you will just notice the XP gaining faster or slower depending on what you choose.
 
Back
Top