Issue Data
|
Issue #20595: AbLegendaryScript errors
[06/05/2016 - 11:26:22AM] error: Cannot GetValuePercentage with None ActorValue
stack: [ (001C4719)].Actor.GetValuePercentage() - "<native>" Line ? [Active effect 2 on (001C4719)].AbLegendaryScript.OnHit() - "<unknown file>" Line ? [06/05/2016 - 11:26:25AM] error: Cannot GetValuePercentage with None ActorValue stack: [ (001C4719)].Actor.GetValuePercentage() - "<native>" Line ? [Active effect 2 on (001C4719)].AbLegendaryScript.OnHit() - "<unknown file>" Line ? [06/05/2016 - 11:26:36AM] error: Cannot GetValuePercentage with None ActorValue stack: [ (001C4719)].Actor.GetValuePercentage() - "<native>" Line ? [Active effect 2 on (001C4719)].AbLegendaryScript.OnHit() - "<unknown file>" Line ? [06/05/2016 - 11:26:38AM] error: Cannot GetValuePercentage with None ActorValue stack: [ (001C4719)].Actor.GetValuePercentage() - "<native>" Line ? [None].AbLegendaryScript.OnHit() - "<unknown file>" Line ? [06/05/2016 - 11:26:38AM] error: Cannot register unbound script to receive hit events stack: [None].AbLegendaryScript.RegisterForHitEvent() - "<native>" Line ? [None].AbLegendaryScript.OnHit() - "<unknown file>" Line ? 001C4719 is a leveled raider. During the game, it was a legendary raider (eventually, a grenade blew him from the roof). Thus, the effect applies to a matching target, and there is actually nothing wrong with the script. Nonetheless, it lost the actor's reference eventually. I have no clue how this can happen. Anyway, a sanity check in the OnHit() event wil prevent any side effects of such mysteries from occurring again: Event OnHit(ObjectReference akTarget, ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked, string apMaterial) ;EDIT: Added snity check to bail out if akTarget = none for whatever reason: If akTarget == None Return EndIf if akTarget.GetValuePercentage(Health) < HealthThreshhold && PoweredUp == false LegendaryPowerUp.cast(akTarget, akTarget) if (akTarget as Actor).GetCombatTarget() == Game.GetPlayer() LegendaryPowerUpMsg.Show() PowerUpSound.Play(akTarget) endif PoweredUp = true else RegisterForHitEvent(akTarget) endif EndEvent |
Related Issues: 23980
Re-opened this ticket, since checking for akTarget == none did not fix it.
However, checking for IsBoundGameObjectAvailable() does !
However, checking for IsBoundGameObjectAvailable() does !
Showing Comments 1 - 1 of 1