Jump to content

Way To Trigger NPC Unclothing In An Area


TheGreenLion

Recommended Posts

I've got a shallow bathing area in my player house with some benches that I plan on having NPCs visit periodically to chill for a few hours. What I was wondering is if there is a way to make them remove any clothing/armor/weapons that they are wearing when they enter this particular area only, and then re-equip what was removed when they leave. It just would seem odd if they decided to take a bath fully clothed. If anyone has a solution for that I'd greatly appreciate some help! :biggrin:
Link to comment
Share on other sites

There are several script elements you could experiment with, perhaps UnequipAll() or RemoveAllItems (which allows you to transfer everything to a container)

 

http://www.creationkit.com/RemoveAllItems_-_ObjectReference

http://www.creationkit.com/UnequipAll_-_Actor

 

But yeah, some scripting will be involved, like placing a triggerbox covering the bathing area with a script containing an ontriggerenter() event.

 

http://www.creationkit.com/OnTriggerEnter_-_ObjectReference

Link to comment
Share on other sites

Thanks for the advice Acid, scripting confuses the daylights out of me so I'll give it a go but I have limited expectations. I guess I'm just anxious to get through that part of it, perhaps anyone with some superior scripting knowledge might be able to help me? It also seems that I can't see my trigger boxes...that's bothersome. :wacko:
Link to comment
Share on other sites

If you can't see ANY markers (idle markers, sit markers, use markers), press M with the render window visible.

 

If you're trying to draw a triggerbox, first select the objects you want to draw the trigger around (like a couple of floor, wall, and other pieces) using the ctrl+left click to select multiple objects, then press the little T/box button from the top menu (looks like a box... with a T in it ;), then select the defaultblanktrigger from the options.

 

It will create a nice box with an area guaranteed to cover the objects you selected. If you try to drag one into your scene (which is a mistake many people make when first working with triggers), it will have dimensions 0,0,0 so that's why you don't see it.

Link to comment
Share on other sites

Here, this will make anyone entering the box go starkers.

 

Scriptname nudityscript extends ObjectReference	

Event OnTriggerEnter (objectreference triggerRef )
(triggerRef as actor).UnequipAll()
EndEvent

 

But they will likely never reequip their armor (although they will equip and draw a weapon if attacked). There should be a way to cycle through all their armor slots, put the data in a temporary array, and then call equipitem() for each removed item on a second eventblock OnTriggerLeave but I don't see a quick 'n easy way to do that.

Link to comment
Share on other sites

Hmmm, if they had a default outfit they would eventually revert to wearing it I assume. I imagine the character would have to leave the area though. I kind of had the idea from some hunters out in the hot springs by Eldergleam, but they didn't have an inventory or outfits to start with.
Link to comment
Share on other sites

Hmm tried to make a new script and it gave me this:

 

Starting 1 compile threads for 1 files...

Compiling "AATGLBathScript"...

<unknown>(0,0): Unable to find flags file: TESV_Papyrus_Flags.flg

c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\ObjectReference.psc(1,0): Unknown user flag Hidden

No output generated for AATGLBathScript, compilation failed.

 

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on AATGLBathScript

 

 

Guess I'll have to see about it tomorrow sometime. Bleh, lol.

Link to comment
Share on other sites

might be able to use OnTriggerLeave() and utilize this

http://www.creationkit.com/Reset_-_ObjectReference

and reset the actor to a specific marker set just on the outside of the trigger box...

 

hopefully the player doesn't see that happen & hopefully their AI doesn't make 'em turn around and do it all over again...

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...