Talk:Spell

From the CreationKit Wiki
Jump to navigation Jump to search

Summoning[edit source]

How would one go about summoning something that isnt an npc? namely a door but it would be nice to know for lots of things

A clean way to modAV by spell[edit source]

Be careful with abilities, cause if your mod is adding an ability which is affecting an actor value (by Value modifier, or Peak Value Modifier), and if a user disable your mod, the actor value will still be affected (at least for the player, idk for NPCs) !

Use instead regular spells to ModAV : AV affected by a mod's regular spell will be instantly restored after the mod is disabling.
Just set a very long duration for each custom MagicEffect of the spell (2000 days or more, even if your regular spell is constant and its MagicEffects too). You can even create a "fake" ability only to be shown in the player menu to avoid to display the very long duration in the magic menu (then check the flag "Hide in UI" for each MagicEffect of the "real" spell).
  • Constant diseases seem to act like regular spells : AV affected will be restored after a mod deactivation.
More explanations here : Compatibility with other mods - tips

Thanatos00 06:07, 20 April 2012 (EDT)

Just found an easier method : simply add a condition to each MagicEffect of an ability (with a custom globalValue for ex), and the problem is gone. When you'll desactivate your mod, global will disappear, so each magicEffect will be dispelled, and ActorValues will be restored.
Thanks to Gérauld for finding that =)
Thanatos00 08:30, 20 April 2012 (EDT)

Auto-Calculate[edit source]

Just to explain how I came to the conclusions for the notes I've recently added to the page....

My first thought was that auto-calculated spell costs were calculated on saving in the CK. That was disproven by Fireball, however, which has a cost of 86 in the game data, but 133 in the game itself. It then occurred to me that it might be calculated based only on currently loaded esm/esps, which turned out to be correct. To prove it, I did the following:

  1. Create a mod that modifies only the magic effect FireDamageConcAimed to change the base cost to 2.5. Save as Effect.esp.
  2. Create a mod that duplicates the Flames spell, which I called Flamer. Note the new spell's FormID. Save as Spell.esp.
  3. Create a mod that both modifies the magic effect base cost to 3.5 and duplicates the Flames spell; this one I called Flaming. Note the new spell's FormID. Save as Combined.esp.
  4. Try various load orders, adding the new spells via the console command player.addspell ModdedFormID.

The effect of the mods depends entirely on their load order, thus proving that auto-calculated costs are calculated at the moment the spell is loaded, including any magic effects in the same or earlier mods, but not including magic effects from mods that come later in the load order. Here is a table summarizing those results. Note that for simplicity, the various costs are based on the in-game costs shown for my testing character, who is Level 1 with a Destruction of 15. Only Skyrim.esm and Update.esm are loaded, since Dragonborn.esm confuses things by itself overriding the Base Cost of FireDamageConcAimed.

Load Order In-Game Costs
Flames Flamer Flaming
Effect Only 13 N/A N/A
Spell Only 13 13 N/A
Effect then Spell 13 21 N/A
Spell then Effect 13 13 N/A
Combined Only 13 N/A 30
Effect, Spell, Combined 13 21 30
Combined, Spell, Effect 13 30 30

Robin Hood  (talk) 2013-12-01T16:35:16 (EST)


Very interesting and useful information - thanks for sharing your tests. My one question is, does that mean if you add the original Flames as an ITM record in Combined.esp, it will also have a cost of 30? Or is it impossible to change the cost of the vanilla spell? Egocarib (talk) 2013-12-04T20:38:11 (EST)
Making a dirty mod where the Flames spell is included, but unaltered from the original, would work the same way as the new spells in my tests. So, yes, it would also have a cost of 30. I used different spells just to avoid the naming confusion of Flames, Flames, and Flames. :) Robin Hood  (talk) 2013-12-05T17:01:09 (EST)

Area Effect Ignores Line of Sight misinformation:[edit source]

The section on the main page regarding the "Area Effect Ignores LOS" stated that "Targets behind walls and other obstacles remain unaffected. This should be checked for area effect spells centred on the caster, otherwise the spell may not correctly hit targets behind the caster." I have discovered through extensive testing in the game with the flag enabled and disabled that this aforementioned text was completely inaccurate.

Line of sight for a spell, in terms of the game, is simply any sufficiently unobstructed line between the caster and the target (or perhaps between some object/effect/explosion/etc and the target) in any direction. This means that targets that are to the side, behind, above, below, etc, are all within the caster's line of sight if there is a sufficiently unobstructed potential visual path between them. I say potential, because the caster doesn't even have to be looking at the target for it to be considered within the caster's line of sight. Note that for the purposes of line of sight, creatures and people do count as obstructions, meaning that for an area of effect spell a target can prevent a target behind them from being hit due to blocking the line of sight.

Furthermore, when the flag to ignore line of sight is enabled, any and all targets within the range of the spell's effects can be affected by it, regardless of any and all obstacles. This includes walls, most notably, meaning that if you were to disable the line of sight flag on, say, the Fire Storm spell, you could hit/kill a target through several layers of solid walls so long as they are within the 100 foot range of the spell.

I have rewritten the section on the main page regarding the 'Area Effect Ignores Line of Sight' to reflect my findings and state the flag's effect with better clarity. Lobotomy (talk) 2014-01-27T16:33:57 (EST)

Concatenated spell descriptions[edit source]

Testing indicates:

  • If all of a spell's magic effects have names and descriptions, and if only some effects are active, then concatenation stops at the first inactive effect. Active effects after the first inactive effect are not included in the concatenated description.
  • If all of a spell's magic effects lack descriptions, then all of their names will be concatenated, separated by periods and sometimes showing the magnitude.

DavidJCobb (talk) 2018-06-26T22:12:58 (EDT)