Thanks for providing these script examples, I am not a scripter but I have managed to minorly edit existing ones in the past for different things.
I would like to ask if there is a way for undressing so instead everything is unequipped from player/npc , hair wigs, body smp physics remain equipped, they use body slots so is there a command or an easy way that would add exceptions from unequipall() , so hair wigs, smp body thingy, jewlery or whatever piece of clothing remains on NPC when srcipt undresses actors.
If its possible could you please provide and example what would I have to add or replace in a script so it would work when it activates?
This is possible as it is what I do with my own patches here: https://www.nexusmods.com/skyrimspecialedition/mods/30265 however those patches require the use of an MCM menu to specify what slots not to change. You are welcome to use those scripts as you wish, you can if you want install the mod to get the main support esp and script files and you can make your own patch:)
Is it possible to attach the script to furniture/idle markers so undressing occurs whenever that is used by an NPC? I was hoping to place multiple markers around the world and thought it would save time to not set up trigger areas for each one and instead have the script on the base object.
Do you mean such that an NPC undresses when activating an object and then redresses when/if activating again - shouldn't be too hard; or undresses _while_ using something and then redresses when they stop? - trickier.
Thanks for your reply! Ah okay, the second option was what I meant unfortunately - for example they undress when sitting on a chair and then redress when they stand back up. I just noticed that furniture forms had an option to attach scripts in the CK, but maybe they don't work how I'm imagining Don't worry if it's too complex though
Would it be possible to add an exclusion for specified NPCs? making a home with a bathing area but don't want the attendant to be affected when moving around.
I'm thinking the simplest way to do this would be to check for a keyword before running the script: If !keyword_attendant then do stuff EndIf
I could make the keyword part of the included esp, that would beome a master for your mod, or you could add the line yourself and add the keyword to your esp and make it as a property to the script: e.g. Event OnTriggerEnter(ObjectReference triggerRef) If (triggerRef as Actor) ;is the trigger an actor? Else Return;if not exit the function EndIf ;----------becomes: Event OnTriggerEnter(ObjectReference triggerRef) If (triggerRef as Actor) && !triggerRef.HasKeyword(Keyword_Attendant) ;is the trigger an actor? is it not an attendant? Else Return;if not exit the function EndIf ;----------Then add the following to the script: Keyword Property Keyword_Attendant AutoSet that in the CK and anything with that keyword will cause the script to return before doing any undressing.
just wanted to say i've been using some of these in oldrim without pap extender. just ole skse. been working fine. i added them to some of the old northern bathhouses thank u!
Bunch of errors are from PO3 extender even though i have its requirement (po3 tweak and address library for sse)
Spoiler:
Show
Starting 1 compile threads for 1 files... Compiling "StripTest"... D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(26,6): variable SKSE is undefined D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(26,11): none is not a known user-defined type D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(26,24): cannot compare a none to a int (cast missing or types unrelated) D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(26,24): cannot relatively compare variables to None D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(225,22): GetCameraState is not a function or does not exist D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(225,22): cannot call the member function GetCameraState alone or on a type, must call it on a variable D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(225,2): type mismatch while assigning to a int (cast missing or types unrelated) D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(55,20): unknown type colorform D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(71,20): unknown type colorform D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(111,58): unknown type colorform D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(120,56): unknown type colorform D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(144,48): unknown type colorform D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(156,48): unknown type colorform D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(198,48): unknown type armoraddon D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(200,36): unknown type armoraddon D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(495,26): unknown type sounddescriptor D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(527,58): unknown type sounddescriptor D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(541,20): unknown type colorform D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(559,49): unknown type colorform D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(607,26): unknown type sounddescriptor D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(615,73): unknown type sounddescriptor D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(647,16): unknown type art[] D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(675,54): unknown type art D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(731,51): unknown type art D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(735,60): unknown type art D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(828,60): unknown type sounddescriptor D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(893,14): unknown type art D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(901,50): unknown type art D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(251,12): EquipItemEx is not a function or does not exist D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(252,12): EquipItemEx is not a function or does not exist D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(259,14): EquipItemEx is not a function or does not exist No output generated for StripTest, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on StripTest
OK i managed to compiled it. Turn out i forgot to move SKSE source from data/script/source to data/source/script. Always forget that everytime i reinstall skyrim, sorry for the trouble
Thankyou very much for this Dizlet. Been using it for sometime in several homes but have come across a big issue. NPCs that are not followers do not re-equip their gear. I am hoping to hear back what your thoughts are on this as I am trying to figure out a way to refactor the code so it does work on Non-follower NPCs.
The scripts only differentiate between player (==Game.Getplayer()) and not player (!=Game.GetPlayer()) with Game.GetPlayer() often replaced with the property PlayeRef. There is no attempt to determine follower status; do you have a particular house I can look at to see what happens?
What you get are the scripts and pre-made activators (in the esp) that can be used in your own mod. On their own they do nothing, they are to help those who make mods:)
diziet
edit: source for the scripts all installed in data>scripts>source, also included are some meshes used for invisible chairs.
21 comments
Thanks for providing these script examples, I am not a scripter but I have managed to minorly edit existing ones in the past for different things.
I would like to ask if there is a way for undressing so instead everything is unequipped from player/npc , hair wigs, body smp physics remain equipped, they use body slots so is there a command or an easy way that would add exceptions from unequipall() , so hair wigs, smp body thingy, jewlery or whatever piece of clothing remains on NPC when srcipt undresses actors.
If its possible could you please provide and example what would I have to add or replace in a script so it would work when it activates?
https://www.nexusmods.com/skyrimspecialedition/mods/30265
however those patches require the use of an MCM menu to specify what slots not to change. You are welcome to use those scripts as you wish, you can if you want install the mod to get the main support esp and script files and you can make your own patch:)
diziet
edit: solved, removed the redress function for a custom effect.
Thanks so much for this resource!
diziet
Ah okay, the second option was what I meant unfortunately - for example they undress when sitting on a chair and then redress when they stand back up. I just noticed that furniture forms had an option to attach scripts in the CK, but maybe they don't work how I'm imagining
Don't worry if it's too complex though
If !keyword_attendant
then do stuff
EndIf
I could make the keyword part of the included esp, that would beome a master for your mod, or you could add the line yourself and add the keyword to your esp and make it as a property to the script:
e.g.
Event OnTriggerEnter(ObjectReference triggerRef)
becomes:If (triggerRef as Actor) ;is the trigger an actor?
Else
Return;if not exit the function
EndIf
;----------
Event OnTriggerEnter(ObjectReference triggerRef)
Then add the following to the script:If (triggerRef as Actor) && !triggerRef.HasKeyword(Keyword_Attendant) ;is the trigger an actor? is it not an attendant?
Else
Return;if not exit the function
EndIf
;----------
Keyword Property Keyword_Attendant Auto
Set that in the CK and anything with that keyword will cause the script to return before doing any undressing.diziet
thank u!
Also when i tried copy and paste diz_player_and_NPC_undress_script source and compiled in ck, it returned a bunch of error, is that normal?
I already have papyrus extender and all of its requirement
diziet
Compiling "StripTest"...
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(26,6): variable SKSE is undefined
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(26,11): none is not a known user-defined type
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(26,24): cannot compare a none to a int (cast missing or types unrelated)
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(26,24): cannot relatively compare variables to None
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(225,22): GetCameraState is not a function or does not exist
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(225,22): cannot call the member function GetCameraState alone or on a type, must call it on a variable
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(225,2): type mismatch while assigning to a int (cast missing or types unrelated)
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(55,20): unknown type colorform
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(71,20): unknown type colorform
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(111,58): unknown type colorform
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(120,56): unknown type colorform
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(144,48): unknown type colorform
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(156,48): unknown type colorform
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(198,48): unknown type armoraddon
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(200,36): unknown type armoraddon
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(495,26): unknown type sounddescriptor
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(527,58): unknown type sounddescriptor
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(541,20): unknown type colorform
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(559,49): unknown type colorform
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(607,26): unknown type sounddescriptor
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(615,73): unknown type sounddescriptor
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(647,16): unknown type art[]
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(675,54): unknown type art
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(731,51): unknown type art
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(735,60): unknown type art
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(828,60): unknown type sounddescriptor
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(893,14): unknown type art
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\PO3_SKSEFunctions.psc(901,50): unknown type art
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(251,12): EquipItemEx is not a function or does not exist
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(252,12): EquipItemEx is not a function or does not exist
D:\Games\Steam\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\StripTest.psc(259,14): EquipItemEx is not a function or does not exist
No output generated for StripTest, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on StripTest
NPCs that are not followers do not re-equip their gear.
I am hoping to hear back what your thoughts are on this as I am trying to figure out a way to refactor the code so it does work on Non-follower NPCs.
There is no attempt to determine follower status; do you have a particular house I can look at to see what happens?
diziet
diziet
edit: source for the scripts all installed in data>scripts>source, also included are some meshes used for invisible chairs.