lesi123 Posted September 1, 2014 Share Posted September 1, 2014 I have a bloated save report from a user of my mod with the following errors: [Active effect 2 on (000D97F4)].BleedThemDryMonitorScript.OnHit() - "BleedThemDryMonitorScript.psc" Line ? [08/30/2014 - 03:33:01PM] warning: Assigning None to a non-object variable named "::temp2" stack: [Active effect 2 on (000D97F4)].BleedThemDryMonitorScript.OnHit() - "BleedThemDryMonitorScript.psc" Line ? [08/30/2014 - 03:33:01PM] Error: Cannot call HasKeyword() on a None object, aborting function call stack: [Active effect 2 on (000D97F4)].BleedThemDryMonitorScript.OnHit() - "BleedThemDryMonitorScript.psc" Line ? [08/30/2014 - 03:33:01PM] warning: Assigning None to a non-object variable named "::temp7" stack: [Active effect 2 on (000D97F4)].BleedThemDryMonitorScript.OnHit() - "BleedThemDryMonitorScript.psc" Line ? [08/30/2014 - 03:33:01PM] Error: Cannot call HasKeyword() on a None object, aborting function call stack: [Active effect 2 on (000D97F4)].BleedThemDryMonitorScript.OnHit() - "BleedThemDryMonitorScript.psc" Line ? [08/30/2014 - 03:33:01PM] warning: Assigning None to a non-object variable named "::temp2" stack: Below is my script (which uses the dynamic script method) that attaches itself to actors around the player. Scriptname BleedThemDryMonitorScript extends activemagiceffect Actor Property PlayerRef Auto Keyword Property WeapTypeBow Auto Spell Property BTDBleedingDamageSpellBOW Auto Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) if ((abHitBlocked != true) && (akAggressor == PlayerRef) && ((akSource as Weapon).HasKeyword(WeapTypeBow)) && (Utility.RandomInt() >= 75) && (PlayerRef.GetActorValue("Marksman") < 30)) BTDBleedingDamageSpellBOW.cast(PlayerRef) elseif ((abHitBlocked != true) && (akAggressor == PlayerRef) && ((akSource as Weapon).HasKeyword(WeapTypeBow)) && (Utility.RandomInt() >= 50) && (PlayerRef.GetActorValue("Marksman") >= 30) && (PlayerRef.GetActorValue("Marksman") < 60)) BTDBleedingDamageSpellBOW.cast(PlayerRef) elseif ((abHitBlocked != true) && (akAggressor == PlayerRef) && ((akSource as Weapon).HasKeyword(WeapTypeBow)) && (Utility.RandomInt() >= 25) && (PlayerRef.GetActorValue("Marksman") >= 60) && (PlayerRef.GetActorValue("Marksman") < 90)) BTDBleedingDamageSpellBOW.cast(PlayerRef) elseif ((abHitBlocked != true) && (akAggressor == PlayerRef) && ((akSource as Weapon).HasKeyword(WeapTypeBow)) && (Utility.RandomInt() >= 10) && (PlayerRef.GetActorValue("Marksman") >= 90)) BTDBleedingDamageSpellBOW.cast(PlayerRef) endif EndEvent I'm gathering that the script is trying to attach itself to weapon with no weapon type keyword and assigning it a temporary variable of None and then coming up empty handed when the keyword condition can't be used on a None variable. Is this what's going on? I have been using my own mod and not encountered any savegame bloat so I'm unsure how to recreate the issue or how to troubleshoot it. :/ Link to comment Share on other sites More sharing options...
lesi123 Posted September 2, 2014 Author Share Posted September 2, 2014 Does anyone know where I can find a guide on identifying or fixing issues related to bloat? I've done some searching around the web and can only find topics for mod users and not the modders. Link to comment Share on other sites More sharing options...
lofgren Posted September 2, 2014 Share Posted September 2, 2014 One thing I can tell you is that OnHit fires for spells, enchantments, poisons, and probably a bunch of other stuff like traps as well. Might try the following: if ((abHitBlocked != true) && (akAggressor == PlayerRef) && (akSource as Weapon) && akSource.HasKeyword(WeapTypeBow)) && (Utility.RandomInt() >= 75) && (PlayerRef.GetActorValue("Marksman") < 30)) This way the condition will return as false if akSource is not a weapon before it checks to see if akSource has a keyword. Link to comment Share on other sites More sharing options...
lesi123 Posted September 2, 2014 Author Share Posted September 2, 2014 Gotchya. That makes sense. I'll add it in and hope that clears up any issues mod users may have. Thank you! Link to comment Share on other sites More sharing options...
lofgren Posted September 2, 2014 Share Posted September 2, 2014 If that doesn't work might try adding if(akSource as weapon) as a separate condition that blocks the rest of the script from firing. It sort of depends on how Papyrus handles and statements within conditions. Link to comment Share on other sites More sharing options...
Recommended Posts