pushto Posted October 20, 2014 Posted October 20, 2014 Hello, I'd like to use apply this great mod (stand-alone) on NPCs: http://www.loverslab.com/topic/10341-conversions-for-unpb-with-bbp/MEGA: Pantyhose - UNP By default, the mod is only applicable on the player character. My wildest guess: If the script can somehow be modified in such way that the target actor becomes the nearest NPC within a designated radius from the PC, I think NPCs should be able to use the outfit as well. (the outfit must be re-equipped whenever the game is loaded??) I opened up the script source, but I don't even know where to begin LOL Scriptname PantyhoseAlias extends ReferenceAliasPantyhoseQuestScript property questScript autoEvent OnPlayerLoadGame()questScript.CheckOverlay(Game.getPlayer())EndEvent; if panty, apply textureEvent OnObjectEquipped(Form akBaseObject, ObjectReference akReference)Armor panty = akBaseObject as ArmorIf panty && questScript.IsPantyhose(panty)questScript.AddOverlay(Game.GetPlayer(), panty)EndIfEndEvent; if panty, remove textureEvent OnObjectUnEquipped(Form akBaseObject, ObjectReference akReference)Armor panty = akBaseObject as ArmorIf panty && questScript.IsPantyhose(panty)questScript.RemoveOverlay(Game.GetPlayer())EndIfEndEvent Scriptname PantyhoseQuestScript extends Quest; normal pantyhose. glossines 30Armor[] property items autoTextureSet[] property textures auto; chainmail pantyhose. glossines 80Armor[] property itemsChain autoTextureSet[] property texturesChain auto; called on game load from the Alias script; applies or removes the texture on player based on the equipped armorFunction CheckOverlay(Actor a)Armor item = a.GetWornForm(Armor.GetMaskForSlot(54)) as ArmorIf item && IsPantyhose(item); A panty is equipped so we reapply the texture. it happens after game start (not save lod)AddOverlay(a, item)elseIf HasPantyOverlay(a); An overlay is set without panty being equipped. Remove the overlay; It happens when loading a save after setting a overlayRemoveOverlay(a)EndIfEndFunctionbool Function IsPantyhose(Form f)Return f.HasKeywordString("UNPPantyhoseKW") ; all panties have a keyword to identify themEndFunctionFunction AddOverlay(Actor a, Armor panty); get texture set for the equipped itemfloat glossiness = 30.0TextureSet texture = GetTextureSet(panty, false)if !texture; check for chainmail texturetexture = GetTextureSet(panty, true)if textureglossiness = 80.0elsereturnEndIfEndIf; apply textures and glossiness to body and feetAddNodeOverride(a, "Body [Ovl5]", texture, glossiness)AddNodeOverride(a, "Feet [Ovl2]", texture, glossiness)EndFunctionFunction AddNodeOverride(Actor a, string node, TextureSet texture, float glossiness)If NetImmerse.HasNode(a, node, false)NiOverride.AddNodeOverrideTextureSet(a, true, node, 6, -1, texture, false)NiOverride.AddNodeOverrideFloat(a, true, node, 2, -1, glossiness, false)EndIfEndFunctionbool Function HasPantyOverlay(Actor a)string texture = NiOverride.GetNodePropertyString(a, false, "Body [Ovl5]", 9, 0); All pantyhose texture files are named UNPP_etc. All but the default texturereturn StringUtil.find(texture, "UNPP") != -1EndFunction; Sets the default texture and glossines to 30Function RemoveOverlay(Actor a)TextureSet ts = Game.GetFormFromFile(0xb477, "UNPPantyhose.esp") as TextureSetif !tsreturnEndIfAddNodeOverride(a, "Body [Ovl5]", ts, 30.0)AddNodeOverride(a, "Feet [Ovl2]", ts, 30.0)EndFunction; looks for the equiped item in the armor arrays; returns the texture in the textures array in the same position as the armorTextureSet Function GetTextureSet(Armor equippedItem, bool isChain)Armor[] itemsArrayTextureSet[] texturesArrayIf isChainitemsArray = itemsChaintexturesArray = texturesChainElseitemsArray = itemstexturesArray = texturesEndIfint itemsCount = itemsArray.lengthint i = 0while (i < itemsCount)if itemsArray == equippedItemreturn texturesArrayEndIfi += 1EndWhilereturn NoneEndFunction
myuhinny Posted October 21, 2014 Posted October 21, 2014 I think you would just have to open the .esp the CK (creation kit) and change it to everyone. Not sure though I haven't really used the CK as much as I have the CS so you would have to look through what is in the .esp and see if there is a restriction set for player only and change it. One thing though it looks like the panty hose have BBP/TBBP from looking at the screen thing so if they do you will have to make sure to have a BBP/TBBP skeleton for the rest of them to use otherwise they will cause your game to CTD when you get close to them while they are wearing it.
pushto Posted October 21, 2014 Author Posted October 21, 2014 I think you would just have to open the .esp the CK (creation kit) and change it to everyone. Not sure though I haven't really used the CK as much as I have the CS so you would have to look through what is in the .esp and see if there is a restriction set for player only and change it. One thing though it looks like the panty hose have BBP/TBBP from looking at the screen thing so if they do you will have to make sure to have a BBP/TBBP skeleton for the rest of them to use otherwise they will cause your game to CTD when you get close to them while they are wearing it. Nope, it has nothing to do with the body mesh and its associated skeleton... I opened the esp file and all the settings are darn solid, thnx to b3lisario. The mod applies a custom shader to the surface of the body with the help of SKSE. The target actor has to be modified.
b3lisario Posted October 22, 2014 Posted October 22, 2014 It's possible to apply the overlays to the NPCs, but this mod doesn't do that. I think the main problem is that the overlays are not automatically saved and must be reapplied on each game load, if there is a way to avoid this I didn't find it back then. So you need to keep a list of the NPCs and their selected textures. Not terribly difficult. There is also an extra NiOverride thing needed for NPCs, like NiOverride.addOverlays(actor) or so
pushto Posted October 22, 2014 Author Posted October 22, 2014 It's possible to apply the overlays to the NPCs, but this mod doesn't do that. I think the main problem is that the overlays are not automatically saved and must be reapplied on each game load, if there is a way to avoid this I didn't find it back then. So you need to keep a list of the NPCs and their selected textures. Not terribly difficult. There is also an extra NiOverride thing needed for NPCs, like NiOverride.addOverlays(actor) or so Hey b3lisario! Thnx for taking notice of my inquiry. Yes, as I've originally predicted, the effect has to be reapplied(re-equipped) on each game load.. I think such amount of hassle is endurable though. I love the idea of not having to deal with any body meshes. It's a brilliant modding technique. But to be honest, I don't even know where to begin since my knowledge on script modification is virtually non-existent. Will you be able to create the NPC-only version as well?
azmodan22 Posted November 10, 2014 Posted November 10, 2014 Well, since this is actually a texture you can edit the body textures of your body and add it. Unfortunately this way ALL NPCs will wear it. If you know who to make the above mentioned script, perhaps using a follower management mod like AFT that manages the NPC isnentory and outfit will help find out how to apply to specific NPCs. I have no idea of scripting but I hope I gave you a few ideas.
ZMods Posted November 10, 2014 Posted November 10, 2014 I believe Slavetats has this texture (or a similar one) as a "tattoo" that can be applied to yourself or another person. I would suggest looking at the Slavetats mod (and its associated tat-pack, B3lisario-stockings I think), see if its the one you want and using that to apply it to other characters. Thats my suggestion.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.