Chosen Clue Posted August 18, 2017 Posted August 18, 2017 So I was making a personal mod, and I wanted to detect if an actor was naked. I remembered that SexLab Aroused had a similar function, so I looked at its scripts to find that it checked for specific keywords (cuirass and clothing were the ones that SLA checked for). However, after checking the creation kit to see what keywords armors used, I've found that in FO4, the usage was very bare bones, only covering tags that typically help with the armor workbench modding system that improves armors, or other functionalities like preventing the Dogmeat retrieval from showing a model in Dogmeat's mouth as he brings items to you. And with the inability via Papyrus to check if an item in a biped slot is a Skin for a race, or just an equip-able armor, I've found no way to actually have a script be able to tell the difference between an actor being naked and being equipped with an armor. Except, I noticed that Skin armors typically don't have a form name. So code that could try to guess if an actor is naked could look like: akRef.GetWornItem(3).Item.GetName() == "" This code gets the worn item for biped slot 33, and then checks if the name of the armor baseobject is nothing, returning true if it is. All Skin armors would pass true, while other armors that have names will fail. This isn't completely air tight, as some modders who may add an armor that is equipped on a player but has no name, and then could cause some weird issues. Has anybody else tried to find a different solution to this?
Andy14 Posted August 18, 2017 Posted August 18, 2017 Not check whether actor has an armor - check whether armor is the nacked body. Each race has a nacked body. Check with theActor.IsEuipped (your nackedBodyForm). If true - is naked (according to the logic of the game).
Chosen Clue Posted August 18, 2017 Author Posted August 18, 2017 Not check whether actor has an armor - check whether armor is the nacked body. Each race has a nacked body. Check with theActor.IsEuipped (your nackedBodyForm). If true - is naked (according to the logic of the game). This idea makes sense, but the problem with it is that you'd need to have script properties that have all the skin forms for each race you'd want to check, and properties for the races associated with those skin forms, thus limiting yourself to a few select races. This method would probably be not optimal performance wise either, as you'd have to look for the right skin form to check for depending on the actor's race, thus taking time in the VM to look for a race out of an array of races stored. And unfortunately this method isn't compatible with custom race mods that add in custom skin forms for their race, unless if you'd want to make a patch for each custom race out there.
Andy14 Posted August 18, 2017 Posted August 18, 2017 Not check whether actor has an armor - check whether armor is the nacked body. Each race has a nacked body. Check with theActor.IsEuipped (your nackedBodyForm). If true - is naked (according to the logic of the game). This idea makes sense, but the problem with it is that you'd need to have script properties that have all the skin forms for each race you'd want to check, and properties for the races associated with those skin forms, thus limiting yourself to a few select races. This method would probably be not optimal performance wise either, as you'd have to look for the right skin form to check for depending on the actor's race, thus taking time in the VM to look for a race out of an array of races stored. And unfortunately this method isn't compatible with custom race mods that add in custom skin forms for their race, unless if you'd want to make a patch for each custom race out there. User-specific races are an argument - there are already hundreds of them. That was a joke - or not How to keep these forms in a script? As always - as property. Each script has properties - or can. Add Properperty, select Type Armor, and then pick the Armor Form - done. If is not more as 128 races, it's better you make a array from this. But with 500 races ... i don't know... Then in the script a loop and check IsEquipped. A function for this with Bool return would be a good idea. Call with Actor as ObjectReference - Return is False or True. Actually quite simple - theoretically. Note: Skyrim is already older and real "own" races can be counted with 10 fingers.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.