Difference between revisions of "Template:Projectile Ref"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Haama
(Category link)
imported>SpookyFX
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Findind the Projectile Reference==
==Finding the Projectile Reference==
The only way to get a projectile [[Glossary#R|reference]] is by [[Glossary#W|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).
The only way to get a projectile [[Glossary#R|reference]] is by [[Glossary#W|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).


Line 5: Line 5:
<pre>ref rProj
<pre>ref rProj
...
...
set rProj to Apple
set rProj to (GetFirstRef 34 1)
set rProj to (GetFirstRef 34 1)
Label
Label
Line 12: Line 11:
         rProj.SetPlayerProjectile
         rProj.SetPlayerProjectile
     else
     else
        set rProj to Apple
         set rProj to GetNextRef
         set rProj to GetNextRef
         Goto
         Goto
Line 18: Line 16:
endif</pre>
endif</pre>


<noinclude>[[Category:Function Info Templates]]</noinclude>
<noinclude>
[[Category: Templates|Projectile Ref]]
[[Category: Function Info Templates|Projectile Ref]]
</noinclude>

Latest revision as of 01:52, 10 August 2010

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