Making an actor cast a spell every time they start a package

Post » Wed Jun 20, 2012 8:35 am

So I've got this actor who needs to cast a spell in order to be able to use it's package correctly. I'm not exactly sure how to do this correctly.

Obviously I need to run it on the "Begin" stage using "Cast", that's the easy part. However, I can't get my spell in scope of the package. I'd need to set a property to do that, except from what I've seen I can't have properties inside packages.

So, how would I go about ensuring that my NPC casts a spell everytime they start using my package?
User avatar
Danger Mouse
 
Posts: 3393
Joined: Sat Oct 07, 2006 9:55 am

Post » Wed Jun 20, 2012 7:34 am

Well, you can set packages to have owning quests. So just do that, and have something like:

(GetOwningQuest as MyQuestScript).SpellCast(akActor)

And have your quest script something like:

Scriptname MyQuestScript extends QuestSpell property SelfTargetSpell autoFunction SpellCast(Actor NPC)    SelfTargetSpell.Cast(NPC)EndFunction
User avatar
Sheila Esmailka
 
Posts: 3404
Joined: Wed Aug 22, 2007 2:31 am

Post » Wed Jun 20, 2012 9:54 am

I can't have properties inside packages.

sure you can. on the fragment of the "begin" you can add a property for whatever it is you need
User avatar
Nany Smith
 
Posts: 3419
Joined: Sat Mar 17, 2007 5:36 pm


Return to V - Skyrim