How to get an NPC to unequip Armor during a package

Post » Tue Nov 20, 2012 3:07 pm

Okay, let me just start off by saying I'm not that good when it comes to technical jargon, and scripting is pretty difficult for me, but I try to understand it regardless.

I've made myself a bit of a hot spring area for my home. It's a waist-deep "lake" with steam coming out of it to look "relaxing" and "hot". Here's what I want:
I have a Woodcutter. I want that Woodcutter to chop wood during the day, and at night go to the hot spring and bathe/relax for the night, then return to chopping wood in the morning.

NOW! I managed to get him to stop cutting wood and whatnot, and he goes to the hot springs no problem. Here's my dilemma that I hope you guys can help me figure out:::::

I WANT him to UNEQUIP his armor (Gloves, boots, and topless fur armor), get down into his skivvies (or his Loincloth in this case) and wear, well, nothing while he bathes. Then when he is done and goes back to his woodchopping I want him to re-equip his gloves, boots, and fur armor. Problem is, I don't know how to make it happen >.<

I saw the "Wear Sleep Outfit" option under the package window, problem is I am reading on the wiki that that option is obsolete...plus it doesn't seem to work when I try it anyway (I'm stubborn like that).

So is there a...condition I add to the package in question? Or something? All I want is his armor to be unequipped when he's at the hot springs, and then when he goes back to cutting wood he puts his armor back on.

Thanks if you can help guys, this would've been a really neet idea...if I could figure out how to do it
User avatar
Amie Mccubbing
 
Posts: 3497
Joined: Thu Aug 31, 2006 11:33 pm

Post » Tue Nov 20, 2012 3:13 am

Oh! Addendum!

I THINK I have an idea how to get it to happen. I'm using a furniture marker (SitCrossLegged) for the spot where the Woodcutter NPC is to sit and relax at night. What if I attached a script to that marker that, when the marker is in use (When the NPC is sitting on the marker) it forces his armor to unequip? Then when he gets up, it re-equips his armor because the marker is not in use. Would that work?

Not that I know diddly squat about which script to use...
User avatar
Valerie Marie
 
Posts: 3451
Joined: Wed Aug 15, 2007 10:29 am

Post » Tue Nov 20, 2012 3:33 am

If the he is wearing an outfit package you should be able to use the http://www.creationkit.com/SetOutfit_-_Actor function.
User avatar
Chloe Yarnall
 
Posts: 3461
Joined: Sun Oct 08, 2006 3:26 am

Post » Tue Nov 20, 2012 2:54 pm

If the he is wearing an outfit package you should be able to use the http://www.creationkit.com/SetOutfit_-_Actor function.

So if the marker has that script attached to it, the NPC will wear that outfit for as long as the NPC is using that marker? Or do I attach the script to the NPC?

Edit: Okay, I'm not sure I know what to do here. Do I create a new script? What do I write in the script? That entry in the wiki isn't helping. I've got more questions now than answers ^^;
User avatar
helliehexx
 
Posts: 3477
Joined: Fri Jun 30, 2006 7:45 pm

Post » Tue Nov 20, 2012 4:14 pm

If he has an outfit that is the outfit dropdown in inventory, you can find what he wears here. Now create an empty outfit for bathing.
before you command him to bath, you should have the option to run an papyrus fragment.
woodcutter.SetOutfit(emptyoutfit)
after he is done you restore the old outfit.
woodcutter.SetOutfit(furarmor3) or something.
Sorry but I have not worked with packages yet mostly scripts.
User avatar
Dona BlackHeart
 
Posts: 3405
Joined: Fri Dec 22, 2006 4:05 pm

Post » Tue Nov 20, 2012 6:02 pm

If he has an outfit that is the outfit dropdown in inventory, you can find what he wears here. Now create an empty outfit for bathing.
before you command him to bath, you should have the option to run an papyrus fragment.
woodcutter.SetOutfit(emptyoutfit)
after he is done you restore the old outfit.
woodcutter.SetOutfit(furarmor3) or something.
Sorry but I have not worked with packages yet mostly scripts.

The package is set to work (cut wood) from 7am to 7pm. From 7pm to 7am he lounges in the hotsprings. I'm just not sure how the script would tell which package is being used. How would the script know that the work package would use the fur armor, and the bathing package would use the default "nvdecloth" (loincloth)?

I literally have no understanding of scripting whatsoever. Guess I should've mentioned that at the beginning ^^;


Edit: I did just think of an idea, however. What if there was a trigger box around the hot springs, that when you enter the trigger box, it strips you of your gear, but when you exit, it puts everything back on? I guess the issue then would be how would the trigger box know what to re-equip.
User avatar
Catherine Harte
 
Posts: 3379
Joined: Sat Aug 26, 2006 12:58 pm

Post » Tue Nov 20, 2012 5:19 pm

The trigger box should work, you just need something to trigger the line to change outfit.
User avatar
Ridhwan Hemsome
 
Posts: 3501
Joined: Sun May 06, 2007 2:13 pm

Post » Tue Nov 20, 2012 11:56 am

The trigger box should work, you just need something to trigger the line to change outfit.

Yeah but I, again, have no idea how to do that. Ah well
User avatar
Laura Ellaby
 
Posts: 3355
Joined: Sun Jul 02, 2006 9:59 am

Post » Tue Nov 20, 2012 2:07 am

On the package itself:

At the start,

akActor.SetOutfit(NullOutfit)

and then on the change and end sections

akActor.SetOutfit(NormalOutfit)

where NullOutfit and NormalOutfit are defined as outfit properties; NullOutfit is an empty outfit record and NormalOutfit is whatever the NPC wears by default.

SetOutfit() automatically "eats" the old outfit, so you don't need to worry about removing anything. Flag the package as "weapons unequipped."
User avatar
Elea Rossi
 
Posts: 3554
Joined: Tue Mar 27, 2007 1:39 am

Post » Tue Nov 20, 2012 11:12 am

On the package itself:

At the start,

akActor.SetOutfit(NullOutfit)

and then on the change and end sections

akActor.SetOutfit(NormalOutfit)

where NullOutfit and NormalOutfit are defined as outfit properties; NullOutfit is an empty outfit record and NormalOutfit is whatever the NPC wears by default.

SetOutfit() automatically "eats" the old outfit, so you don't need to worry about removing anything. Flag the package as "weapons unequipped."

is "akActor" the name of my NPC? (For instance: aKoiIslandWoodcutter) or do I keep it as "akActor"?

and "(NormalOutfit)" would be their work uniform right? (For instance aKoiWoodcutterOutfit)

so this'd look like

aKoiIslandWoodcutter.SetOutfit(aKoiWoodcutterOutfit)

right?
User avatar
Roanne Bardsley
 
Posts: 3414
Joined: Wed Nov 08, 2006 9:57 am

Post » Tue Nov 20, 2012 5:28 pm

"akActor" is a generic reference; it always points to the person executing the package, just like "akSpeaker" in dialogue is the person saying the line.

You don't need to change "akActor" at all.
User avatar
Claudz
 
Posts: 3484
Joined: Thu Sep 07, 2006 5:33 am

Post » Tue Nov 20, 2012 5:02 pm

"akActor" is a generic reference; it always points to the person executing the package, just like "akSpeaker" in dialogue is the person saying the line.

You don't need to change "akActor" at all.

and (NormalOutfit) is what it should say? Or should it be the NAME of the outfit the NPC uses? Like (aKoiWoodcutterOutfit)?
User avatar
Kira! :)))
 
Posts: 3496
Joined: Fri Mar 02, 2007 1:07 pm

Post » Tue Nov 20, 2012 5:05 am

It's a property. Call it whatever the hell you want, but fill it with the outfit you have him wearing normally, which I guess would be the woodcutter outfit.

Take a look at Ettiene Rarnis' AI packages for help.
User avatar
Alycia Leann grace
 
Posts: 3539
Joined: Tue Jun 26, 2007 10:07 pm

Post » Tue Nov 20, 2012 6:33 am

It's a property. Call it whatever the hell you want, but fill it with the outfit you have him wearing normally, which I guess would be the woodcutter outfit.

Take a look at Ettiene Rarnis' AI packages for help.

Okay, I typed in what you said to, under the Begin/End/Change tab for the package. When I hit OK it told me it failed to compile. Should I be concerned about this?

Starting 1 compile threads for 1 files...
Compiling "PF_aKoiBathePackage1_03068C1C"...
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PF_aKoiBathePackage1_03068C1C.psc(8,18): variable aKoiWoodcutterOutfit is undefined
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PF_aKoiBathePackage1_03068C1C.psc(16,18): variable aKoiBathingOutfit is undefined
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\PF_aKoiBathePackage1_03068C1C.psc(24,18): variable aKoiWoodcutterOutfit is undefined
No output generated for PF_aKoiBathePackage1_03068C1C, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on PF_aKoiBathePackage1_03068C1C
User avatar
Emily Graham
 
Posts: 3447
Joined: Sat Jul 22, 2006 11:34 am

Post » Tue Nov 20, 2012 1:26 pm

You need to define an outfit property.
User avatar
Amy Gibson
 
Posts: 3540
Joined: Wed Oct 04, 2006 2:11 pm

Post » Tue Nov 20, 2012 5:00 pm

You need to define an outfit property.

Okay I know NOTHING about scripting. Define it where and how? In the script that attaches to the Begin/End/Change tab?
User avatar
Heather Dawson
 
Posts: 3348
Joined: Sun Oct 15, 2006 4:14 pm

Post » Tue Nov 20, 2012 10:37 am

The "properties" button, then "add property," make it an outfit property, call it whatever you want, and fill it with the woodman's outfit.
User avatar
Kerri Lee
 
Posts: 3404
Joined: Sun Feb 25, 2007 9:37 pm

Post » Tue Nov 20, 2012 12:09 pm

The "properties" button, then "add property," make it an outfit property, call it whatever you want, and fill it with the woodman's outfit.

Okay when I typed in the akActor stuff it created a script automatically in the "Attached Scripts" section at the bottom of the tab. But when I click on "Properties" for that script it gives me "Errors encountered while attempting to reload the script" and then when the window for the script does open all the buttons are greyed out
User avatar
Rachel Briere
 
Posts: 3438
Joined: Thu Dec 28, 2006 9:09 am

Post » Tue Nov 20, 2012 4:48 am

Delete your script and replace it with a junk script with no properties, like "akActor.Kill()". Compile that, and then you can delete it, add properties, and then write your original coding back in.
User avatar
Mario Alcantar
 
Posts: 3416
Joined: Sat Aug 18, 2007 8:26 am

Post » Tue Nov 20, 2012 10:26 am

Delete your script and replace it with a junk script with no properties, like "akActor.Kill()". Compile that, and then you can delete it, add properties, and then write your original coding back in.

OKAY I FINALLY got the properties window open. Now, I did everything you said to do, and the NPC still doesn't take his Woodcutter outfit off when the package that tells him to go sit in the hotsprings kicks in.

Here's what the script says:

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 6Scriptname PF_aKoiBathePackage1_03068C1C Extends Package Hidden;BEGIN FRAGMENT Fragment_5Function Fragment_5(Actor akActor);BEGIN CODEakActor.SetOutfit(aKoiWoodcutterOutfit);END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_4Function Fragment_4(Actor akActor);BEGIN CODEakActor.SetOutfit(aKoiWoodcutterOutfit);END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_3Function Fragment_3(Actor akActor);BEGIN CODEakActor.SetOutfit(aKoiBathingOutfit);END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin commentOutfit Property aKoiBathingOutfit  Auto Outfit Property aKoiWoodcutterOutfit  Auto 
User avatar
Brandon Bernardi
 
Posts: 3481
Joined: Tue Sep 25, 2007 9:06 am

Post » Tue Nov 20, 2012 2:22 pm

1. Are the properties filled?

2. Is the coding to set the bathing outfit on the begin section and not the end or change section?
User avatar
Stace
 
Posts: 3455
Joined: Sun Jun 18, 2006 2:52 pm

Post » Tue Nov 20, 2012 6:20 am

1. Are the properties filled?

2. Is the coding to set the bathing outfit on the begin section and not the end or change section?

Yes the properties both say Outfit aKoiWoodcutterOutfit and aKoiBathingOutfit

Yes, the coding for the bathing outfit is in the begin section. The end and change are woodcutter

I DID just see something though. He started walking over to the hotsprings, and then when I waited an hour to get him there faster, suddenly he was wearing his woodcutter outfit. I'm going to do a little more testing because now he just stops in the middle (or beginning) of his trek to the springs and just...stands there
User avatar
Kanaoka
 
Posts: 3416
Joined: Fri Jun 16, 2006 2:24 pm

Post » Tue Nov 20, 2012 6:08 pm

But are they filled (i.e. pointing to your new outfits)?
User avatar
Ellie English
 
Posts: 3457
Joined: Tue Jul 11, 2006 4:47 pm

Post » Tue Nov 20, 2012 3:46 am

But are they filled (i.e. pointing to your new outfits)?

Yes, they are

aKoiBathingOutfit is set to aKoiBathingOutfit

aKoiWoodcutterOutfit is set to aKoiWoodcutterOutfit


ADDENDUM!:

OKAY! It worked...sort of.

First off, the script is attached to the bathe package, not the work package. Is this right?

Second off. What happens is he walks to the hot springs, sits down on the marker, and immediately puts his work clothes on. (He doesn't have an outfit on right this moment, I will give him one and see if it changes things).

Thirdly! Here's the biggie...right now, after he sits down, when it hits 8:00 and he should return to work he stands up but...just stands there. I'll see if I can figure this out
User avatar
Kelly Upshall
 
Posts: 3475
Joined: Sat Oct 28, 2006 6:26 pm

Post » Tue Nov 20, 2012 8:20 am

1. Yes.

2. Give him a defined outfit, see what happens.

What type of package is it?

3. Yes, try to figure it out.
User avatar
N Only WhiTe girl
 
Posts: 3353
Joined: Mon Oct 30, 2006 2:30 pm

Next

Return to V - Skyrim