But looking through the information on Events in the Papyrus pages, there is no example of how to tell a script to monitor a particular event. Here is my current script:
Spoiler
Now it is never entering the "OnSpellCast" event code, no matter how many spells I cast (Not even the one this effect is actually IN.)
The example they give of the OnSpellCast event in the reference pages...doesn't work. Here it is:
Scriptname PlayerTeleportSpellScript extends activemagiceffect {Keeps track of the location of the current teleport node and moves the player there when teleport is cast.}import gameimport utilityObjectReference playerObjectReference TeleportHereEvent OnSpellCast(form IncomingSpell)Debug.MessageBox("Spell Cast Detected: " + IncomingSpell) Spell ThisSpell = IncomingSpell as spell if ThisSpell && ThisSpell == TeleportLaunch Utility.Wait(0.25) ; Make sure the projectile has been fired! ObjectReference ThisIsIt = FindClosestReferenceOfTypeFromRef(MagicLightTeleportSpell,Game.Getplayer(),5000) TeleportHere = ThisIsIt Debug.MessageBox("Launch spell detected, looking for Node. Node Assigned: " + TeleportHere) endifEndEventEvent OnEffectStart(Actor Target, Actor Caster) ; No real target, and the caster is the player, since it's a player-only spell player = (game.getPlayer() as ObjectReference) if TeleportHereDebug.MessageBox("Teleport Node: " + TeleportHere) Utility.Wait(0.5) player.MoveTo(TeleportHere) TeleportHere.Delete() ; Make sure node goes poof. TeleportHere = FindClosestReferenceOfTypeFromRef(MagicLightTeleportSpell,Game.Getplayer(),10000000) while TeleportHere ; Now to get rid of any extras that may or may not be floating around somewhere in the cell. TeleportHere.Delete() TeleportHere = FindClosestReferenceOfTypeFromRef(MagicLightTeleportSpell,Game.Getplayer(),10000000) endwhile else; Debug.MessageBox("No Teleport Node Assigned!") endifEndEventLight Property MagicLightTeleportSpell autoSpell Property TeleportLaunch AutoNow it is never entering the "OnSpellCast" event code, no matter how many spells I cast (Not even the one this effect is actually IN.)
The example they give of the OnSpellCast event in the reference pages...doesn't work. Here it is:
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") endIfendEventNow examples are supposed to show how to do something. An example that doesn't work is not a good example now, is it?
So has anyone with massive telepathic abilities been able to divine how to make a script properly "listen" for an event triggered elsewhere? The script I wrote DOES respond to the OnEventStart event, but only for itself.
Is how to do this hidden on some obscure, not-linked-to event related page in the documentation somewhere?
And no, this isn't a duplicate thread...different issue, different thread.
