Snippet: Scripted body color changes
After wasting time fighting random crashes with Skyrim (which turned out to be a mix of a somehow corrupted .ini file and issues with SexLab Defeat 4.1), I finally took the time to think about a long standing idea - how to change the skin of the player by script.
Applications could be interesting. Think dynamic dirt on the face of slaves, make-up on demand, sun-tan... on in my current application, hormonal effects of repeated sexual activity.
A side mod I am working on tracks the player's sexual activity and applies changes to the body over time. Too much activity and the body gains weight and increases sensual curves, Not enough activity and the changes revert back to a flatter body.
I wanted the skin color to change accordingly - colder with low activity, and warmer with high activity (along with red lips and dark eyeliner).
Thanks for @jbezorg for pointing me to the direction of the source scripts for RaceMenu.... here is the code I came up with:
; SKIN TONE ======================================================= ; Types ; 0 - Frekles ; 1 - Lips ; 2 - Cheeks ; 3 - Eyeliner ; 4 - Upper Eyesocket ; 5 - Lower Eyesocket ; 6 - SkinTone ; 7 - Warpaint ; 8 - Frownlines ; 9 - Lower Cheeks ; 10 - Nose ; 11 - Chin ; 12 - Neck ; 13 - Forehead ; 14 - Dirt ; Sets the tintMask color for the particular type and index int rgb = 0 int alpha = 1 int color = Math.LogicalOr(Math.LogicalAnd(rgb, 0xFFFFFF), Math.LeftShift((alpha * 255) as Int, 24)) int type = 6 ; SkinTone int index_count = Game.GetNumTintsByType(type) int index = 0 while(index < index_count) Game.SetTintMaskColor(color, type, index) index = index + 1 EndWhile Game.UpdateTintMaskColors() If SKSE.GetPluginVersion("NiOverride") >= 1 NiOverride.ApplyOverrides(PlayerActor) NiOverride.ApplyNodeOverrides(PlayerActor) Endif
You need to install the NiOverride plugin for SKSE to get this to work.
A first round of tests are promising
2 Comments
Recommended Comments