NPC Invincibility and Keeping Still in Combat

Post » Sun Nov 18, 2012 8:15 am

Hi there!

The goal: I want to have two NPCs, a farmer and a bear, spawn as the player approaches (but out of sight) and begin to fight. I want them to remain very near the space they spawned, which is on top of a rock bluff. I want these two NPCs to be invincible so that neither will kill the other until the player arrives. When the player arrives, their health should suddenly be active and they should become vulnerable allowing the player to step in and kill one or the other.

The current solution: I have a trigger box that, when loaded, enables a pre-placed bear and farmer and starts them fighting one another. Then, when the player reaches the box itself, an OnEnter script activates and, currently, does nothing except pop-up a message. I'm not sure if this is the best way to do it and I'd be totally open to suggestions but so far it seems to work well.

The problem: I have no idea to freeze the NPCs' health (making them invincible) and then unfreeze it. They also have a nasty habit of wandering off and I'd like to keep them rooted.

I appreciate any help you could give!
User avatar
Sxc-Mary
 
Posts: 3536
Joined: Wed Aug 23, 2006 12:53 pm

Post » Sun Nov 18, 2012 9:34 am

I'm just wondering if you would be able to disable the AI for the farmer and the bear (Stop them doing anything), it would not make them invisible, but it would stop them killing each other before the player got there.

You can find out about the function here:
http://www.creationkit.com/EnableAI_-_Actor

It simply freezes them in place, so while it does not make them invincible, it may be the next best thing??
User avatar
sw1ss
 
Posts: 3461
Joined: Wed Nov 28, 2007 8:02 pm

Post » Sun Nov 18, 2012 9:47 am

I've never used the creation kit, but, couldn't you set some variable for the NPCs, say, IsEssential, to true, and when the OnEnter script activates, set IsEssential to false?
User avatar
darnell waddington
 
Posts: 3448
Joined: Wed Oct 17, 2007 10:43 pm

Post » Sun Nov 18, 2012 4:12 am

Looking on the wiki, there is a Function called SetInvulnerable which sets whether an NPC is invulnerable or not, not sure how that works, but you could give it a go?
Wiki page is here : http://www.creationkit.com/SetInvulnerable_-_ActorBase

So yeah, there is also an SetEssential function as well if that does not work and you want to try that. - http://www.creationkit.com/SetEssential_-_ActorBase

Seems like there are multiple options in that field?

Good Luck :D
User avatar
Red Sauce
 
Posts: 3431
Joined: Fri Aug 04, 2006 1:35 pm

Post » Sat Nov 17, 2012 8:10 pm

Essential actors can still get their health drained, though, they just go into bleedout rather than dying. SetInvulnerable is probably what you want.
User avatar
Reanan-Marie Olsen
 
Posts: 3386
Joined: Thu Mar 01, 2007 6:12 am

Post » Sun Nov 18, 2012 4:18 am

SetInvulnerable would probably be what I'm looking for!

However, it works on ActorBase, which means its going to go ahead and apply itself to all instances of that actor and it looks like it might work a bit oddly on leveled actor. Is there a way to apply this function only to a specific reference of an actor? Is that something that can be done?
User avatar
Ysabelle
 
Posts: 3413
Joined: Sat Jul 08, 2006 5:58 pm

Post » Sun Nov 18, 2012 10:51 am

What about SetGhost? The actor can neither deal or receive damage and it's an Actor function, not ActorBase.
User avatar
April D. F
 
Posts: 3346
Joined: Wed Mar 21, 2007 8:41 pm

Post » Sun Nov 18, 2012 7:52 am

SetGhost is definitely working. Never would've thought of that thanks!
User avatar
Charlie Sarson
 
Posts: 3445
Joined: Thu May 17, 2007 12:38 pm


Return to V - Skyrim