File information

Last updated

Original upload

Created by

Weetinte

Uploaded by

Weetinte

Virus scan

Safe to use

About this mod

Let's your torch, candlelight- and magelight spell cast shadows with options for brightness and range.

Requirements
Permissions and credits
Translations
  • Spanish
  • Italian
  • German
Changelogs
Donations
Torches Cast Shadows


 Customize your carried light source in-game with features
such as brightness, range, shadows and automatic profile switching
to circumvent issues related to dynamic shadows
.



Available for Skyrim 2011






Features
  • Torches, Candlelight and Magelight cast dynamic shadows.
  • Candlelight spell can be toggleable (using it again while it's still active will turn it off).
  • Brightness and range customization in MCM.
  • Disable/enable mod features at specific locations, or altogether.
  • Automatically disables shadow casting when too many dynamic lights are around (hardcoded engine limit is 4).
  • NPC functionality.
  • Patch for Wearable Lanterns by Chesko: Lets your lantern cast shadows (only front facing belt fastened).
  • ALL OPTIONS are toggleable via MCM.




Compatibility
  • Wearable Lanterns by Chesko: Compatible (Patch available)
  • Smoking Torches by artem1s: Compatible (Patch available)
  • Enhanced Lights and FX (ELFX): Compatible
  • ELE: Compatible
  • Mods that alter Candlelight/Magelight: Might not be compatible




Requirements




How it works and what to expect
As most of us already know, there is an apparent reason why Bethesda didn't include this functionality: PERFORMANCE. Therefore, dynamic lights held by actors are bound to have some issues. This is exactly the reason why this mod exists - to circumvent the limitation of the game engine.
The script scans every new cell on cellchange and returns all shadow casting lights. Each time you, or a npc if enabled, is equipping a light (torch/candlelight) the script checks how far the shadow casting lights are. If 4 of them are too close to the player, you won't cast any shadows. This means that shadow casting won't work all the time, only when it is safe. This will avoid light flicker and CTD.

Currently, there are three main issues with dynamic lights in Skyrim (and most of Bethesdas other games).

  1. There is a hardcoded limit of 4 dynamic lights being rendered at the same time. If this limit is exceeded the last added light will simply "turn off". This creates a "flickering" effect when moving the camera around in circles as the lights go on and off.
  2. Replacing dynamic lights with static lights will cause them to "get stuck" in the world. This is particularly bad since it the dynamic light limit will rapidly get exceeded if not handled correctly.
  3. PERFORMANCE! The main reason behind issue 1, and inherently also the reason why issue 2 exists. Dynamic lights is a performance killer for consoles and other low-end machines.

This mod aims to fix issue 1 and 2.
Issue 1 is fixed by always checking the area before equipping a torch: IF there are too many dynamic lights within a customizable radius, don't equip a shadow casting torch/candlelight/etc - just equip a regular torch. Each actor wearing a dynamic light also has a script which checks if it still is safe to use it, otherwise the dynamic light is replaced by a regular light.
Issue 2 is fixed by always removing the old dynamic light BEFORE equipping the new one.


Still, there are some minor issues that might occur.
  • There is a slight delay and a light "pre-pop" effect before the torch is equipped. There is nothing I can do about that if I wish to maintain compatibility with other popular torch-related mods.

  • Occasionally, the left hand holding a torch will still be in the holding animation even after unequipping.

  • If you have another mod which edits the TorchEvents IdleAnimation record, you will get a wierd "picking up" animation each time equipping a torch. If you use any other mods that add left-handed held lights you WILL need a patch. Currently only Wearable Lanterns by Chesko is supported.

  • Light may flicker if you use other mods than ELFX or ELE that add lights to the vanilla world. A patch is needed, let me know and I will fix it. Just let me know what light mod you are using. Custom homes might also have these issues. Either add that location to the Blacklist in the MCM or request for a patch in the comments. Patching i REALLY easy since it can be done through script.

  • Torches won't burn out.

  • Light cast on characters skin might sometimes look strange or "polygonal". (This might be fixable by adjusting the mesh's light-node position/rotation, maybe...?)











Todo
- Duration option for candlelight (see SetNthEffectDuration and GetNthEffectDuration) 
- Torches should burn out and be removed from the inventory. Options for how they burn out. Keep track on how long a torch has been used on OnObjectEquipped and OnObjectUnequipped. Remove a torch when a certain customizable limit is exceeded - reset when OnItemRemoved -> GetItemCount(Torch02) == 0.
- Experiment with GetLight() and SetLight() and SetProjectile() and GetProjectile().
REPORT BUG
Top