Jump to content

Photo

Making bandits essential with a script

script

  • Please log in to reply
3 replies to this topic

#1
IanRB

IanRB

    Regular

  • Members
  • PipPip
  • 83 posts

Hey everyone. So, I have a quick question, would it be possible to make a quest that runs every time you enter a new location, checks for enemies around with "bandit" on their name, and makes them essential? I'm doing a pacifist no-kill run using NPC Knockout Overhaul, and sometimes bandits will die in one hit skipping bleedout state completely, so I'd like to make sure there are no accidental kills.

I wanna know if its possible 'cause I'm starting to dip my toes on Papyrus scripting (which would be the ideal way to go about this as far as I know), and having tried coding before and hating it, I don't wanna waste time for no reason.

If it's possible, some pointers would be much appreciated. 

Thank you!



#2
dylbill

dylbill

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,346 posts

Yes it's possible. There's a papyrus function SetEssential which works on actor bases. https://www.creation...ial_-_ActorBase So the function would be SomeActor.GetActorBase().SetEssential()

 

What you could do, ls make a cloak spell with conditions on it in the Creation Kit, IsEssential == 0, then put the script on the cloak's magic effect. 

 

Scriptname SetEssentialScript extends ActiveMagicEffect 

Event OnEffectStart(Actor akTarget, Actor akCaster)
    Utility.Wait(0.1) 
    akTarget.GetActorBase().SetEssential()
EndEvent
You can put more conditions on the cloak if you only want it to apply to certain NPC types.


#3
IanRB

IanRB

    Regular

  • Members
  • PipPip
  • 83 posts

Thanks so much! That's a lot of the work done already haha. I'll definitely learn more and pursue this then, thank you again!



#4
dylbill

dylbill

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,346 posts

No problem. Good luck!







Also tagged with one or more of these keywords: script

Page loaded in: 1.196 seconds