In my research, I came across this video: http://www.youtube.com/watch?v=Bzg9v442bw8
After looking at the mods code, I found that it actually does exactly what I want to do. However, the code used to accomplish that is...in my opinion, very poorly written. I could copypaste his code, but I do not want to do this. I want to fully understand how it works, and write it myself. The math the author used in his code was, well, either way over my head, or once again, poorly written. I was hoping someone could help explain it to me, or give me a better solution.
Scriptname killmoonMagicCircleScript extends activemagiceffect import Mathimport UtilityInt Property index Autofloat Property Energy Auto float Property Stamina Autofloat Property Damage Auto ; initial position vectorfloat Property xPos Auto float Property yPos Auto float Property zPos Auto ; fly vectorfloat Property dx Auto float Property dy Auto float Property dz Auto ; privatefloat Property ang Auto float Property xAng Auto float Property yAng Auto float Property zAng Auto float Property x Auto float Property x2 Auto float Property sin Auto float Property cos Auto ObjectReference Property Circle01 AutoObjectReference Property Circle02 AutoObjectReference Property Circle03 AutoObjectReference Property Dummy AutoObjectReference Property Cast Auto ObjectReference Property Target AutoSpell Property killMoon AutoIdle Property moonIdle Auto killmoonQuestScript Property killmoonQuest Auto Event OnEffectStart(Actor Target, Actor Caster) Actor PlayerActor = Game.GetPlayer() if PlayerActor.IsWeaponDrawn() && !PlayerActor.IsFlying() Debug.ToggleCollisions() PlayerActor.PlayIdle(moonIdle) Debug.ToggleCollisions() Energy = PlayerActor.getav("Destruction") as float Energy = Energy * 2 Stamina = PlayerActor.getav("Stamina") as float Damage = Stamina - Energy if Damage > 0 PlayerActor.damageAV("Stamina", Energy) else PlayerActor.damageAV("Stamina", Stamina) PlayerActor.damageAV("Health", Damage) endif Utility.wait(0.5) killmoonQuest.indexCircle += 1 killmoonQuest.indexCircle = killmoonQuest.indexCircle % 3 if killmoonQuest.indexCircle == 1 Dummy = Circle01 elseif killmoonQuest.indexCircle == 2 Dummy = Circle02 else Dummy = Circle03 endif ang = PlayerActor.GetAngleZ() zang = ang if ang > 180 ang = ang - 360 endif x = ang*0.0174532925 x2 = x*x sin = x*(1-(x2/6)*(1-(x2/20)*(1-(x2/42)*(1-(x2/72)*(1-x2/110))))) cos = 1-(0.5)*x2*(1-(x2/12)*(1-(x2/30)*(1-(x2/56)*(1-x2/90)))) dx = 10*sin dy = 10*cos ; vertical fly vector ang = PlayerActor.GetAngleX() xang = ang*cos ; uses settings from Horizontal Vector yang = -ang*sin x = -ang*0.0174532925 x2 = x*x sin = x*(1-(x2/6)*(1-(x2/20)*(1-(x2/42)*(1-(x2/72)*(1-x2/110))))) cos = 1-(0.5)*x2*(1-(x2/12)*(1-(x2/30)*(1-(x2/56)*(1-x2/90)))) dz = 10*sin ; initial position vector (to add to player coords) xPos = 7*dx*cos yPos = 7*dy*cos zPos = 138+5*dz Dummy.Enable() Dummy.moveTo(PlayerActor, xPos , yPos , zPos ) Dummy.setAngle(xAng, yAng, zAng) Cast.Enable() Cast.moveTo(PlayerActor, xPos , yPos , zPos ) xPos = 7*dx*cos yPos = 7*dy*cos zPos = 8*dz Target.Enable() Target.moveTo(Dummy, xPos , yPos , zPos ) Utility.wait(0.5) killMoon.Cast(Cast ,Target) Utility.wait(1) Cast.InterruptCast() Dummy.Disable() Cast.Disable() Target.Disable() endifEndEventThere's a bit more code in a couple other scripts, but this is the bulk that I wish to understand.Amidst all of that, he calculated where the player was aiming, placed an activator at that location (I think), and then had a separate activated cast a spell at that location. There is some other stuff in there, such as moving the spell effect activator in front of the player, but I'm not concerned about that. My only concern, is figuring out how in gods name the players targeted location was found. Would anyone be able to help with this?


