Please read the mod description carefully before posting. I know it's a wall of text, but this is a modder resource, not a polished mod and there's a lot of technical stuff.
I've also commented my source files fairly extensively, so you should be able to step through what I did there.
Again, the Fix Neck Seam spell very probably WILL NOT WORK on NPCs whose weight slider wasn't altered solely by the spells in this mod. There may be a better way to grab the NPC's original weight and store it than what I've done; if so, I'd be interested in hearing about it. There should be a way to do an auto-update of the neck seams when the game is loaded, etc., too, but I don't have enough experience with those parts of the game engine to know when or how to do that efficiently.
In any event, I hope these are useful to you, even if only for learning purposes. I learned a lot putting them together.
Cheers! - jknjb
EDIT: 29 September 2019
Version 1.1 adds an example of using dialogue to apply the Fix Neck Seam effect to an NPC whose weight slider was altered by the spells. See the source code and look at the WeightSpellsDialogueQuest in the CK for more information.
Version 1.2 adds spell tomes for each of the spells, just for grins. They're not placed anywhere in the game, however, you'll need to console them in. Search on "Weight" or "Slider". Also renamed the spells, putting "Weight Slider" at the beginning of each spell name, to make them easier to find in your spell menu.
EDIT: 25 September 2019
DON'T cast these spells on mounted NPCs. Bad things will happen. OTOH, if you do try it, please post a video, I'm always up for a Skyrim glitch laugh https://www.creationkit.com/index.php?title=UpdateWeight_-_Actor
Also, wrist and ankle gaps may be fixed by casting the Fix Neck Seam spell if the circumstances are right. (Thanks to nexusmodstry for that information)
That should give you the id's of all the weight spell spell tomes, you can use player.additem to add the spell tomes to your inventory. There should be 5 spell tomes in total. Then read the books and you'll have the spells
If you don't see the spell tomes listed when you enter the help command, go to your mod manager and make sure the mod has been enabled.
Sorry for the delay in responding, I've switched to SE and don't check here regularly anymore.
I hadn't planned on it, but I did do a quick conversion and everything seems to be working, so I probably will, yes. I'm a bit busy with work at the moment, but that should ease in the next week or so, I'll see about getting it posted then.
+1 for SE, this would be pretty big. Its really hard to use console commands on NPCs in VR, so these spells would make the VR community's lives much easier. Thanks for your consideration.
Not off-hand, and I'm not at my PC at the moment. You can search for them in the console or find them in xEdit, they're the only books added by this mod.
Hi have the problem that everytime I change the weight of my character the game lags a bit. Do you have any idea why? I'm asking cause im developing ways to dynamically change the weight via scripts.
My guess is because it's a pretty computation-intensive operation. I have a mid-range system (i7-4730 + GTX 1080 + 16 GB memory) and get a little stutter during the change. Doing the update at a time when there's not much going on helps. For instance, the Pumping Iron mod applies the changes to the player when the OnSleepStop event happens.
There are probably ways my scripts can be optimized, but beyond that and trying to update at low-activity times, I don't think there are many ways to improve the situation. The game engine isn't really designed to be doing these sorts of changes all the time.
I already found out that the body Im using has a very high polycount and therefore causes the lag (I7-8700K + RTX 2080 + 32GB)... I guess I have to shelf my ideas :/ But thanks for the reply anyway... :)
Oh yes, high poly-count bodies will add to the lag, no question. The weight update code does neck seam calculations, that will take longer if you've got a lot of vertices to move around
They call the SetWeight() and UpdateWeight() Papyrus/SKSE functions on the NPC and then QueueNiNodeUpdate() to cause the NPC to be rerendered. I suppose the setnpcweight console command does the same thing, in that it's probably using the same underlying functions as SetWeight(), etc. What SetNPCWeight doesn't do, however, is track the NPC's weight so you can fix the neck seam when it happens. I've included code to do this automatically the first time you cast one of the weight-altering spells. At the very least, it means you don't have to keep going into the console every time the neck seam reappears, you can use the dialogue or spell to fix it.
I'm not sure how useful these spells are in the grand scheme of things, I don't change my NPC weights, generally. It was just something that looked interesting to try to solve.
Awesome idea. Only thing that would be better is a concentration version of the spell that adds one point per second so you won't have to keep re-casting.
I think that might get a bit funky because of the way the visual updates are done to let you see the changes. If you try making it a concentration spell, please let me know how it goes.
So I usually do this manually for NPCs who have the grayface bug, but it doesn't really retain the changes permanently. Will the changes from these spells persist through a playthrough?
Short version: The weight changes will persist for the body, but the neck seam issue will keep popping up because of the way the game engine does its thing. Creating a "Fix Neck Seam" spell was the easiest way I could think of to repair it. But yeah, it means you have to cast the spell whenever the neck seam reappears.
Long version: The Fix Neck Seam spell recalculates the neck seam change that's needed and effectively causes the head's weight morph (it's called the SkinnyMorph, I believe) to be reapplied to the NPC's head mesh data and the NPC re-rendered. When I was testing I had a couple of cases where followers did not develop neck seams going through load screens, but non-follower NPCs did. But it wasn't consistent. When I quit to desktop, restarted the game and loaded a save I always got a neck seam.
I'm not an expert in this stuff by any means, I hope someone who knows more will chime in with more information.
EDIT: Ideally, there'd be a way to track all the NPCs who have been altered by these spells and automatically trigger the neck seam recalculation whenever one of them is in the same cell with you. There are a few ways I can think of that might work, but they could get very demanding on the game engine if you've altered a lot of NPCs.
26 comments
I've also commented my source files fairly extensively, so you should be able to step through what I did there.
Again, the Fix Neck Seam spell very probably WILL NOT WORK on NPCs whose weight slider wasn't altered solely by the spells in this mod. There may be a better way to grab the NPC's original weight and store it than what I've done; if so, I'd be interested in hearing about it. There should be a way to do an auto-update of the neck seams when the game is loaded, etc., too, but I don't have enough experience with those parts of the game engine to know when or how to do that efficiently.
In any event, I hope these are useful to you, even if only for learning purposes. I learned a lot putting them together.
Cheers!
- jknjb
EDIT: 29 September 2019
Version 1.1 adds an example of using dialogue to apply the Fix Neck Seam effect to an NPC whose weight slider was altered by the spells. See the source code and look at the WeightSpellsDialogueQuest in the CK for more information.
Version 1.2 adds spell tomes for each of the spells, just for grins. They're not placed anywhere in the game, however, you'll need to console them in. Search on "Weight" or "Slider". Also renamed the spells, putting "Weight Slider" at the beginning of each spell name, to make them easier to find in your spell menu.
EDIT: 25 September 2019
DON'T cast these spells on mounted NPCs. Bad things will happen. OTOH, if you do try it, please post a video, I'm always up for a Skyrim glitch laugh
https://www.creationkit.com/index.php?title=UpdateWeight_-_Actor
Also, wrist and ankle gaps may be fixed by casting the Fix Neck Seam spell if the circumstances are right. (Thanks to nexusmodstry for that information)
https://www.nexusmods.com/skyrimspecialedition/mods/101511
help WeightSpellsSpellTome
That should give you the id's of all the weight spell spell tomes, you can use player.additem to add the spell tomes to your inventory. There should be 5 spell tomes in total. Then read the books and you'll have the spells
If you don't see the spell tomes listed when you enter the help command, go to your mod manager and make sure the mod has been enabled.
I hadn't planned on it, but I did do a quick conversion and everything seems to be working, so I probably will, yes. I'm a bit busy with work at the moment, but that should ease in the next week or so, I'll see about getting it posted then.
Do you have any idea why?
I'm asking cause im developing ways to dynamically change the weight via scripts.
There are probably ways my scripts can be optimized, but beyond that and trying to update at low-activity times, I don't think there are many ways to improve the situation. The game engine isn't really designed to be doing these sorts of changes all the time.
But thanks for the reply anyway... :)
I'm not sure how useful these spells are in the grand scheme of things, I don't change my NPC weights, generally. It was just something that looked interesting to try to solve.
Long version: The Fix Neck Seam spell recalculates the neck seam change that's needed and effectively causes the head's weight morph (it's called the SkinnyMorph, I believe) to be reapplied to the NPC's head mesh data and the NPC re-rendered. When I was testing I had a couple of cases where followers did not develop neck seams going through load screens, but non-follower NPCs did. But it wasn't consistent. When I quit to desktop, restarted the game and loaded a save I always got a neck seam.
I'm not an expert in this stuff by any means, I hope someone who knows more will chime in with more information.
EDIT: Ideally, there'd be a way to track all the NPCs who have been altered by these spells and automatically trigger the neck seam recalculation whenever one of them is in the same cell with you. There are a few ways I can think of that might work, but they could get very demanding on the game engine if you've altered a lot of NPCs.