Jump to content

Script on impact without damage


1f5c6s16f5

Recommended Posts

Hi.

I'm trying to make a weapon with a script that runs on the targeted NPC. I already got the script and everything working but only when the damage is at least 1.

Setting the damage to 0 makes the engine think you missed (or at least I'm guessing it does) and doesn't run the on impact script.

If the weapon does do damage then the script runs, but now the NPC is angry because you shot him.

Are there any simple workarounds for this issue, ideally without alerting the NPC or interrupting animations?

 

I'm aware of the "minor crime" setting that makes the NPCs forgive you if you holster your weapon, but I don't want to have to do that after each shot.

Edited by 1f5c6s16f5
Link to comment
Share on other sites

  • 2 months later...
  • 6 months later...

I finally sorted this out, posting a solution in case anyone else is trying and stumbles upon this. I used this method to make my Prototype Shrink Ray mod.

First go ahead and create your weapon, give it a damage value of "0"

Attach an object script using the OnFire method as below. This does require the use of the JIP LN NVSE plugin.

ref bTargeted

begin OnFire
    set bTargeted to GetCrosshairRefEx
    if bTargeted.isActor
        ; do the thing you want to do to the actor here using the ref
    endif
end

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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