Difference between revisions of "Template:Projectile Ref"
Jump to navigation
Jump to search
imported>Haama m (→Findind the Projectile Reference: Spelling) |
imported>SpookyFX |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
<pre>ref rProj | <pre>ref rProj | ||
... | ... | ||
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 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