Oblivion
0 of 0

File information

Last updated

Original upload

Created by

Atkana

Uploaded by

Atkana

Virus scan

Safe to use

Tags for this mod

About this mod

Allows spells to be cast with ranges inverted (such as Self becoming Touch). Useful for buffing companions without having to specifically make a Touch version of every buff. By default, only pure Self spells can be inverted, but more can be configured with the .ini.

Requirements
Permissions and credits
Apparently Nexus Mods doesn't support markdown (even though I swear I've seen it used before...). If you want to see a pretty formatted version of this, paste it into a markdown viewer ;p

I swear I did a whole search of the site before starting work on this, only apparently to find out just before publishing that another very similar mod actually does exist - oops (and they handle the swapping between spells in a cleaner way too...). Well at least my version has the options of inverting any spell effect, and options to change to Target instead of just Touch. And was fun to make.


# Prepared Spells
## Introduction
Allows spells to be cast with ranges inverted (such as Self becoming Touch). Useful for buffing companions without having to specifically make a Touch version of every buff. By default, only pure Self spells can be inverted, but more can be configured with the .ini.

## Requirements
This mod requires the following:
- xOBSE

## Description
In order to cast a spell with inverted ranges, hold `Left ALT` (configurable) when pressing the cast button. When a spell is inverted, Touch and Target effects will become Self, while Self effects will become Touch. Holding `X` (configurable) in addition to the invert button will turn Self effects into Target instead of Touch (while this feature is enabled, which it is by default).

If for any reason the spell can't be inverted, the normal version of the spell will be cast instead. Reasons a spell can't be inverted are:
- The spell includes *any* effect that's of a disallowed range. (Dis)allowed ranges can be configured.
- You can't afford to cast the inverted version.
- One of the effects can't be cast at the desired inverted range (for example, the Summon magic effects can only be on Self, and so can't be inverted to Touch). If a spell you're casting as a Target would fail solely because of this reason, it'll attempt to cast it as a Touch spell instead if that's possible.
- The spell contains a scripted effect with a script attached. Some effects may not have been programmed to handle unexpected targets, so this is disabled for safety reasons, though you can disable this safety feature in the config.

The mod will make a (lazy) attempt to adjust the costs of the inverted spells to some degree:
- If the inverted spell ends up as a *purely* Target spell, and its value isn't auto-calculated, its cost will be modified by the same cost modifier that Target effects usually are (The `fMagicRangeTargetCostMult` GMST - by default `1.5`).
- If the inverted spell ends up as a *purely* Touch spell, regardless of if its cost auto-calculated or not, it will be multiplied by a configurable value (so long as the multiplier isn't the default of `1.0`). This allows you to apply an extra cost/discount for using (some) inverted spells rather than dedicated spells, as you see fit.

## Miscellaneous
### Configuration
For a full list of configuration options and what they do, see the included `Invert Spellcasting.ini` file. Edit and place the file in your `Data` or `Data/ini` folder to use it.

One main aspect you may wish to change is that by default, only spells that are purely Self range can be inverted.

### Cheats/Debug
- When a spell is first cast in its inverted form, the inverted version of the spell is created and stored to be re-used when needed again (each spell has two separate inverted versions - one when cast as Target, and one cast otherwise). This means that the spell's cost is locked-in at that point, and won't change even if you later adjust settings that would change its cost. In order to update a stored inverted spell (by replacing it with a new one), you can temporarily use `set TouchSelfAllowOverwriteRecords to 1` to put the mod in overwrite mode, where any inverted spells cast will overwrite the recorded versions with new ones each cast. So cast the spells you want to update in their inverted form(s), then `set TouchSelfAllowOverwriteRecords to 0`. You don't want to leave this running longer than you have to, because creating a new spell every time a spell is cast inverted will (probably) really bloat your save (I'm unsure if internally the game will clean up old ones or not, but better safe than sorry)!
- If something somehow goes catastrophically wrong with storage, you can use `set TouchSelfNukeRecords to 1` to completely wipe all records.

### Known Issues
- Even if the inverted version of your spell is cheaper to cast, you cannot cast the spell if you don't have enough magicka for the original. Not much that can be done with that, I'm afraid.
- The only method I could figure out to allow this comes with a small amount of jankery. It probably won't cause any problems, but *may* interact oddly with some other mods when the stars align.
- Due to some awkwardness with how scrolls are handled, you can't do inverted casts of scrolls.
- Internally, inverted spells store a copy of the spell when cast normally, and when cast with the target modifier. If the result is an all-self spell, they will be functionally the same, but different spells. This doesn't mean much (aside from a tiny bit of extra bloat), but is worth bearing in mind when overwriting records that you may have to overwrite both versions.