Some questions about randomizing outfits and NPC loot proced

Post » Tue Nov 20, 2012 9:36 am

So I have 2 new questions, if anyone is willing to help me out:

1. How do you randomly assign outfits to an NPC based on a formlist and gamehour? I tried searching in the wiki but I don't think http://www.creationkit.com/FindRandomReferenceOfAnyTypeInList_-_Game is what I need.

2. Set up an NPC loot procedure. From what I can gather, basically I have to set up a Find and Acquire package at the end of combat but then I would have to add lots of lists for it to scan from. Is there a better way, using a script, to get the actor killed by the NPC, get his inventory list, and take items based on certain keywords?

A bonus question:

Is it possible to trigger the Race menu for an NPC? Like I want the player to customise the NPC on the fly like the player does with the PC.
I'm pretty sure that you can't, but what about using the Race menu to get the face, and then using these face settings on the NPC using SKSE functions?
User avatar
Noraima Vega
 
Posts: 3467
Joined: Wed Jun 06, 2007 7:28 am

Post » Tue Nov 20, 2012 4:05 pm

As to 1, I have been able to create an outfit for for my NPC housecarl and then select it on the inventory tab of the NPC actor creation area. I believe "outfits" is a CK item category that is very similar to form lists. Do the right click, new routine and name it so you can find it and it should b selectable in that inventory tab. I did not try using lvl items to create the outfit, so you can try and see if that works once you have a basic one working. You can also select a sleeping outfit on the inventory tab. I would imagine that using packages, where you specify the outfit might change based on hour?

Just ideas. I am not very proficient with scripting, so someone else might have to help you with the rest off this :)
User avatar
Alexander Lee
 
Posts: 3481
Joined: Sun Nov 04, 2007 9:30 pm

Post » Tue Nov 20, 2012 9:17 pm

Thanks for the reply, and for caring to as well :)

But I have already a bunch of outfits set up, with a simple script to change 2 of them when in interior and outside. I just want a script to randomly pick an outfit and put on my NPC.

I had hoped that someone had an idea, but maybe the title scared them away...
User avatar
brian adkins
 
Posts: 3452
Joined: Mon Oct 01, 2007 8:51 am

Post » Tue Nov 20, 2012 8:43 am

Maybe something like the following will work:

1. Add this property line to your script
Outfit[] Property OutfitArray  Auto

2. Add this function to the end of your script
Function ChangeOutfit(Actor myActor)   Int i = Utility.RandomInt(0, OutfitArray.Length - 1)   myActor.SetOutfit(OutfitArray[i])EndFunction

3. In your event block, use the new function like this
ChangeOutfit(Bob)


Once you are done making your changes to the script, use the "properties" button and fill the OutfitArray with as many different Outfits that you want

- Hypno
User avatar
Lloyd Muldowney
 
Posts: 3497
Joined: Wed May 23, 2007 2:08 pm


Return to V - Skyrim