procyonlotor Posted October 28, 2023 Posted October 28, 2023 I'm editing a mod which changes the size of body parts using the function XPMSELib.SetNodeScale . This uses NiOverride.AddNodeTransformScale to alter the size on the NPC, and it is working fine at first. However when I leave and come back to areas the NPC will show the previous size for a moment, and then refresh back to how they started. Can anyone enlighten me about why this may be happening? I don't have the depth of knowledge regarding how co-saves work, how to get the changes to persist, or if there can be competing versions of co-saves such as something in SoS which overwrites any changes made by my homebrew mod. Any insights or guesses of what I should look into appreciated! Relevant parts of the code of these two mods included below for reference: ; Function called in XPMSELib Function SetNodeScale(Actor akActor, bool isFemale, string nodeName, float value, string modkey) global If value != 1.0 NiOverride.AddNodeTransformScale(akActor, false, isFemale, nodeName, modkey, value) NiOverride.AddNodeTransformScale(akActor, true, isFemale, nodeName, modkey, value) [...] ;Funciton called in NiOverride by XPMSELib ; Adds a scale override for the particular key, pos[0-2] correspond to x,y,z Function AddNodeTransformScale(ObjectReference akRef, bool firstPerson, bool isFemale, string nodeName, string key, float scale) native global
traison Posted October 28, 2023 Posted October 28, 2023 (edited) If by "a moment" you mean long enough for you to enter a cell, walk up to the NPC then mid-conversation their tits vanish (or something along these lines) then its quite obviously another mod changing/resetting node scales. First suspects would be mods like SLIF and SOS. Use something like Notepad++ to search through all pex (not psc) files in all mods for all node scale altering functions you think may be involved. Use NiOverride as a reference, not XPMSE. This will give you a list of mods that may be doing it. If you're capable of compiling XPMSE, you can also consider adding a callstack dump to the SetNodeScale function, however keep in mind that that would only catch other scripts that specifically use XPMSE to scale nodes. This same idea can be applied to any other non-native functions that you may find abstracting the NiOverride functions. If you can recompile NiOverride, you can also alter the names of the native functions and add papyrus proxy functions in their place to allow for the papyrus callstack to be dumped before the native NiOverride function is called. This may be a bit overkill however. Edit: The silly native function name hack idea may even be possible with a hex editor without recompiling the dll, just make sure the modified name is the same length, i.e. AddNodeTransformScale -> AddNodeTransformScal2 Edited October 28, 2023 by traison 1
Yinkle Posted October 28, 2023 Posted October 28, 2023 From Nioverride: ; Adds a scale override for the particular key, pos[0-2] correspond to x,y,z Function AddNodeTransformScale(ObjectReference akRef, bool firstPerson, bool isFemale, string nodeName, string key, float scale) native global The "string key" parameter should make changes persistant if set as something unique. It sounds like another mod in your LO is being naughty and clearing all transforms. 2
traison Posted October 28, 2023 Posted October 28, 2023 @Yinkle Good point about the key, this issue could be caused by XPMSE itself. I don't think its a good idea to use XPMSE's functions to alter node sizes when NiOverride provides easy access directly to the native functions. It could be XPMSE keeps an internal list of its own node scales, and when @procyonlotor uses the same function to set some other value (with XPMSE's mod key) its only a matter of time before XPMSE pushes another "update" and the custom value is lost. The mod key given to AddNodeTransformScale needs to be unique. 1
procyonlotor Posted October 29, 2023 Author Posted October 29, 2023 Thanks for the insights @traison and @yinkle . I converted all the commands to directly interface with NiOverride, and I also dug into the SoS mod which had been pushing some sort of maintenance updates to NiOverride which I disabled. This seems to have solved many problems with customizations disappearing. This has helped a lot.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now