About this mod
Guided and Homing Projectiles - Homing Spells, Arrows and shouts
- Requirements
- Permissions and credits
This SKSE plugin adds manually guided and auto-homing projectile(including missile, arrow and cone types) features to skyrim. You can apply it to NPCs to make fighting enemy mages more challenging, or apply it to your spells to make arrows, ice and fire magic more effective against flying dragons. The homing behavior for each projectile is controlled by a hexadecimal digit, or equivalently four binary digits. Lower two bits define whether the projectile is guided by the movement of camera, higher values mean more sensitive responses. This category is only applicable to player. Higher two bits control whether the projectile chases its caster's combat target. Different values correspond to different styles of chasing. See source code for detail. To apply the effect to a specific projectile, open CK and prefix its display name with _GuidedA_, where 'A' is the hexadecimal digit. homproj.esp contains a staff named 'Staff of Guided Icy Spear' as an example. To apply to all NPCs or PC, first change the hexadecimal digit into decimal form, say A in hex equals 10 in dec, then set the value of ForceNPCGuided or ForcePCGuided in the ini file to this value. You are welcome to use it in your own mods.
The script I use to produce some interesting effects:
Scriptname SpellChainEffectScript extends ActiveMagicEffect
Int Property MaxCount Auto
Projectile Property ProjectileBase Auto
Spell Property SpellToFire Auto
Spell Property SpellToFire2 Auto
Spell Property spchk Auto
ObjectReference[] Property Sources Auto
Actor Target
Event OnEffectStart(Actor akTarget,Actor akCaster)
Target=akTarget
EndEvent
Event OnSpellCast(Form akSpell)
if spchk==akSpell as Spell
Spell sp
if IsDualCasting(Target)
sp=SpellToFire2
else
sp=SpellToFire
endif
ObjectReference proj=Game.FindClosestReferenceOfTypeFromRef(ProjectileBase,Target,4096.0)
ObjectReference Source=Sources[Utility.RandomInt(0,Sources.Length - 1)]
if proj
int i=0
float lastx=proj.GetPositionX()
while i<MaxCount
Source.MoveTo(proj,0.0,0.0,0.0,false)
float newx=proj.GetPositionX()
if lastx==newx || !proj.Is3DLoaded()
i=MaxCount
else
sp.RemoteCast(Source,Target,proj)
Source.MoveTo(proj,0.0,0.0,0.0,false)
lastx=newx
i+=1
sp.RemoteCast(Source,Target,proj)
endif
endwhile
endif
endif
EndEvent
The script I use to produce some interesting effects:
Scriptname SpellChainEffectScript extends ActiveMagicEffect
Int Property MaxCount Auto
Projectile Property ProjectileBase Auto
Spell Property SpellToFire Auto
Spell Property SpellToFire2 Auto
Spell Property spchk Auto
ObjectReference[] Property Sources Auto
Actor Target
Event OnEffectStart(Actor akTarget,Actor akCaster)
Target=akTarget
EndEvent
Event OnSpellCast(Form akSpell)
if spchk==akSpell as Spell
Spell sp
if IsDualCasting(Target)
sp=SpellToFire2
else
sp=SpellToFire
endif
ObjectReference proj=Game.FindClosestReferenceOfTypeFromRef(ProjectileBase,Target,4096.0)
ObjectReference Source=Sources[Utility.RandomInt(0,Sources.Length - 1)]
if proj
int i=0
float lastx=proj.GetPositionX()
while i<MaxCount
Source.MoveTo(proj,0.0,0.0,0.0,false)
float newx=proj.GetPositionX()
if lastx==newx || !proj.Is3DLoaded()
i=MaxCount
else
sp.RemoteCast(Source,Target,proj)
Source.MoveTo(proj,0.0,0.0,0.0,false)
lastx=newx
i+=1
sp.RemoteCast(Source,Target,proj)
endif
endwhile
endif
endif
EndEvent