Jump to content

Need help with Pantyhose for UNP


pushto

Recommended Posts

Hello,

 

I'd like to use apply this great mod (stand-alone) on NPCs:

 

FAhzb9g.gif

 

 

 

 

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 ReferenceAlias

PantyhoseQuestScript property questScript auto

Event OnPlayerLoadGame()
questScript.CheckOverlay(Game.getPlayer())
EndEvent

; if panty, apply texture
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
Armor panty = akBaseObject as Armor
If panty && questScript.IsPantyhose(panty)
questScript.AddOverlay(Game.GetPlayer(), panty)
EndIf
EndEvent

; if panty, remove texture
Event OnObjectUnEquipped(Form akBaseObject, ObjectReference akReference)
Armor panty = akBaseObject as Armor
If panty && questScript.IsPantyhose(panty)
questScript.RemoveOverlay(Game.GetPlayer())
EndIf
EndEvent

 

 

 

 

Scriptname PantyhoseQuestScript extends Quest

; normal pantyhose. glossines 30
Armor[] property items auto
TextureSet[] property textures auto

; chainmail pantyhose. glossines 80
Armor[] property itemsChain auto
TextureSet[] property texturesChain auto

; called on game load from the Alias script
; applies or removes the texture on player based on the equipped armor
Function CheckOverlay(Actor a)
Armor item = a.GetWornForm(Armor.GetMaskForSlot(54)) as Armor

If 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 overlay
RemoveOverlay(a)
EndIf
EndFunction

bool Function IsPantyhose(Form f)
Return f.HasKeywordString("UNPPantyhoseKW") ; all panties have a keyword to identify them
EndFunction

Function AddOverlay(Actor a, Armor panty)

; get texture set for the equipped item
float glossiness = 30.0
TextureSet texture = GetTextureSet(panty, false)
if !texture
; check for chainmail texture
texture = GetTextureSet(panty, true)
if texture
glossiness = 80.0
else
return
EndIf
EndIf

; apply textures and glossiness to body and feet
AddNodeOverride(a, "Body [Ovl5]", texture, glossiness)
AddNodeOverride(a, "Feet [Ovl2]", texture, glossiness)

EndFunction

Function 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)
EndIf
EndFunction

bool 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 texture
return StringUtil.find(texture, "UNPP") != -1
EndFunction

; Sets the default texture and glossines to 30
Function RemoveOverlay(Actor a)
TextureSet ts = Game.GetFormFromFile(0xb477, "UNPPantyhose.esp") as TextureSet
if !ts
return
EndIf
AddNodeOverride(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 armor
TextureSet Function GetTextureSet(Armor equippedItem, bool isChain)

Armor[] itemsArray
TextureSet[] texturesArray
If isChain
itemsArray = itemsChain
texturesArray = texturesChain
Else
itemsArray = items
texturesArray = textures
EndIf

int itemsCount = itemsArray.length
int i = 0

while (i < itemsCount)
if itemsArray == equippedItem
return texturesArray
EndIf
i += 1
EndWhile

return None
EndFunction

 

Link to comment

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.

Link to comment

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.

Link to comment

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

Link to comment

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?

Link to comment
  • 3 weeks later...

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.

Link to comment

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. 

 

 

 

 

 

 

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