Jump to content

(Scripting) Automatic Undressing - Redressing Apparel


Crazy6987

Recommended Posts

I've been seeing a lot of people wondering how to do this, both here and on Nexus Mods. So I thought I would post this as a reference.

 

At the moment the only mod I know of that uses this method of undressing and redressing is CWSS Redux v2 by steve40 and FLipdeezy, there is another method used in BYOP by Akarnan that is similar, but with a bit more work involved.

 

Below is my script for a piece of furniture, of course this method can be adapted and used with something else like a magic effect script. You can download my full example below, includes the .esp and script so you can see how to set everything up, or if you want to test it you will find my rug in the Resources -> Misc section of the Workshop Menu. Also in my "CrazyExampleRedressScript.psc" I left some comments that go into a little detail about what the script is actually doing.

 

 

The Script:                                                                                                    

 

 

ScriptName CrazyExampleRedressScript extends workshopobjectscript

;-- Properties --------------------------------------
Armor Property Armor_CrazyExampleNude Auto Const

;-- Variables ---------------------------------------
Actor target
Form[] EquippedArmor

;-- Functions ---------------------------------------

Event OnActivate(ObjectReference akActionRef)
    target = (akActionRef as Actor)
    int I = 0
    If (target.IsInPowerArmor() == False || target.IsinCombat() == False)
        RegisterForRemoteEvent(target, "OnItemUnequipped")
        EquippedArmor = new Form[0]
        If (target != Game.GetPlayer())
            target.EquipItem(Armor_CrazyExampleNude as Form, True, True)
            Utility.Wait(0.1)
            target.UnequipItem(Armor_CrazyExampleNude as Form, False, True)
        Else
            While (I <= 29)
                target.UnequipItemSlot(I)
                I += 1
            EndWhile
            Game.ForceThirdPerson()
        EndIf
        Utility.Wait(0.1)
        UnregisterForRemoteEvent(target, "OnItemUnequipped")
    EndIf
EndEvent

Event Actor.OnItemUnequipped(Actor akSender, Form akBaseObject, ObjectReference akReference)
    If (akBaseObject != Armor_CrazyExampleNude as Form)    
        If (akReference)
            EquippedArmor.Add(akReference as Form, 1)
        Else
            EquippedArmor.Add(akBaseObject, 1)
        EndIf
    EndIf    
EndEvent

Event OnExitFurniture(ObjectReference akActionRef)
    int I = 0
    While (I < EquippedArmor.length)
        target.EquipItem(EquippedArmor[I], False, True)
        I += 1
    EndWhile
EndEvent

 

 

Crazy_Example_Undress-Redress.7z

Link to comment

I've got byop and it has certain issues, the showers work ok because of the delays caused by the animations but if you enter a pool, leave and reenter too quickly it leaves everything unequipped and can even loose the pitboy as it redetects equipped items at the reentry point i.e. when you're naked as the reequip / leave pool event hasn't fired or fires after the enter pool event.

 

 

 

Link to comment
  • 2 months later...

Hey Crazy,

 

I've been studying your scripts and Leito's for a while now, and I've got a sinking feeling in my gut.

 

Is the fact that you're using Armor_CrazyExampleNude mean that you can't actually call UnequipItemSlot on npc Actors?

 

I'm going to venture and guess you've been at this for a while, so I'm assuming the worst.

 

Any words of wisdom surrounding this topic would be appreciated.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use