Difference between revisions of "GetProjectileType"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>DragoonWraith
(New page: {{OBSE v0015}} A command for Oblivion Script Extender '''Syntax:''' (projectileType:short) reference.GetProjectileType Returns the calling project...)
 
imported>Haama
(Added projectile ref example)
Line 23: Line 23:
|Magic Bolt
|Magic Bolt
|}
|}

{{Projectile Ref}}


[[Category: Functions]]
[[Category: Functions]]

Revision as of 09:55, 23 August 2008


A command for Oblivion Script Extender

Syntax:

(projectileType:short) reference.GetProjectileType

Returns the calling projectile reference's type.

Projectile Type Codes

0 Arrow
1 Magic Ball
2 Magic Fog
3 Magic Bolt

Finding the Projectile Reference

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