Adding a Script to a Light created by a spell

Post » Thu Feb 19, 2015 12:16 am

Is it possible?

I have a magic effect of archetype Light with my created Light as Assoc. Item 1 (the Light has 3D). The ImpactData has a Hazard with the same light. The Light base object has a script attached to it.

So theoretically I have two chances that the script (better put: events in the script) gets called, namely the light spawned by the magiceffect and the light spawned by the hazard.

The problem is just that neither OnLoad() nor OnInit() get called.

What I'm trying to achieve is:

  • Player casts a spell
  • script runs on target location (i.e. ground, handled with a created light),
  • creates an XMarker
  • and forces its ObjectRef into a Quest Alias

Before that I tried using a summon effect with an actor. That worked, but it restricted the created creatures to one at a time, which was highly impractical and took forever.

Anyone got a better idea?

User avatar
dav
 
Posts: 3338
Joined: Mon Jul 30, 2007 3:46 pm

Post » Wed Feb 18, 2015 11:33 pm

You need to place a script on the xMarker, have it extend ObjectReference, and use Event OnLoad to add it to a quest alias.

OnLoad will fire everytime the xMarker is dropped by the spell, so keep that in mind.

User avatar
Noraima Vega
 
Posts: 3467
Joined: Wed Jun 06, 2007 7:28 am

Post » Wed Feb 18, 2015 9:10 pm

But how do I get the spell to drop an XMarker?

User avatar
Emma Parkinson
 
Posts: 3401
Joined: Wed Jul 26, 2006 5:53 pm

Post » Wed Feb 18, 2015 10:56 pm

You need to make an explosion for the magic effect. Just copy "EmptyFXExplosion" and then edit the duplicated form's "object to drop" being the xmarker.

Not gonna lie, it's not going to be easy to get this right. The spell needs to be an AOE for the explosion to "drop", or nothing will happen.

User avatar
Jessica Colville
 
Posts: 3349
Joined: Wed Oct 18, 2006 6:53 pm

Post » Thu Feb 19, 2015 12:46 am

Ok, I will try this. Thank you.^^

User avatar
Christine
 
Posts: 3442
Joined: Thu Dec 14, 2006 12:52 am


Return to V - Skyrim