Jump to content

Debugging papyrus scripts in game? How?


Recommended Posts

Hey guys I'm trying to get this script to work for my perk overhaul. It starts with a perk entry point to apply combat hit spell, the spell containing a single effect with this script attached. these are all touch/fire and forget types.

 

ScriptName AbForceStopCombat extends ActiveMagicEffect

;-- Properties --------------------------------------
Spell Property PistolWhipSpell Auto
;-- Variables ---------------------------------------
Actor victim
;-- Functions ---------------------------------------

Event OnEffectStart(Actor akTarget, Actor akCaster)
RegisterForHitEvent(akTarget)
EndEvent

Event OnHit(ObjectReference akTarget, ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, \
bool abSneakAttack, bool abBashAttack, bool abHitBlocked, string apMaterial)
victim = akTarget as Actor
If (abBashAttack)
PistolWhipSpell.cast(victim)
victim.stopcombat()
EndIf
RegisterForHitEvent(self)
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
UnRegisterForHitEvent(akTarget)
EndEvent

 

 

 

 

Now I want it to cast the PistolWhipSpell spell property connected to the pistolwhipstun spell I made, which uses the default fo4 magic effects BlindnessPoison and DeafnessPoison which are self/fire and forget types. As well as force the npc it casts the spell on out of combat. This should let you pistol whip and become unnoticed by an enemy, even at close range. It works when I enter the effects on the npc through console commands, but I don't think it is triggering on the npc through this script.

 

I feel it is either a problem with the Apply Combat Hit spell entry point, or the abBashAttack boolean in the OnHit event. if anyone can spot where I'm going wrong with this, please help. If you don't know what it is, but know how I can put some lines to debug what abBashAttack is and how to activate that debug messaging in game, so i can test it out myself with more sureity, that would be of great help too.

Edited by FatsackTony1
Link to comment
Share on other sites

  • Recently Browsing   0 members

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