Background for Fallout 4
Member of the ObjectReference script
eventOnSpellCast(FormakSpell)

Description

Wiki Description

Event called when a spell is cast by the object reference.

Documentation Comment

Event received when a spell is cast by this object


Caveats

CK Wiki - Notes

  • Carried over from Skyrim, this is still a valid event as many actors in Fallout 4 use spells not obvious to the player.

Parameters

  1. FormakSpell

    CK Wiki Description

    Spell that was cast. Can be Spell, Enchantment, Potion, or Ingredient.


Examples

Event OnSpellCast(Form akSpell)
  Spell spellCast = akSpell as Spell
  if spellCast && spellCast == FireballSpell
    Debug.Trace("We just cast a fireball!")
  else
    Debug.Trace("We cast something, but we don't know what it is")
  endIf
endEvent

Auto-Generated Example

Scriptname MyCoolScript extends ObjectReference

event OnSpellCast(Form akSpell)
    Debug.trace("Event received - OnSpellCast: akSpell = " + akSpell)
endEvent

Related Pages


Additional References

View this event’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.