Jump to content

Papyrus errors, unsure how to troubleshoot


lesi123

Recommended Posts

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...