RuneI
Class SeekerTrail

source: c:\runehov\RuneI\Classes\SeekerTrail.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.ParticleSystem
         |
         +--RuneI.SeekerTrail
Direct Known Subclasses:None

class SeekerTrail
extends Engine.ParticleSystem

//============================================================================= // SeekerTrail. //=============================================================================
Variables
 float ElapsedTime
 float MaxDeviation


Function Summary
 
simulated
SystemInit()
     
// init function
 
simulated
Tick(float DeltaTime)



Source Code


00001	//=============================================================================
00002	// SeekerTrail.
00003	//=============================================================================
00004	class SeekerTrail expands ParticleSystem;
00005	
00006	var float ElapsedTime;
00007	var float MaxDeviation;
00008	
00009	
00010	// init function
00011	simulated function SystemInit()
00012	{
00013		local int i;
00014		local float f;
00015	
00016		for (i=0; i<ParticleCount; i++)
00017		{
00018			ParticleArray[i].Valid = True;
00019			ParticleArray[i].Velocity = vect(0,0,0);
00020			ParticleArray[i].Alpha = vect(1,1,1)*AlphaStart;
00021			ParticleArray[i].LifeSpan = LifeSpanMin + (LifeSpanMax-LifeSpanMin)*FRand();
00022			ParticleArray[i].TextureIndex = 0;
00023			ParticleArray[i].Style = Style;
00024	
00025			if (bRelativeToSystem)
00026				ParticleArray[i].Location = vect(0,0,0);
00027			else
00028				ParticleArray[i].Location = Location;
00029	
00030			switch(i)
00031			{
00032			case 0:// case 1: case 2: case 3: case 4: case 5:
00033				// Large Spark
00034				f = RandRange(1.0, 1.1);
00035				//ParticleArray[i].Location += VRand()*5;
00036				ParticleArray[i].ScaleStartX = f;
00037				ParticleArray[i].ScaleStartY = f;
00038				ParticleArray[i].XScale = f;
00039				ParticleArray[i].YScale = f;
00040				break;
00041			default:
00042				// smaller sparks
00043				f = RandRange(0.2, 0.3);
00044				ParticleArray[i].Location += VRand()*10;
00045				ParticleArray[i].ScaleStartX = f;
00046				ParticleArray[i].ScaleStartY = f;
00047				ParticleArray[i].XScale = f;
00048				ParticleArray[i].YScale = f;
00049				//ParticleArray[i].Velocity *= 2;
00050				//ParticleArray[i].LifeSpan *= 0.5;
00051				break;
00052			}
00053		}
00054	
00055		IsLoaded=true;
00056	}
00057	
00058	simulated function Tick(float DeltaTime)
00059	{
00060		local int i;
00061		local vector X,Y,Z;
00062	
00063		ElapsedTime += DeltaTime;
00064		GetAxes(Rotation, X,Y,Z);
00065		for (i=1; i<ParticleCount; i++)
00066		{
00067			ParticleArray[i].Location = (Y * Sin(ElapsedTime*i) * MaxDeviation) + (Z * Cos(ElapsedTime*i) * 2 * MaxDeviation);
00068		}
00069	}
00070	
00071	defaultproperties
00072	{
00073	     MaxDeviation=10.000000
00074	     bRelativeToSystem=True
00075	     ParticleCount=8
00076	     ParticleTexture(0)=Texture'RuneFX.Spark1'
00077	     ShapeVector=(X=8.000000,Y=8.000000,Z=2.000000)
00078	     VelocityMin=(X=0.300000,Y=0.300000,Z=50.000000)
00079	     VelocityMax=(X=2.500000,Y=2.500000,Z=120.000000)
00080	     ScaleMin=0.700000
00081	     ScaleMax=1.100000
00082	     ScaleDeltaX=1.000000
00083	     ScaleDeltaY=1.000000
00084	     LifeSpanMin=30.000000
00085	     LifeSpanMax=30.000000
00086	     AlphaStart=10
00087	     AlphaEnd=10
00088	     bEventSystemInit=True
00089	     Style=STY_Translucent
00090	     ScaleGlow=3.000000
00091	}

End Source Code