Adding a Perk to an NPC

Post » Sat May 28, 2011 8:13 am

Hey everyone

I tried giving an NPC the Bloody Mess perk in his Actor Effect list, but it didn't have any effect, so I did some research and found out it doesn't work that way.

I spent an hour searching the threads here in the forum and the common method for this purpose seems to be adding a token item with a script attached to it to the NPC.

What I didn't find was the real basic information that a complete noob scripter (which I am) needs to set up such a token item.

I know how to create items and attach a script to them, but what would I write in the script if, let's say, I wanted to give an NPC the Bloody Mess effect (the one that makes... things go boom) and the Silent Running effect (chance to get detected when sneaking not increased by running).

I tried getting some clues to this by looking at the Perks in the GECK, but it seems like the perk system is using its own variables and stuff.

Can someone help?

Thank you so much!
User avatar
FLYBOYLEAK
 
Posts: 3440
Joined: Tue Oct 30, 2007 6:41 am

Post » Sat May 28, 2011 4:41 am

Hey everyone

I tried giving an NPC the Bloody Mess perk in his Actor Effect list, but it didn't have any effect, so I did some research and found out it doesn't work that way.

I spent an hour searching the threads here in the forum and the common method for this purpose seems to be adding a token item with a script attached to it to the NPC.

What I didn't find was the real basic information that a complete noob scripter (which I am) needs to set up such a token item.

I know how to create items and attach a script to them, but what would I write in the script if, let's say, I wanted to give an NPC the Bloody Mess effect (the one that makes... things go boom) and the Silent Running effect (chance to get detected when sneaking not increased by running).

I tried getting some clues to this by looking at the Perks in the GECK, but it seems like the perk system is using its own variables and stuff.

Can someone help?

Thank you so much!


It's my understanding that Perks don't work on NPC's. Though It looks like the Bloody Mess Effect is an Actor Value. You would set it on an actor and the game engine would do the rest. The actual Perk just uses this as one of its components. Take a look toward the bottom of this page: http://geck.gamesas.com/index.php/Stats_List

You could try setting it in an NPC's object script and see what it does

scn MyNPCScriptshort iDoOnceBEGIN GameMode     if (iDoOnce == 0)         MyNPCRef.SetAV BloodyMess 1         set iDoOnce to 1    endifEND 


You could also try using the actual spells that the Perks use:

if (MyNPCRef.IsSpellTarget PerkBloodyMess == 0)    MyNPCRef.AddSpell PerkBloodyMessendif


If you look in the Geck under Actor effects and Base Effects you will see these spells.

The spell for silent running would be PerkSilentRunning

These are both ability spells and I use ability spells on NPCs all the time. Whether the game engine actually does anything with these particular values on an NPC - I don't know.
User avatar
Fluffer
 
Posts: 3489
Joined: Thu Jul 05, 2007 6:29 am


Return to Fallout 3