Author Topic: Bugged Saves  (Read 810 times)

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Bugged Saves
« on: December 13, 2011, 04:46:46 am »


               Anyone have any idea why, and how to fix some bugged saves? We have some undead spawns that have say 85 will in the toolset, and no gear that is boosting will or wisdom, yet when they save vs death to undeath the logs are showing saves of 16. I would much appreciate any advice.
Laz
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Bugged Saves
« Reply #1 on: December 13, 2011, 09:41:11 pm »


               Just an FYI in case anyone is interested. I believe I found the problem/solution (although I don't know the cause), but apparently either the toolset is not applying saves correctly from creature class levels and the bonus saves feature, or there is some script in our mod disallowing this. Either way the net result is it was calculating the saves based of their ability stats. Simply increasing their base wisdom solved this.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Bugged Saves
« Reply #2 on: December 14, 2011, 06:01:43 am »


               

Lazarus Magni wrote...

Just an FYI in case anyone is interested. I believe I found the problem/solution (although I don't know the cause), but apparently either the toolset is not applying saves correctly from creature class levels and the bonus saves feature, or there is some script in our mod disallowing this. Either way the net result is it was calculating the saves based of their ability stats. Simply increasing their base wisdom solved this.


There is a toolset bug that does not count the epic saves correctly in the display, but this shouldn't yield 60+ difference in saving throws even for a level 180 creature, unless you are allowing a class to exceed 60 levels or have an altered .2da.

Is cls_savthr_wiz.2da altered?
               
               

               


                     Modifié par WhiZard, 14 décembre 2011 - 06:03 .
                     
                  


            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Bugged Saves
« Reply #3 on: December 14, 2011, 06:16:46 am »


               It's not one of our overrides. So not that I know of, unless it is in a CEP hak...
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Bugged Saves
« Reply #4 on: December 16, 2011, 05:53:57 am »


               

Lazarus Magni wrote...

It's not one of our overrides. So not that I know of, unless it is in a CEP hak...


I have isolated the issue.  It lies in the epicsaves.2da.  This .2da supports up to 60 epic levels (80 total HD).  After that the epic saves will register as 0 unless more lines are added.  I had assumed that this wasn't capped so low.

The toolkit calculations ignore what classes were taken pre-epic and count each classes saves as if you had leveled in it from level one.  If the creature is a single class this will perfectly match the in-game saves.  If it is multi-classed and in epic levels there can be a discrepancy.

Note that there is a similar issue with epic BAB (from epicattacks.2da)  if more than 60 epic levels are taken.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Bugged Saves
« Reply #5 on: December 16, 2011, 08:30:09 am »


               Thank you Whiz, that is indeed helpfull info. So a couple questions, where are these 2da located? I don't see them in the source folder. Are they in one of the CEP haks? Also they be edited to fix this then I take it?
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Bugged Saves
« Reply #6 on: December 16, 2011, 08:53:08 pm »


               

Lazarus Magni wrote...

Thank you Whiz, that is indeed helpfull info. So a couple questions, where are these 2da located? I don't see them in the source folder. Are they in one of the CEP haks? Also they be edited to fix this then I take it?


If viewing from NWN explorer they would be under "NWN: HotU Main Data"  not under "NWN: HotU Patch Data" as they were never updated by a patch.   Once opened and converted to text you can add the remaining lines without problem (a good 100 lines of adding to account all the way up to level 180).  It might be easier to copy and paste the added lines from excel where you can set up an algorithm to do the simple progression calculations for you.

I am guessing that this only needs to be given server side (so long as the first 20 lines are not altered) as PC leveling would not find conflict with the later lines, especially not the added lines.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Bugged Saves
« Reply #7 on: December 16, 2011, 09:23:55 pm »


               I just fixed the issue - you can download it here: LINK - put the 2DA into your server override and it should fix the issue

The epicattacks.2da is fixed already in my Patch project, if you uses it you are safe, if not you should consider it '<img'>. Unfortunately I haven't realized that epic saves has the same issue...
               
               

               


                     Modifié par ShaDoOoW, 16 décembre 2011 - 09:25 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Bugged Saves
« Reply #8 on: December 16, 2011, 09:57:29 pm »


               

ShaDoOoW wrote...

I just fixed the issue - you can download it here: LINK - put the 2DA into your server override and it should fix the issue

The epicattacks.2da is fixed already in my Patch project, if you uses it you are safe, if not you should consider it '<img'>. Unfortunately I haven't realized that epic saves has the same issue...



ShaDoOoW, I'm playtesting this right now, and the game doesn't seem to recognize the added lines for either epic progression.  I have made one batch for keeping the progression going at 1/2 and another for capping the progression and epic level 60 values.  Even in a module made after an override batch was placed, I still am getting the same reading as in the unfixed for creatures above 80HD.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Bugged Saves
« Reply #9 on: December 16, 2011, 10:05:00 pm »


               Damn, if this doesnt work then I dont know how to fix it - maybe NWNX might allow to set saves but without it you can only use effect which is capped to mm fifty? I think.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Bugged Saves
« Reply #10 on: December 16, 2011, 10:11:40 pm »


               

ShaDoOoW wrote...

Damn, if this doesnt work then I dont know how to fix it - maybe NWNX might allow to set saves but without it you can only use effect which is capped to mm fifty? I think.


Creatures have their own save modification factors (for each save type) that doesn't apply to the cap.  This goes as high as 250 which is plenty more than you need as the max saving throw bonus that the saving throw functions register is 127.

As to the extra lines, I have verified that the first 60 lines (the defined ones) are being used (tested by setting weird values), but the ones after line 60 do not get referred to.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Bugged Saves
« Reply #11 on: December 16, 2011, 10:24:42 pm »


               OK then this should work if I understood you correctly:

void main()
{
int nHD = GetHitDice(OBJECT_SELF);
 if(nHD > 80)
 {
 int nSave = nHD/2;
 effect eSave = EffectSavingThrowIncrease(SAVING_THROW_FORT,nSave);
 eSave = EffectLinkEffects(eSave, EffectSavingThrowIncrease(SAVING_THROW_REFLEX,nSave));
 eSave = EffectLinkEffects(eSave, EffectSavingThrowIncrease(SAVING_THROW_WILL,nSave));
 ApplyEffectToObject(DURATION_TYPE_PERMANENT,SupernaturalEffect(eSave),OBJECT_SELF);
 }
}

(EDIT: forget about it it doesnt work)
Lazarus: Add this piece of code into your OnSpawn script (nw_c2_default9 is default one), it should fix it then.

Whizard, BTW you did tested also epicattack.2da ? It also didn't worked? Because I tested this 2da on a player character above 40lvl (using custom NWNX plugin) and it worked.
               
               

               


                     Modifié par ShaDoOoW, 16 décembre 2011 - 11:11 .
                     
                  


            

Legacy_wyldhunt1

  • Sr. Member
  • ****
  • Posts: 443
  • Karma: +0/-0
Bugged Saves
« Reply #12 on: December 16, 2011, 10:26:52 pm »


               I suppose that if you really wanted a kludged fix and didn't mind making a lot of changes, you could make a new include script with custom save functions.
 

int MyFortSave(int nDC, object oObject = OBJECT_SELF)
{
   int nSave = GetFortitudeSavingThrow(oObject);
   int nLevel = GetHD(oObject);
   int nResult;
   if (nLevel > 80)
   {
      nSave += StringToInt(Get2daString("epicsaves.2da", "Fort", nLevel));
   }
   if (d20+nSave>nDC)
   {
      nResult = TRUE;
   }
   return nResult;
}

 
I'm pulling that code out of the Abyss, as I'm at work and don't have access to anything right now, but you get the idea.
Then, you'd need to use Biosearcher or something similar to search all of the times that a save is made in the default scripts and replace them all with your new function…
 
It would be a PITA, but it might work.
               
               

               


                     Modifié par wyldhunt1, 16 décembre 2011 - 10:31 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Bugged Saves
« Reply #13 on: December 16, 2011, 10:28:12 pm »


               

ShaDoOoW wrote...

Whizard, BTW you did tested also epicattack.2da ? It also didn't worked? Because I tested this 2da on a player character above 40lvl (using custom NWNX plugin) and it worked.


I tested it on a variety of creatures.  I did not use a plugin, and PC leveling up may be different than creature, or the plugin may have found a max lines constant and changed it.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Bugged Saves
« Reply #14 on: December 16, 2011, 11:08:17 pm »


               

WhiZard wrote...
I tested it on a variety of creatures.  I did not use a plugin, and PC leveling up may be different than creature, or the plugin may have found a max lines constant and changed it.

Seems that way...

Anyway I tried my script with a creature of 120HD so script tried to apply 60 bonus to all saves but (didnt mattered if I apply a bonus to SAVING_THROW_ALL or to specific saves. But created get only 20. So its capped and neither this solution works then.