Difference between revisions of "SetPlayerProjectile"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Quetzilla
imported>Quetzilla
m
 
Line 8: Line 8:
   
   
{{Projectile Ref}}
{{Projectile Ref}}
==See Also==
==See Also==
* [[GetProjectileSource]]
* [[GetProjectileSource]]

Latest revision as of 10:50, 24 August 2008


A command for Oblivion Script Extender

Syntax:

(nothing) reference.SetPlayerProjectile

Sets the player as the source of the projectile. Actors hit by the projectile will react as if the player had cast the spell or fired the arrow.

Finding the Projectile Reference[edit source]

The only way to get a projectile reference is by walking through projectile references with GetFirstRef, GetNextRef and Label/GoTo. See GetFirstRef for the necessary info and a good, generalized example (note that the example walks through door references, change the 24 to 34 for projectiles).

Another example - this one will walk through each projectile until it finds an arrow shot by your companion (Reference EditorID = TriggerHappyFan) and marks the player as the shooter.

ref rProj
...
set rProj to (GetFirstRef 34 1)
Label
if rProj
    if (rProj.GetProjectileType == 0) && (rProj.GetProjectileSource == TriggerHappyFan)
        rProj.SetPlayerProjectile
    else
        set rProj to GetNextRef
        Goto
    endif
endif


See Also[edit | edit source]


Projectile Functions
General GetProjectileType · GetProjectileSource · SetPlayerProjectile
Magic GetMagicProjectileSpell · SetMagicProjectileSpell
Arrows GetArrowProjectileEnchantment · GetArrowProjectileBowEnchantment · GetArrowProjectilePoison