Jump to content

Attaching scripts dynamically?


leron9999

Recommended Posts

Well, there's http://www.creationkit.com/Dynamically_Attaching_Scripts

 

but I didn't care very much for it. I probably don't know enough yet to, uh, properly appreciate the samples.

 

I was thinking along the lines of having script A on the player to handle OnSpellCast that would call out to the ReferenceAlias script B passing the spell, which would do a Self.ForceRefTo(passedInSpell), at which point script B is now attached to the spell just cast.

 

I don't know if that's how it actually works or not, it's just an idea.

Link to comment
Share on other sites

Why not make a custom magelight spell instead? An easy way might be to make a custom magelight spell that uses a *copy* of the vanilla magelight effect/object, then simply attach your script to the copied effect/object. That way your custom magelight orb will always have the script on it and you won't need to mess about with referencealiases oy dynamically attached scripts. Edited by steve40
Link to comment
Share on other sites

Oh... that's surprisingly simple haha. How can the magelight projectile tell if it's hit with something though? If I'm not mistaken, casting magelight places a magic effect on the caster. So if I use the onhit event, it'll read it as the player being hit and not the magelight itself.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...