So, how can I keep reference to the summoned minion in a summon spell? I just want to know who are my minions in real time.
Actor Property MyMinion AutoActorBase Property MyMinionBase AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)MyMinion = Game.GetPlayer().PlaceActorAtMe(MyMinionBase, 4);do stuff with MyMinionEndEvent
Event OnEffectFinish(Actor akTarget, Actor akCaster)MyMinion.Delete()EndEvent
Actor Property MyMinion AutoActorBase Property MyMinionBase AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)MyMinion = Game.GetPlayer().PlaceActorAtMe(MyMinionBase, 4);do stuff with MyMinionEndEvent
Event OnEffectFinish(Actor akTarget, Actor akCaster)MyMinion.Delete()EndEvent
Scriptname Example extends ActiveMagicEffectFormList property SummonSpells autoFormList property SummonCreatures autoActor property MySummon autoEvent OnSpellCast(Form akSpell) if (SummonSpells.HasForm(akSpell)) Utility.Wait(1) Actor SummonRef = Game.FindClosestReferenceOfAnyTypeInListFromRef(SummonedCreatures, GetTargetActor(), 2048.0) as Actor if (SummonRef) if (!SummonRef.IsCommandedActor() || SummonRef.IsHostileToActor(GetTargetActor())) SummonRef = None endif endif int count = 0 while (!SummonRef && count < 10) SummonRef = Game.FindRandomReferenceOfAnyTypeInListFromRef(SummonCreatures, GetTargetActor(), 2048.0) as Actor if (!SummonRef.IsCommandedActor() || SummonRef.IsHostileToActor(GetTargetActor())) SummonRef = None endif count += 1 endwhile MySummon = SummonRef endifEndEvent