How to change a person essential (or protected prefer)

Post » Sat Jun 14, 2014 6:31 am

So on one of my other quests (more simple one really. Go to a NPC in need because she had her trinket stolen by a band of thugs. Go after them, kill the bad guys, retrieve the stone, and take it back)

The relationships are already setup for the rewarding player. However, there is an encounter from one of the bandits that can debate whether the player wants them as their allied follower or not. The choice making will all be determine. (already know if I gave the relationship change up a negative to the npc, chances are they'll attack the player on site)

But the NPC isn't protected (or essential. I looked through the scripts on Actor Script and can't find IsProtected.) Anyway, I want to learn how to change them to where only the player can kill them (or can't kill at all), so that if the player wants the npc to join them, they can as an important role model. and of course if not, then he or she can gut the NPC open like a pop belly pig, and it'll gain no protection what so ever. But that part is already taken care of!

To the point. This is what I have setup from what the example told me:

bool Function IsEssential() native
; Is Lala essential?
If (Lala.IsEssential())
Debug.Trace("Lala is essential")
endIf
However, my result is:
Starting 1 compile threads for 1 files...
Compiling "TIF__02001DE7"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__02001DE7.psc(18,1): no viable alternative at input 'If'
No output generated for TIF__02001DE7, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__02001DE7
Not entirely sure what it means by If, but I assume it's talking properties. What else am I missing? (and if anyone knows the IsProtected formula, please share it with me)
My other project is on hold because it keeps crashing and I'm waiting on another section of the forum to give me an answer whether I need to delete it or they know what the problem is. Thanks in advanced!

User avatar
Alexandra walker
 
Posts: 3441
Joined: Wed Sep 13, 2006 2:50 am

Post » Sat Jun 14, 2014 11:09 am

Take a look at Aela the Huntress, she becomes Unessential at the end of Tokens of Hircine, so this is close to what you want to do.

There are other temporary essentials in the game in case you can't find the script code in the above

http://elderscrolls.wikia.com/wiki/Essential_Characters_%28Skyrim%29

User avatar
Eric Hayes
 
Posts: 3392
Joined: Mon Oct 29, 2007 1:57 am


Return to V - Skyrim