compEngineer314 Posted January 28, 2016 Share Posted January 28, 2016 How do i go about scripting a spell that can target two different actors (Not including the player). Ex: Use spell on actor 1 and then cast the spell again to set actor 2, then perform some action on both. I can't find a way to save the first actor id when targeting the second actor. Link to comment Share on other sites More sharing options...
sLoPpYdOtBiGhOlE Posted January 28, 2016 Share Posted January 28, 2016 (edited) Hi,I'm not that great with spells and whatnot.But here's a way I tested it and it works ok in the brief i tried of it.What i did was:Created an empty Game Start Enabled quest.Attached this script to the new empty quest. Scriptname TwoTargetQS extends Quest Float Property fTimeOut = 5.0 Auto {TimeOut after the first target hit if no second target hit. Default 5 seconds} Activator Property SummonTargetFXActivator Auto {Not needed, using this for an example action of the two targets} Spell Property TwoTargetSpell Auto {Not needed, just using this to add the spell to the player} Actor T1 Event OnInit() Game.GetPlayer().AddSpell(TwoTargetSpell) EndEvent Function CheckTarget(Actor akTarget) If !T1 T1 = akTarget RegisterForSingleUpdate(fTimeOut) Else If T1 != akTarget ;Do some action with the two targets (example swaps the 2 targets postion while using a fx) ObjectReference FXRef1 = T1.PlaceAtMe(SummonTargetFXActivator) ObjectReference FXRef2 = akTarget.PlaceAtMe(SummonTargetFXActivator) T1.MoveTo(FXRef2) akTarget.MoveTo(FXRef1) T1 = None EndIf EndIf EndFunction Event OnUpdate() If T1 T1 = None EndIf EndEventThen I duplicated InfluenceConfUpFFAimed magic effect and I removed the attached script and added my own script.I Pointed the TwoTargetQS Property to my quest I created beforehand. Scriptname TwoTargetMES extends ActiveMagicEffect TwoTargetQS Property TTQS Auto Event OnEffectStart(Actor akTarget, Actor akCaster) If akTarget TTQS.CheckTarget(akTarget) EndIf EndEventI also edited the effect and set it to Effect Archetype: ScriptAnd also removed the conditions.Then I created a new Spell and Added my new magic effect to the spell with 0 duration.Then I set 2 of the 3 properties on the quest script I created earlier using AutoFill (SummonTargetFXActivator property and TwoTargetSpell property).Here's my test sample esp and scripts of it if you want to give it a try and dissect it to create your own version of what your after.There are probably better ways to do what your after, but this was just one approach going by what you said you wanted to do. Basically you cast the spell at the first target and cast the spell at a second target and they will swap postions with each other.You have a 5 second timout if you don't target the second actor before 5 seconds.The spell will be auto added to you when you first load the esp (Two Targets is the spell name and it's listed as an Illusion spell). Edited January 28, 2016 by sLoPpYdOtBiGhOlE Link to comment Share on other sites More sharing options...
Recommended Posts