Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname JaxonzArrowsGlowEffect extends activemagiceffect
- EffectShader Property efsGlow Auto
- VisualEffect Property vfxLight Auto
- ObjectReference Property objPlayer Auto
- int kBowRelease = 6
- int kProjectile = 50
- Event OnInit()
- RegisterForActorAction(kBowRelease)
- EndEvent
- Event OnActorAction(int actionType, Actor akActor, Form source, int slot)
- ;the projectile shot is reliably the last projectile in the cell
- Cell kCell = objPlayer.GetParentCell()
- If (akActor == objPlayer)
- int iTries = 15
- ;it may take a moment for the projectile shot to come into existence
- int iProjectilesInCell = kCell.GetNumRefs(kProjectile)
- Utility.Wait(0.01)
- While (iProjectilesInCell == kCell.GetNumRefs(kProjectile)) && iTries
- iTries -= 1
- Utility.Wait(0.01)
- EndWhile
- ;NB: if there are tons of projectiles being shot, we can't guarantee that this is the player's projectile
- ObjectReference objProjectile = kCell.GetNthRef(kCell.GetNumRefs(kProjectile) - 1, kProjectile)
- ;make it glow and light it up!
- efsGlow.Play(objProjectile)
- vfxLight.Play(objProjectile)
- ;track it while in motion
- Float fDist = objPlayer.GetDistance(objProjectile)
- While objPlayer.GetDistance(objProjectile) != fDist
- fDist = objPlayer.GetDistance(objProjectile)
- Utility.Wait(0.05)
- EndWhile
- ;kill the light when motion stops
- vfxLight.Stop(objProjectile)
- EndIf
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement