Jump to content


BUG: Lore not calculating properly on level drain?


  • Please log in to reply
2 replies to this topic

#1 -Balder's Gait-

-Balder's Gait-
  • Guest

Posted 04 September 2011 - 05:01 PM

There may be a problem with the "Stat: Lore Modifier" (21) opcode, but perhaps this is just incorrect implementation on my part. I have a bard kit that applies a spell with an effect of decreasing the character's lore by 7 per level. This works fine, except when the character is level drained. The character's lore actually increases by a significant amount and then decreases appropriately with each subsequent drain. On a character with 18 intelligence and 17 wisdom, I have 56 Lore at level 13. Level drained once, my lore increases to 127 (wrap-around?) at level 11. Subsequent level drains decrease my lore by 20 (Bard standard lore, rather than the 6 that would be appropriate for my kit). I implemented this the same way Bioware implemented the Blade's pickpocket disadvantage, so I'm guessing it's a problem with the opcode itself or with the way lore is calculated on level drain. Lore seems to calculate properly after level drain for classes/kits that don't have the lore-decreasing spell applied.

If anyone knows a better way to implement this (I think the Blade's lore disadvantage is hard-coded, but I'm not sure), I'd appreciate the help.

#2 Pol

Pol
  • Member
  • 45 posts

Posted 07 September 2011 - 06:29 PM

I have 56 Lore at level 13. Level drained once, my lore increases to 127 (wrap-around?) at level 11.

Looks like an overflow problem, I'm guessing lore values are 7 bit integers (2^7 -1 = 127); thieving skills (which have the same problem) are 8 bit.

#3 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 23 October 2011 - 04:44 PM

I will have a look. Is this behaviour occurring without using TobEx?

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)