zaira Posted May 16 Posted May 16 (edited) This is the workflow I actually implement: 1. Clear Slot 0 (assume its empty) SKSE::GetTaskInterface()->AddTask( { AddNodeOverride(actor, isFemale, "Body [Ovl 0]", 9, 0, "actors/character/overlays/default.dds") if (HasNodeOverride(actor, isFemale, "Body [Ovl 0]", 9, 1)) AddNodeOverride(actor, isFemale, "Body [Ovl 0]", 9, 1, "actors/character/overlays/default.dds"); if (HasNodeOverride(actor, isFemale, "Body [Ovl 0]", 9, 3)) AddNodeOverride(actor, isFemale, "Body [Ovl 0]", 9, 3, "actors/character/overlays/default.dds"); ApplyNodeOverrides(actor, true); RemoveNodeOverride(actor, isFemale, "Body [Ovl 0]", 9, 3); RemoveNodeOverride(actor, isFemale, "Body [Ovl 0]", 9, 1); RemoveNodeOverride(actor, isFemale, "Body [Ovl 0]", 9, 0); RemoveNodeOverride(actor, isFemale, "Body [Ovl 0]", 7, 255); RemoveNodeOverride(actor, isFemale, "Body [Ovl 0]", 0, 255); RemoveNodeOverride(actor, isFemale, "Body [Ovl 0]", 1, 255); RemoveNodeOverride(actor, isFemale, "Body [Ovl 0]", 8, 255); RemoveNodeOverride(actor, isFemale, "Body [Ovl 0]", 2, 255); RemoveNodeOverride(actor, isFemale, "Body [Ovl 0]", 3, 255); ApplyNodeOverrides(actor, true); 2. Set Slot 0 AddNodeOverride(actor, isFemale, "Body [Ovl 0]", 9, 0, "actors/character/mymod/mytexture.dds") ApplyNodeOverrides(actor, true); } I need to decouple from current thread because I call the function in an OnEquipped (RE::BSTEventSink<RE::TESEquipEvent>) event. This is my problem: The texture is set, and it is immediately visible on NPCs. But it is only visible on Player when I open and close RaceMenu manually. Edited May 16 by zaira
traison Posted May 16 Posted May 16 This looks like AI slop. Sets ovl 0 9 0 to default.dds. Applies changes. Removes ovl 0 9 0. Applies changes. Sets ovl 0 9 0 to mytexture.dds. Applies changes. Why not just set ovl 0 9 0 to mytexture.dds, not remove it and only apply once? Seems like it would cut down the risk of there being a race condition in ApplyNodeOverrides and probably save a whole lot of performance too (relatively speaking).
zaira Posted May 16 Author Posted May 16 56 minutes ago, traison said: This looks like AI slop. This is how SlaveTatsNG is being implemented...
traison Posted May 16 Posted May 16 (edited) 1 hour ago, zaira said: This is how SlaveTatsNG is being implemented... Not sure how that counters my AI slop argument, but that's irrelevant anyways. The point of my post was, have you tried this, and does it work for both NPCs and the player? SKSE::GetTaskInterface()->AddTask( { AddNodeOverride(actor, isFemale, "Body [Ovl 0]", 9, 0, "actors/character/overlays/mytexture.dds") ApplyNodeOverrides(actor, true); }); Edit: And to clarify further, if this works then my guess would be taht ApplyNodeOverrides has a race condition in it, despite immediate being set to true and it seemingly being synchronous. Edited May 16 by traison
zaira Posted May 16 Author Posted May 16 (edited) 5 hours ago, traison said: Not sure how that counters my AI slop argument, but that's irrelevant anyways. The point of my post was, have you tried this, and does it work for both NPCs and the player? SKSE::GetTaskInterface()->AddTask( { AddNodeOverride(actor, isFemale, "Body [Ovl 0]", 9, 0, "actors/character/overlays/mytexture.dds") ApplyNodeOverrides(actor, true); }); Edit: And to clarify further, if this works then my guess would be taht ApplyNodeOverrides has a race condition in it, despite immediate being set to true and it seemingly being synchronous. Tried the simplified version, I still need to open RaceMenu manually to get the overlays visible. Edited May 16 by zaira
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