Jump to content

Forcing an NPC to draw/sheathe their weapon via script


Minuos

Recommended Posts

Hi all,

 

I have some randomly generated NPCs who I want to draw weapons with the player. I'm currently using OnAnimationEvent() to detect when the player draws or sheathes their weapon and a duplicate package on the NPCs, with the Weapon drawn flag checked and a conditional for if the player's weapon is out.

 

I'd like the change to be instant, but the NPCs only seem to realise they need to draw/sheathe when the player enters or exits sneak mode. I've tried EvaluatePackage(), but no luck.

 

Any suggestions?

 

 

Solved: OnAnimationEvent() wasn't firing. I just added the following line to both packages under On Begin, which means I could remove all the code pertaining to this from the core script. My NPCs now draw/sheathe when the player does.

(akActor as Actor).EvaluatePackage(True) 
Edited by Minuos
Link to comment
Share on other sites

No, they aren't teammates. I did toy with the teammate system and that keyword when I was trying to give the player credit for their kills but it overrides/breaks other features of mine that are core to the mod.

Edited by Minuos
Link to comment
Share on other sites

  • Recently Browsing   0 members

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