Skyrim Special Edition
0 of 0

File information

Last updated

Original upload

Created by

zip

Uploaded by

iamzip

Virus scan

Safe to use

Tags for this mod

About this mod

This mod uses scripts to actively change the colors of racemenu overlays based on conditions selected in the MCM.

Requirements
Permissions and credits
Changelogs
LE Version

Upgrading to v0.3 requires a clean save.

Description:

This mod uses scripts to actively change racemenu overlay colors based on conditions and colors set in the MCM.  Currently only supports the player character.

There are two main conditions, driver and pulse. The driver of a slot indicates what is being looked at and scripts calculate the appropriate color based on the driver and color limits set in the MCM.  The pulse of a slot indicates a condition that triggers the pulse color to be applied and then fade the slot back to its calculated current color once that condition is no longer met.  The mod comes with several baked in setting for each, as well as the recently added method for plugins to add more.

Each area has its own page, body, hands, feet, and face. On each page you can select which slot number you are defining.  For the slot to be fully defined you'll need to select a few options.  First you'll need to tick the enable slot button.  Then you need to select your pulse and drive conditions, details about the options are below.  Next you define the driver minimum and maximum.  These two numbers define the lower and upper limits for the calculation of the current color.  For example if the driver is set to Destruction and your minimum is 25, maximum 75 and current skill level is 50 then the color of the slot, both tint and glow, will be set to half way between the min and max colors.  If the skill level is at or below 25 then the slot color is set to the minimum, if the skill level is at or above 75 then the slot color is set to the maximum.  Finally you need to set the minimum and maximum colors. For each condition, minimum, maximum, and pulse, you'll need to define the tint color and alpha level and the glow color and alpha level.  The default colors are black and alpha 0.0, which will leave the slot hidden.  In order to have a color show up the alpha will need to be greater than 0.  The colors can be defined in three ways, you can select the color from the color menu, you can define the colors in racemenu and use the collect slot colors button (this will pull the tint color and alpha as well as the glow color and alpha currently set for the slot), or, with excessive color mode on, you can define the RGB for each color with the sliders.

Warning: there is currently no restore previous color button so if you turn off the mod after colors have been changed they will remain at their current colors, you'll have to redo any overlay colors via racemenu at that point.  Also, this being my first attempt at scripting, use at your own risk.

Updating:
This new version requires a clean save as well as some editing to avoid any known issues.  I recommend the save settings function in the utilities page before updating.
 1 - Turn the mod off in the MCM and wait a couple minutes then make a new save.
 2 - Exit the game, uninstall active overlays.
 3 - Load the game with the save you just made, then create a new save, then exit the game.
 4 - Open the latest save with a save cleaner, search for scripts and script instances starting with "zao" and delete all that come up.  Save and exit.
 5 - Install the latest version of active overlays.
 6 - Open the game and load your cleaned save.

Details:
MCM general options:
  • Enable mod: does what it says, if this is off then nothing happens. Turn off this option and exit the MCM to remove all spells before uninstalling.
  • Pulse options: these options create the list of pulse options that show up for each slot. Default includes No Pulse, OnLevelUp, OnSkillUp, OnCombat, OnHit, OnSpell, OnContinuous.  The animated pulse options are experimental and include OnAnimCastLH, OnAnimCastRH, OnAnimLoopPulse, OnAnimLoopDriver.  The external option will add pulse options from other plugins if any are available. More details below.
  • Driver options: these options create the list of driver options that show up for each slot.  Default includes Character Level, damageresist, magicresist, game time increasing, game time decreasing. Skills includes all 18 base game skills.  Stats includes health, magicka, stamina. External drivers will add driver options from other plugins if any are available. More details below.

Pulse options:

These are global settings that affect all slots that have relevant pulse options selected.
  • "Fade combat pulse on hit": all slots set to OnCombat will drop to the current color then fade back to the pulse color when hit, uses the same timing as OnHit. the "current" color refers to the slot color calculated based on the slot's driver.
  • "Reduce glow intensity when sneaking": this option will change the glow alpha value of all slots by the multiplier on entering sneak mode and return them to normal on exiting sneak mode.
  • "Hit Pulse duration": the duration that the pulse color lasts before fading for all hit events.  if the fade combat pulse option is selected this timer is also used for the current color duration.
  • "Pulse duration": the duration that the pulse color lasts before fading for any momentary (usually event driven) pulse options, eg. OnSkillUp.
  • "Hit Fade duration": approximate time it takes for fading between pulse and current colors for on hit events.  The way the script works this is the target time but could take longer depending on script load.  This is also used to fade back to the pulse color for the fade on combat option above.
  • "Fade duration": the approximate time it takes for fading between pulse and current colors for most other pulse events.
  • "Spell Fade duration": the approximate time it takes for fading between pulse and current colors for spell pulse options. Here because some spell animations are longer or shorter than others.
  • "OnContinuous Fade duration": the approximate time for a fade cycle for OnContinuous pulse option.  Due to this one being a continuous cycle the fade timer is separate to allow for longer full cycles.
  • "Sneak glow multiplier": if the "Reduce glow intensity when sneaking" option is active, this number is multiplied with the glow alpha to reduce the intensity when sneaking.
  • "Time for complete anim chase cycle": the approximate time it takes for a complete animation cycle.

Pulse details:

  • "OnLevelUp"
Spoiler:  
Show

The slots that pulse on level up are triggered by the level up event, which triggers after the level up menu is exited.

  • "OnSkillUp"

Spoiler:  
Show

The slots that pulse on skill level up will trigger any time the skill level up event fires and the slot is driven by the skill that leveled up.

  • "OnCombat"

Spoiler:  
Show

The slots that pulse on combat will set color to pulse when weapons / spells are readied, or if the player enters combat.

  • "OnHit"

Spoiler:  
Show

The slots that pulse on hit will apply the pulse color and fade back each time an onhit event fires. the script is set up to handle multiple rapid consecutive hits.

  - "OnSpell"

Spoiler:  
Show

The slots that pulse on spell cast will fade up and remain at the pulse color while the spell is held then fade back once the spell is cast or otherwise is no longer held. the script also accounts for ritual spells by using a different fade time.
    - Left hand only: restricts the pulse to only trigger if the spell is cast from the left hand.
    - Right hand only: restricts the pulse to only trigger if the spell is cast from the right hand.
    - Skill driver magic school: restricts the pulse to only trigger if the slot's driver is a magic school skill and the spell cast is from that school.

  • "OnContinuous"

Spoiler:  
Show

Slots that use this pulse continuously fade between the pulse and current colors. the fade is continuously updating so the color adjusts as the current color gets updated by the driver.

  • "OnAnimCastLH" & "OnAnimCastRh"

Spoiler:  
Show



Left hand an right hand versions of animated on spell.  This pulse requires 1 body slot and 1 hand slot. If you forget to set up both the script will select an available slot and set it up for you.  Each version, as indicated in the name, only triggers when a spell is cast by the corresponding hand.  The animation will overwrite the textures in the slots used and drivers are disabled.  Allows for external texture sets / animations to be used.  Please keep in mind that these animated pulse options are very experimental and may cause issues such as getting stuck or other odd behavior.

  • "OnAnimLoopPulse" & "OnAnimLoopDriver"

Spoiler:  
Show



Plays a looping animation which can be selected and allows for external texture sets / animations.  Allows for multiple slots to be picked, creating a trailing effect.  The pulse version disables drivers and only uses the pulse color(s).  The driver version continuously updates the color(s) based on the driver selected.  Each slot using these will have their textures overwritten.  As with the spell animation, this is very experimental and can get stuck or out of sync.  If something breaks it is recommended to go into the MCM and exit, or save and re-load, as this will force the mod to reload all spell effects.

Also please note that all anim types included in the base mod are based on UNP / default male body, other body types might experience issues.
    
Driver details:
All drivers have 2 common options, hide below minimum and hide above maximum.  These do as you'd expect, if a slot's driver is below the selected minimum or above the selected maximum, respectively, then the alpha for tint and glow for that slot are set to 0.0 until the driver comes back in range.
  • "Character Level": uses the character level number and the minimum and maximum limits set in the MCM to calculate the current color based on the defined min and max colors.
  • "damageresist" and "magicresist": uses the armor level and magic resist value, respectively, as the driver value.
  • "game time increasing" or "game time decreasing": increases or decreases the driver value for the slot based on the selected time interval in game hours by the selected increment value. the script polls every game hour and checks against each slot's selected interval before updating. allows for direct setting of the driver in case you want to start somewhere other than zero.
- "Add to counter when hit": if selected each time the character is hit the driver counter is increased by 1. the script attempts to filter out the multi hit issue from enchanted weapons.
- "Time interval for slot": the time interval in game hours between updates.
- "Amount to add or remove per interval": as stated, the amount by which the driver value is adjusted on update.
- "Set driver value directly": does what it says.
  • Skills: uses the value of the skill selected as the driver and calculates the color based on the min and max settings selected.
  • health, magicka, stamina: uses the value of the selected stat as the driver, continuously updates rapidly when below 100% and when levels are changing.

Spoiler:  
Show

- "only active in combat": hides the slot when not in combat.
- "only active out of combat": hides the slot while in combat.
- "use percentage not magnitude": uses the stat percentage instead of the full magnitude. also reduces and limits the maximum possible driver max to 100.

External pulse and drivers:
This version now allows for plugins to use this MCM to offer pulse and driver options not hard coded into the base mod.  To facilitate this, and because of how hard a time I had compiling things with frostfall scripts, I've separated the frostfall exposure driver into its own plugin.  I've also included an example plugin, zao moon and star, that shows how to use the system.  This plugin offers two drivers and one pulse option.
  • "OnFullMoon": Fades up to and maintains pulse color at the first day of the full moons and fades back down to current once the moon phase changes.  This script uses the method of calculating the moon phase described in the creation kit wiki so if something in your LO plays with the length or start of moon phases then this might de-sync.
  • "day time" / "night time": Both drivers monitor the time of day and increase the driver value as time passes through the day / night.  The cut is 6am/pm.  For example the night time driver starts at 0 at 6pm and increases to 600 at midnight, then decreases back to 0 at 6am, remaining there until the next 6pm.

Info for merging plugins:
If you decide to merge plugins for this mod you will also need to change the json files for each plugin merged.  First you need to change the "modname" variable of each file to point to the name of the merge plugin.  Then you also need to update the form information for all spells in each plugin's json file.  I haven't tried converting to ESL yet so I'm not certain how easy that is to do here, but as long as the json file correctly points to the spells added then it should work, in theory.

For modders:
Spoiler:  
Show

Integration functions are currently part of the main script, zao_quest_main, and are comprised of:
  • UpdateCounter(Int[], Int[], Int[], Int[], Int):  This function takes the four integer arrays plus an integer value and updates all relevant slots in all areas to this value.
  • UpdateSlots(Actor, Bool, Int[], Int[], Int[], Int[]):  This function calculates the current color and alpha values for each slot passed in the four integer arrays.  This function also requires passing the player as actor and the player sex as bool.  This is set up this way to allow for future development so that other actors might be passed.
  • HideSlots(Actor, Bool, Int[], Int[], Int[], Int[]):  This function takes the player as actor, player sex as bool, and four integer arrays and sets the tint and glow alpha values to 0.0.
  • ApplyPulse(Actor, Bool, Int[], Int[], Int[], Int[]):  This function takes the player as actor, player sex as bool, and four integer arrays and applies the selected "pulse" colors and alpha values to each slot designated in the arrays.
  • ApplyCurrent(Actor, Bool, Int[], Int[], Int[], Int[]):  This function takes the player as actor, player sex as bool, and four integer arrays and applies the calculated current colors and alpha values to each slot designated in the arrays.
  • FadeUp(Actor, Bool, Int[], Int[], Int[], Int[], Float):  This function takes the player as actor, player sex as bool, four integer arrays, and a float time value.  The function then, for each indicated slot, cycles through calculating a fade color and alpha value between the slot's current value and pulse value.  Each cycle should take around 0.05s and moves closer to the pulse value as the cycle number gets closer to the time value given.  The function ends on the cycle before applying the pulse values so those will need to be applied with the "ApplyPulse" function after this function, if that is the functionality you're going for.  the variables for timing supplied by the sliders in the MCM are "hitpulsetime", "pulsetime", "hitfadetime", "fadetime", "spellfadetime".
  • FadeDown(Actor, Bool, Int[], Int[], Int[], Int[], Float):  This function takes the player as actor, player sex as bool, four integer arrays, and a float time value.  The function then, for each indicated slot, cycles through calculating a fade color and alpha value between the slot's pulse value and current value.  Each cycle should take around 0.05s and moves closer to the current value as the cycle number gets closer to the time value given.  The function ends on the cycle before applying the current values so those will need to be applied with the "ApplyCurrent" function after this function. the variables for timing supplied by the sliders in the MCM are "hitpulsetime", "pulsetime", "hitfadetime", "fadetime", "spellfadetime".

Each function requires, at a minimum, passing four integer arrays of slots, one each for body, hands, feet, and face, in that order.  If no slot will be manipulated for a particular area then an array of size 1, value -1, needs to be passed.  My filter function in the MCM script will drop slot information into the zao_cfg.json file each time the MCM is closed.  To pull data for each area see the below script fragment:

    If(JsonUtil.IntListCount("zao_cfg", "BSFOnHit") > 0)
        hitb = JsonUtil.IntListToArray("zao_cfg", "BSFOnHit")
    Else
        hitb = Utility.CreateIntArray(1, -1)
    EndIf

In this example "OnHit" is the driver in question, this works for both pulse and slot drivers, and the area being set up is the Body slot area.  Throw this into the "OnEffectStart" event along with collecting the player and sex-as-bool.  The way this breaks down is the filter function writes to the json file, for body slots, "BSF" + driver name.  This is then the name of the integer array filled by the filter function.  For hand slots this is "HSF" + driver name, for feet slots "FtSF" + driver name, and for face slots "FSF" + driver name.  The full method can be seen in detail by looking over the scripts included in the example plugin, "zao moon and star".

In order for your drivers to show up in the pulse or slot driver menus you will have to also provide a plugin json file with the following information:
  • A string named "modname" whose value is the full name of the plugin with extension, eg: "modname" : "zao_moon_and_star.esp"
  • A string list named "extdriver" with the names you want to appear in the slot driver menu.  Even if you're only adding one driver it needs to be in a string list. Eg.: "extdriver" : [ "Day Time", "Night Time" ]
  • A string list named "extpulse" with the names you want to appear in the pulse driver menu.  Even if you're only adding one driver it needs to be a string list.  If you are only adding pulse drivers, or only adding slot drivers, then the other does NOT need to be included as a null string. Eg.: "extpulse" : [ "OnFullMoon" ]
  • For each driver you need to include a form for the spell that applies the script.  The form needs to be named the same as the driver that uses the spell in the form.  Eg.: "night time" : "3430|zao_moon_and_star.esp".  If you are applying the script for your driver through a different means, such as a quest, then do not include anything for that driver.

This json file needs to be placed in the Data\skse\plugins\StorageUtilData\zao_plugins folder.


For adding animation sets:
Spoiler:  
Show

Currently there are 3 types of animations available, looping, casting left hand, and casting right hand.  In the main mod file I've included folder structure in the textures folder, but given how the json file is set up you can really put them wherever you want.  You will need to place the json file in the appropriate Data\skse\plugins\StorageUtilData\zao_texset sub folder. Here's what you need: 

For looping:
  • A texture set that comes reasonably close to loop.
  • A json file with:
- A string variable named "animloopname". This string will show up in the animation list in the MCM.
- A string list named whatever value you entered as the animloopname.  the contents of this list needs to be the name and folder structure of each texture in your animation.

for casting, left or right handed, need to be separated:
  • A body texture set. I recommend not exceeding 12 frames for regular casting, 36 frames for ritual spell casting, and keeping size at or below 1k.
  • A hand texture set. I recommend not exceeding 3 frames for regular casting, 9 frames for ritual spell casting.
  • A json file with: 
- A string variable named "animcastlhname", or "animcastrhname", depending on cast type. this string will show up in the MCM animation selection menu.
- A string list named "body" + the value of the animcastlhname variable. eg: bodyhelixlh1.  this list needs to contain the name and folder path of each body texture in the standard cast set.
- A string list named "hand" + the value of the animcastlhname variable. eg: handhelixlh1.  this list needs to contain the name and folder path of each hand texture in the standard cast set. 
- Optional: a string list named "body" + the value of the animcastlhname variable + "p". eg: bodyhelixlh1p.  this list needs to contain the name and folder path of each body texture in the ritual spell cast set.
- Optional: a string list named "hand" + the value of the animcastlhname variable + "p". eg: handhelixlh1p.  this list needs to contain the name and folder path of each hand texture in the ritual spell cast set.


Requirements:
SkyUI
RaceMenu
PapyrusUtil 
FISS - technically optional

I've also built in compatibility for some mods found on LL.

Warning:
Conflicts with any other mod that plays with overlay colors, like RaceMenu - Animated Overlays.  This mod can be made to play nice with that one by leaving any slots controlled by Animated Overlays deactivated in this mod.  The same goes for any other mods that adjust color or alpha of an overlay slot.

Known Bugs:
  • For some reason the color swatch doesn't always recognize certain values from the blue color component slider, but the slot color definition works anyway, no idea why this sometimes happens.
  • There are certain occasions where the pulse function will miss a condition, such as pulling out and putting away a weapon several times too rapidly.  To fix this simply cycle through weapon out / away giving a second pause after each action.
  • If you are casting spells in rapid succession the script monitoring that may miss a trigger and you might end up holding a spell without the pulse active.  To fix this put the spell away or finish casting, the script should catch the next iteration.

Thanks to Hawk9969 and Monoman1 for their scripts and help, and AthenaESIV for beta testing.  And I'm not sure who all else, I dug through so many scripts trying to figure out what I was doing.