Adding items to races

Post » Sun Nov 18, 2012 3:45 pm

Hi all,

What I want to do is have it so that on different races there are different body parts to loot off them.
For Example - You could look Legs, arms, torso, head and tail off an Argonian, and Legs, arms, Torso, Head, Tail and Ears off a Khajjit and so on.

I was wondering what would be the best way to do this so that at least most, if not all, NPCs of different races have different body parts to loot.

Would it also be possible to make it so that they would only appear on death (I know about OnDeath Events, but wondering where would I put the scripts?)

Thanks

SoulLimit
User avatar
Benji
 
Posts: 3447
Joined: Tue May 15, 2007 11:58 pm

Post » Mon Nov 19, 2012 6:34 am

Sounds like you need SKSE.
User avatar
A Dardzz
 
Posts: 3370
Joined: Sat Jan 27, 2007 6:26 pm

Post » Sun Nov 18, 2012 5:58 pm

That's usually done on a per-character basis, not a per-race basis, and determined by your selection in the drop down list labelled "Death" in the "Traits" tab of the "Actor" window.

One approach you might try is using http://www.gamesas.com/topic/1349649-dynamically-attaching-scripts-to-actors-near-the-player/ to attach a ReferenceAlias script to nearby actors of an appropriate race in order to catch their OnDeath events.

Cipscis
User avatar
BEl J
 
Posts: 3397
Joined: Tue Feb 13, 2007 8:12 am

Post » Mon Nov 19, 2012 1:08 am

Okay, quick question then. is there a way to find the race of the actor as he dies, in the OnDeath event? Or would I have to limit different Aliases to specific races?

Also, which function would add the items to the inventory of the actor?
User avatar
Lalla Vu
 
Posts: 3411
Joined: Wed Jul 19, 2006 9:40 am

Post » Mon Nov 19, 2012 6:31 am

Q1: self.GetRace()
Q2: self.addItem()
User avatar
Isaac Saetern
 
Posts: 3432
Joined: Mon Jun 25, 2007 6:46 pm

Post » Sun Nov 18, 2012 3:09 pm

When I try to use Self.GetRace() I get the following error:

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SL_CombatAliasNPCScript.psc(33,6): GetRace is not a function or does not existNo output generated for SL_CombatAliasNPCScript, compilation failed.
User avatar
bonita mathews
 
Posts: 3405
Joined: Sun Aug 06, 2006 5:04 am

Post » Mon Nov 19, 2012 5:25 am

Does your script extend Actor?
User avatar
Susan Elizabeth
 
Posts: 3420
Joined: Sat Oct 21, 2006 4:35 pm

Post » Sun Nov 18, 2012 9:53 pm

No, but it does now and now it works. Thank you :D
User avatar
Scarlet Devil
 
Posts: 3410
Joined: Wed Aug 16, 2006 6:31 pm

Post » Sun Nov 18, 2012 7:28 pm

Please don't use the "http://www.creationkit.com/Function_Reference#Special_Variables" special variable to call functions. Non-global functions from within other non-global functions (including events) called without specifying an object on which to call them are already automatically called on the "Self" object.

"Self" is only useful when that information needs to be stored in a property or passed to a function as an argument.

Cipscis
User avatar
Claire Vaux
 
Posts: 3485
Joined: Sun Aug 06, 2006 6:56 am

Post » Sun Nov 18, 2012 7:41 pm

Cipscis, do you know much about what they were on about in that link that you gave me. As I cannot get it to work, even just the basic one like he has does not work for me...

If you knew a bit, would you mind looking at what ive done with it to see where i've gone wrong? - the test file has been uploaded here - http://jumbofiles.com/n33wz811ok1o
User avatar
JaNnatul Naimah
 
Posts: 3455
Joined: Fri Jun 23, 2006 8:33 am


Return to V - Skyrim