larsepan Posted October 8, 2018 Share Posted October 8, 2018 I'm working on a mortal NPC follower. The conundrum: An - IsProtected 0 NPC >> becomes an IsProtected 1 NPC - when following. I could set their healrate / magickarate to zero, and sure the rates will remain the same. However, there appears to be a bonus regen rate for active followers. I guessed that this had to be because of the additional protected status. So I tried to test it out: In game, I thought I'd try something like - SetProtected NPC 0 - but nope. SetProtected doesn't seem to be a command. In CK, I thought I'd try to compile something like - actorProperty.SetProtected(false) - but nope. SetProtected doesn't appear to be a function. Huh. Any ideas? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 8, 2018 Share Posted October 8, 2018 SetProtected requires using the ActorBase rather than the specific actor. You'll need to use GetActorBase on the actor first before calling SetProtected. Something like: myActor.GetActorBase().SetProtected(false) Link to comment Share on other sites More sharing options...
larsepan Posted October 8, 2018 Author Share Posted October 8, 2018 SetProtected requires using the ActorBase rather than the specific actor. You'll need to use GetActorBase on the actor first before calling SetProtected. Something like: myActor.GetActorBase().SetProtected(false)Right. Much like SetEssential ActorBase 1 etc. It's just that SetProtected ActorBase 1 doesn't appear to exist as a console command. Plus, I had thought that ActorBase would be the script requirement, but this CK page confused me regarding Actor. Link to comment Share on other sites More sharing options...
larsepan Posted October 8, 2018 Author Share Posted October 8, 2018 Thanks, btw, IsharaMeradin. :cool: Hmm. Not sure the ActorBase route is going to fix this, as the ActorBase is already mortal. Link to comment Share on other sites More sharing options...
SeraphimKensai Posted October 8, 2018 Share Posted October 8, 2018 This is a snippet of the script I made to toggle an NPC between Protected/UnProtected status: function OnEffectStart(Actor Target, Actor Caster) actorbase TargetBase = Target.GetActorBase() if TargetBase.IsProtected() == false TargetBase.SetProtected(1 as Bool) debug.MessageBox("Target is Protected.") else TargetBase.SetProtected(0 as Bool) debug.MessageBox("Target is Not Protected.") endIf endFunction Link to comment Share on other sites More sharing options...
larsepan Posted October 8, 2018 Author Share Posted October 8, 2018 (edited) This is a snippet of the script I made to toggle an NPC between Protected/UnProtected status: function OnEffectStart(Actor Target, Actor Caster) actorbase TargetBase = Target.GetActorBase() if TargetBase.IsProtected() == false TargetBase.SetProtected(1 as Bool) debug.MessageBox("Target is Protected.") else TargetBase.SetProtected(0 as Bool) debug.MessageBox("Target is Not Protected.") endIf endFunction Nice spell! I made a quick Mortality config thanks to both your help. It works fine to toggle protected on and off. It does seem that NPCs, while following, don't appear to be using their ActorBase protected settings. Is that right? Some testings: (1) Before following: NPC has 0 for Protected.(2) Before following: Use dialogue to change ActorBase Protected value to true. (3) Before following: Disable/Enable NPC - NPC has 1 for Protected.(4) During following: NPC has 1 for Protected.(5) During following: Use dialogue to change ActorBase Protected value to false.(6) During following: Disable/Enable NPC - NPC has 1 for Protected.(7) Ungroup NPC: NPC has 0 for Protected. (Edit: Just for more context)(1) Before following: NPC has 0 for Protected.(2) During following: NPC has 1 for Protected.(3) Ungroup NPC: NPC has 0 for Protected. Interesting, eh? Edited October 8, 2018 by larsepan Link to comment Share on other sites More sharing options...
larsepan Posted October 8, 2018 Author Share Posted October 8, 2018 Looks like a DialogueFollower Quest Alias might be the culprit. Going to unflag and test. Link to comment Share on other sites More sharing options...
JonathanOstrus Posted October 8, 2018 Share Posted October 8, 2018 Keep in mind that *any* follower will then be unprotected. Link to comment Share on other sites More sharing options...
larsepan Posted October 8, 2018 Author Share Posted October 8, 2018 Keep in mind that *any* follower will then be unprotected. lol, well aware. Link to comment Share on other sites More sharing options...
Recommended Posts