Difference between revisions of "Teleportation Projectile"
Jump to navigation
Jump to search
(Changed formating and removed useless variable) |
Hellkeeper (talk | contribs) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
''Note: This was found on some tutorial dated about 2002 with no author attached, so I figured it would be ok to share it with everyone. The only parts I did change were the comments in the code, to allow the player to understand what each line does. Just Sub-Class TazerProj and copy this code to make it work. | |||
''Note: | |||
'' | '' | ||
class TeleProj expands TazerProj; | class TeleProj expands TazerProj; | ||
function Explode(vector HitLocation,vector HitNormal) | function Explode(vector HitLocation,vector HitNormal) | ||
{ | { | ||
Line 35: | Line 27: | ||
Destroy(); | Destroy(); | ||
} | } | ||
[[Category:Scripting]] |
Latest revision as of 18:42, 10 September 2011
Note: This was found on some tutorial dated about 2002 with no author attached, so I figured it would be ok to share it with everyone. The only parts I did change were the comments in the code, to allow the player to understand what each line does. Just Sub-Class TazerProj and copy this code to make it work.
class TeleProj expands TazerProj; function Explode(vector HitLocation,vector HitNormal) { // Play the Explosion sound. PlaySound(ImpactSound, SLOT_Misc, 0.5,,, 0.5+FRand()); // Hurt everyone 70 units away. HurtRadius(Damage, 70, 'jolted', MomentumTransfer, Location ); // If the damage is high, make a big explosion. if (Damage > 60) Spawn(class'RingExplosion2',,, HitLocation+HitNormal*8,rotator(HitNormal)); // Make teleport sparkles. Spawn ( class 'PawnTeleportEffect',,, Instigator.Location ); // Make teleport sparkles where you will end up. Spawn ( class 'PawnTeleportEffect',,, Location ); // Here, you are transported to wherever you hit. Instigator.SetLocation(Location); // This destroys the projectile. Destroy(); }