erratichippo Posted January 1, 2016 Share Posted January 1, 2016 I am trying to make a spell script that finds the nearest weapon to the caster then launches the weapon at the target. My problem is that when I try to use and function to move the found weapon it will not work. I am only able to apply an impulse on the weapon object. I cannot use the translatetoref or pushactoraway functions on the found weapon. Even if I cast the weapon as an actor. Can anyone help me with this? scriptName WeaponThrow extends ActiveMagicEffect import game import debug formlist property WeaponList auto float RadiusToFindWeapon = 2000.0 objectreference WeaponFound ;objectreference property Target auto Event Oneffectstart(Actor akTarget, Actor akCaster) WeaponFound = game.FindClosestReferenceOfAnyTypeInListFromRef(WeaponList, akCaster, RadiusToFindWeapon) debug.notification("Weapon Found "+WeaponFound) debug.notification("akTarget "+akTarget) Actor WeaponActor = WeaponFound as Actor ;Target.moveto(akTarget,0,0,5,true) WeaponFound.applyhavokimpulse(0,0,1,50) utility.wait(0.5) ;WeaponFound.translatetoref(akCaster,100) akTarget.pushactoraway(WeaponActor,-10) Endevent Link to comment Share on other sites More sharing options...
Recommended Posts