Jump to content

[Question] Adding Nioverride overlay to script.


Recommended Posts

Posted

I finally have a working scripting setup and decided to start learning a bit about scripting.
Basically, I want it so when the player is wearing a gag with the zad_Deviousgag keyword, a drool texture appears on her face.

 

This is what I came up with so far:

Spoiler

Scriptname SH_GagDrool extends ObjectReference  

 

Actor Property PlayerRef  Auto  
Keyword Property zad_DeviousGag  Auto  

 

Event OnActivate(ObjectReference akActionRef)
    
    if PlayerRef.WornHasKeyword(zad_DeviousGag)
         Debug.MessageBox("You are gagged!")
         NiOverride.AddNodeOverrideString(PlayerRef, true, "Face [Ovl1]", 9, 1, "SH_drool.dds", false)  
    else
        Debug.MessageBox("You are not gagged!")
    endif


 endEvent

 

The problem is, ofcourse, no drool texture appears.

 

I'm sure this has to do with the fact that the script doesn't know where to look for the .dds texture file, but I have no clue on how to do this.

I typed the texture just there because I would think thats where NiOverride would look (in nioverride.ini - sDefaultTexture=textures\actors\character\overlays\default.dds).

 

Any help would greatly be appreciated.

Posted

Pretty sure the base is "Data\Textures" for the script functions.

 

So use " actors\character\overlays\SH_drool.dds", change to your path if needed.

Posted
32 minutes ago, Akzyra said:

Pretty sure the base is "Data\Textures" for the script functions.

 

So use " actors\character\overlays\SH_drool.dds", change to your path if needed.

When I replace "SH_drool.dds" with "actors\character\overlays\SH_drool.dds", I get the following bunch of errors:

Spoiler

[ SH_GagDrool.psc ]

Starting 1 compile threads for 1 files...
Compiling "SH_GagDrool"...
No output generated for D:\Program Files (x86)\Mod Organizer\overwrite\Scripts\Source\SH_GagDrool.psc, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on D:\Program Files (x86)\Mod Organizer\overwrite\Scripts\Source\SH_GagDrool.psc


--- ERRORS ---

SH_GagDrool.psc(10,82): mismatched character '\' expecting '"'
SH_GagDrool.psc(10,93): mismatched character 'o' expecting '\n'
SH_GagDrool.psc(10,102): mismatched character 's' expecting '\n'
SH_GagDrool.psc(10,125): mismatched character '\r' expecting '"'
SH_GagDrool.psc(10,83): no viable alternative at input 'character'
SH_GagDrool.psc(10,110): required (...)+ loop did not match anything at input '.'

Time: 2,2689835 seconds
Input: D:\Program Files (x86)\Mod Organizer\overwrite\Scripts\Source\SH_GagDrool.psc
Output: D:\Program Files (x86)\Mod Organizer\overwrite\Scripts\SH_GagDrool.pex

Finished with 6 errors

 

Any ideas?
It compiles fine when using "SH_drool.dds", so it's having problems with the forward slashes.

Posted
20 hours ago, _SpaceHamster_ said:

When I replace "SH_drool.dds" with "actors\character\overlays\SH_drool.dds", I get the following bunch of errors:

  Hide contents

[ SH_GagDrool.psc ]

Starting 1 compile threads for 1 files...
Compiling "SH_GagDrool"...
No output generated for D:\Program Files (x86)\Mod Organizer\overwrite\Scripts\Source\SH_GagDrool.psc, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on D:\Program Files (x86)\Mod Organizer\overwrite\Scripts\Source\SH_GagDrool.psc


--- ERRORS ---

SH_GagDrool.psc(10,82): mismatched character '\' expecting '"'
SH_GagDrool.psc(10,93): mismatched character 'o' expecting '\n'
SH_GagDrool.psc(10,102): mismatched character 's' expecting '\n'
SH_GagDrool.psc(10,125): mismatched character '\r' expecting '"'
SH_GagDrool.psc(10,83): no viable alternative at input 'character'
SH_GagDrool.psc(10,110): required (...)+ loop did not match anything at input '.'

Time: 2,2689835 seconds
Input: D:\Program Files (x86)\Mod Organizer\overwrite\Scripts\Source\SH_GagDrool.psc
Output: D:\Program Files (x86)\Mod Organizer\overwrite\Scripts\SH_GagDrool.pex

Finished with 6 errors

 

Any ideas?
It compiles fine when using "SH_drool.dds", so it's having problems with the forward slashes.

"\" is an escape character.  Change them all to "\\".

 

If the drool overlay still doesn't appear, try using PlayerRef.QueueNiNodeUpdate() to update the player's appearance.

Posted
36 minutes ago, Holzfrau said:

"\" is an escape character.  Change them all to "\\".

 

If the drool overlay still doesn't appear, try using PlayerRef.QueueNiNodeUpdate() to update the player's appearance.

Ah yeah, I tried that yesterday and it compiled fine, but still didn't work in game unfortunately.
After a hassle today, some people help me out and I managed to what I want to work using SlaveTats.


However, I would be open to still using NiOverride, since that is faster.

 

I tried using PlayerRef.QueueNiNodeUpdate(), but still doesn't work.
 

Here's my script. The texture path is correct.

Spoiler

Scriptname SH_GagDroolQuestScript extends ReferenceAlias  

Actor Property PlayerRef  Auto  
Keyword Property zad_DeviousGag  Auto  

Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)
    if akBaseObject.HasKeyword(zad_DeviousGag)
        Debug.MessageBox("Item with keyword equipped!")
        NiOverride.AddNodeOverrideString(PlayerRef, true, "Face [Ovl1]", 9, 1, "actors\\character\\SlaveTats\\SH_tats\\drool3.dds", false)  
        PlayerRef.QueueNiNodeUpdate()
    else
        Debug.MessageBox("Do nothing, equipped.")
    endIf
endEvent

Event OnObjectUnEquipped(Form akBaseObject, ObjectReference akReference)
    if akBaseObject.HasKeyword(zad_DeviousGag)
        Debug.MessageBox("Item with keyword UNequipped!")
    else
        Debug.MessageBox("Do nothing, unequipped.")
    endIf
endEvent
 

 

  • 1 year later...

Archived

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

  • Recently Browsing   0 members

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