Skyrim Special Edition
0 of 0

File information

Last updated

Original upload

Created by

Asrak

Uploaded by

MaybeAsrak

Virus scan

Safe to use

Tags for this mod

About this mod

New Perk Entry Points for dynamically controlling cast time and dual casting via a single hand. Also some additional papyrus commands to cast spells/control active effects.

Requirements
Permissions and credits
Changelogs
Resource/framework using Noah's PEPE mod to enable new perk entry points so mod authors can control cast time, whether a spell or staff cast is dualcast, and more on a per spell and actor basis using perks. 

~~~~~~~~~~~~~~~~~~~~~~~~~
Requirements:
PEPE
Address Library
SKSE 
PO3tweaks
~~~~~~~~~~~~~~~~~~~~~~~~~
Changelog
Spoiler:  
Show

v0.1.0 - initial release
v0.2.0 - added/fixed new papyrus functions, fixed dualcasting which was a little broken, added an esp with example perks, added additional channels for left vs right vs either casting source.
v0.3.0 tidied source code and fixed a bug with instant cast spells. Better example perks as well with descriptions in esp.



~~~~~~~~~~~~~~~~~~~~~~~~~
Compatibility:
Tested with 1.5 and should work with 1.6XX versions
Does not work with VR as PEPE is not compatible, if enough interest I could make a version that only uses some unused AV's for the various functions

Unlikely to work with other DLL based mods that edit cast time
~~~~~~~~~~~~~~~~~~~~~~~~~
Papyrus Functions (see .psc file as well):

Spoiler:  
Show
Function CastSpellItemMult(Actor akSource, Spell akSpell, Enchantment akEnchantment, Potion akPotion, Ingredient akIngredient, ObjectReference akTarget, float a_effectiveness, float a_override)  global native
; checks in order from spell to enchant to potion to ingredient, spellcasting the final one. may not catch player enchants/potions if they are not loaded/equipped
Function CastSpellMult(Actor akSource, Form MagicItem, ObjectReference akTarget, float a_effectiveness, float a_override)  global native
; will try to cast the form you give it to a MagicItem then perform a spellcast 
; override is a magnitude override of the whole spell and effectiveness acts similarly to dualcasting the spell in terms of increasing magnitude/duration depending on the flags of the spell/mgef itself
bool Function GetEffectWasDualCast(ActiveMagicEffect a_activeEffect) global native
Function AdjustActiveEffectMagnitude(ActiveMagicEffect a_activeEffect, Float a_power) global native
Function AdjustActiveEffectDuration(ActiveMagicEffect a_activeEffect, Float a_duration) global native
; remaining duration 
bool Function GetEnchantCostOverrideFlag(Enchantment a_enchant) global native
Function SetEnchantCostOverrideFlag(Enchantment a_enchant, Bool ValueToSet) global native
int Function GetEnchantCostOverrideValue(Enchantment a_enchant) global native
int Function GetEnchantChargeOverrideValue(Enchantment a_enchant) global native
Function setEnchantCostOverrideValue(Enchantment a_enchant, Int CostOverride) global native
Function setEnchantChargeOverrideValue(Enchantment a_enchant, Int ChargeOverride) global native



Note: you can use the PEPE papyrus functions to get the net spell cast time multiplier if you need to in script



~~~~~~~~~~~~~~~~~~~~~~~~~
Perk Entry Point Framework (see PEPE for more details):

Cast time Perk entry point (internally represented as 1 by default with higher values giving you faster casting speed so adding 10 via entry point will give you 11x casting speed and multiplying by 0.5 will give you half casting speed. Works on the charge up to some concentration spells/staves/scrolls, up to the modder to set the conditions):

Spoiler:  
Show

Use the mod spell cost EP
In the editorID, make sure GROUP__CastTime is included somewhere
Set the rank to 3 in CK or 2 in xEdit (its 0 indexed in xedit) to affect everything (default)
Set the rank to 4 in CK or 3 in xEdit (its 0 indexed in xedit) to affect anything cast from right hand
Set the rank to 5 in CK or 4 in xEdit (its 0 indexed in xedit) to affect everything cast from left hand
Use the perk as normal (set the conditions you want on the actor/spell, scale the value by a multiplier or what have you)
Add the perk to actors of interest however you like (only needs to be given as rank 1 so it won't change the spell costs)


Dual Cast entry point (internally represented as 1 by default and is calculated separately for each hand. If the value is >= 5, the game will consider that cast a dual cast and use the correctly increased cost/effectiveness. Works with scrolls and staffs unless you use conditions to exclude them. Does not effect the power/shout slot or the instant cast slot. Will not count as isdualcasting for condition purposes unless you actually do the normal dual cast which is unaffected.

Spoiler:  
Show

Use the mod spell cost EP
In the editorID, make sure GROUP__DualCast is included somewhere
Set the rank to 3 in CK or 2 in xEdit (its 0 indexed in xedit) to affect everything (default)
Set the rank to 4 in CK or 3 in xEdit (its 0 indexed in xedit) to affect anything cast from right hand
Set the rank to 5 in CK or 4 in xEdit (its 0 indexed in xedit) to affect everything cast from left hand
Use the perk as normal (set the conditions you want on the actor/spell, scale the value by a multiplier or what have you)
Add the perk to actors of interest however you like (only needs to be given as rank 1 so it won't change the spell costs)


Helpful examples are now included in an esp to give you an idea of how to use the perk entry points.
Some tips: you can use the getisobjecttype on the spell tab on the perk (perk condition tab 1 in xedit) to distinguish between spells, scrolls, and staves for either of the entry points (this also works for regular perks as well!)
You can scale cast time with an AV to use one of the unused AV's. Be aware that the "condition" AV's like braincondition default to 100 and get the base value reset to 100 on save but do respect modifiers so if you want to easily create enchants, abilities, or add to a dual value modifier like how frost damages stamina, i recommend picking an AV and scaling it by 0.01
~~~~~~~~~~~~~~~~~~~~~~~~~
Future plans (let me know in the comments about any ideas along these lines that you are interested in)

Create example esp's with some basic examples of how to use unused AV's to create a cast time AV or scale cast time with spell school - DONE

Split up the perk entry points for spell/staff/scroll for convenience (if people are interested) - Unnecessary as getisobjecttype condition function lets you check for this within the perks themselves

Create a framework to allow you to constantly and automatically update the magnitude of specific MGEF's if they have a keyword using a new perk entry point - running into some problems so unlikely to be as flexible as I wanted it but still planning on a version

Create a framework/system to all you to equip and cast spells through any staff and have the pre-existing enchant and other staff attributes influence the cost/magnitude/cast time - in progress

Create a papyrus function to cast an arbitrary amount of self cast fire and forget spells and then scale their remaining duration as a function of your magicka regen per second (quality of life function so you don't have to cast a bunch of buffs but also respect the time it would take to cast all of them and wait to regen magicka) - need to do some RE

Create a better system for charging up spells so you can seamlessly dual or single cast from one hand depending on either pressing a different button or something to that effect: - at some point
~~~~~~~~~~~~~~~~~~~~~~~~~
Bugs/issues
The particles around the staff/hand also slow down or speed up when charging up a spell depending on your effective cast time multiplier. They return to normal speed once you are finished charging

~~~~~~~~~~~~~~~~~~~~~~~~~
Source: https://github.com/MaybeAsrak/MagicUtils

~~~~~~~~~~~~~~~~~~~~~~~~~
Other cast time Mods:
Both of these are worth checking out if you want something easier to get up and running as an end user:
Fenix's casting mod here is a nice plug and play cast time editing mod
kmatt's newly updated controlled casting has a lot more in game ways to control cast time without fiddling with xedit necessarily

Acknowledgements:

Talles for all of the RE and general help
Forn for the Motivation
Noah for PEPE, putting up with my silly questions, and general help
RE discord (especially fenix/po3/ersh/CharmedBaryon) for all the general clib help and RE work 
kmatt for the controlled casting mod which was an inspiration
shadowshayde for doing a lot of the core MagicCaster/ActorMagicCaster RE
nightfallstorm for helping with the Skill Issues
MrowrPurr for the template and video series