triptherift Posted April 17, 2016 Share Posted April 17, 2016 (edited) I'm using a binding package based on SitTarget. Problem is when the NPC gets attacked by another NPC, they go into bleedout - that package overrides the binding, and they drop. How do I get this to stop? I think there is something called setrestrained, but the documentation is lacking and I can't figure out how to script something with it, or what to attach a script to. And, I don't want them stuck there permanently, just while the binding package is running ( I release them when the hostile NPC is dead). And I'm not sure if this will stop major attacks like fireballs, unrelenting force, etc. Any help appreciated. Edited April 17, 2016 by triptherift Link to comment Share on other sites More sharing options...
InAComaDial999 Posted April 17, 2016 Share Posted April 17, 2016 The function you want is indeed setrestrained. ActorReference.SetRestrained(true) to restrain them, and (false) to remove it. When they are restrained they won't move no matter what; this is used not just for shackles but for things like the drivers in the carriage system. Link to comment Share on other sites More sharing options...
triptherift Posted April 17, 2016 Author Share Posted April 17, 2016 Thanks, I looked at the torture victims in the Dark Brotherhood for inspiration, and could find no such scripting in the quest or packages. Where do they use it on the carriage drivers, in a package? Link to comment Share on other sites More sharing options...
InAComaDial999 Posted April 17, 2016 Share Posted April 17, 2016 (edited) For the carriage drivers it's done in CarriageDriverScript.psc. For the horses (they are restrained as well) it is done in CarriageSystemScript.psc. Not sure where the vanilla torture victims are done. I helped out on the "Dawnstar Sanctuary Expansion" mod, in that one we attached a simple 4-line script to the additional torture victim actors: Scriptname RestrainTortureVictim extends Actor Event OnLoad() self.SetRestrained() EndEventOf course, these are meant to be permanently restrained. In your case you would need to do it in a quest script since you want to release them eventually. Edited April 17, 2016 by InAComaDial999 Link to comment Share on other sites More sharing options...
triptherift Posted April 17, 2016 Author Share Posted April 17, 2016 (edited) I'm using a SitTarget package referenced to a shackle marker. The package then is attached and used by actor "Andromeda" under "conditions", one of which is Andromeda must be the actor. When the conditions are no longer met, the package ends. I tried to attach a script to the package and it compiles fine but does nothing. I used this: Scriptname Binding extends Actor Event OnLoad()Actor Andromeda Andromeda.SetRestrained()EndEvent Not working. I also tried this by attaching directly to the shackle marker, same result. So that script works when attached directly to the NPC, but that does me no good at all. I can't clear it. And the way it's used in game, it's not meant to be cleared. So I'm wondering if this is a pretty useless function for doing what I need to do. Edited April 18, 2016 by triptherift Link to comment Share on other sites More sharing options...
InAComaDial999 Posted April 18, 2016 Share Posted April 18, 2016 You need an actor reference not an actor. Link to comment Share on other sites More sharing options...
triptherift Posted April 18, 2016 Author Share Posted April 18, 2016 (edited) Do you have some specific code in this instance that you actually know would work? Or know of a mod that has actually done what I need to do? I tried: Creating a new questAssigning a reference alias for the actor (and reserved the alias)Attaching a script to the ref alias Nope Using an object reference (the NPC was placed as persistent reference) Nada The only thing that worked was using SetRestrained directly on the actor. That isn't going to work for me. This is way harder than what it should be... Edit, NM, figured it out - used a quest script and then a fragment to attach the function to a ref alias in that quest. Works perfect. Edited April 28, 2016 by triptherift Link to comment Share on other sites More sharing options...
Recommended Posts