//-----------------------------------------------------------
//   WORKING BEAM EMITTER - Michal Bida
//-----------------------------------------------------------
class CustomBeamEmitter extends Emitter;
 
//This is our key function. This function is called on clients if the actor has set bNetNotify to true
//Here we can set the emitter dynamically to use our variables
simulated function PostNetReceive()
{
    //Here you can change the emitter dynamically, e.g.
    //Emitters[0].LifetimeRange = myLifeTime;
}
defaultproperties
{
    //hew we define the emitter behavior
    Begin Object Class=BeamEmitter Name=BeamEmitter3
	//AutoDestroy=true
	SecondsBeforeInactive=0.000000
        //the length of the beam - only used if DetermineEndPointBy is set to PTEP_Distance
        BeamDistanceRange=(Min=300.000000,Max=800.000000)
        //the beam end point, only used if DetermineEndPointBy is set to PTEP_Offset
        //BeamEndPoints(0)=(Offset=(X=(Min=500.000000,Max=500.000000),Y=(Min=0.000000,Max=0.000000),Z=(Min=0.000000,Max=0.000000)))
        //How the beam should determine the end point, see BeamEmitter.uc for more
        DetermineEndPointBy=PTEP_Distance
        //We are not using noise for this beam
        LowFrequencyNoiseRange=(Y=(Min=0.000000,Max=0.000000),Z=(Min=-0.000000,Max=0.000000))
        HighFrequencyNoiseRange=(X=(Min=0.000000,Max=0.000000),Y=(Min=0.000000,Max=0.000000),Z=(Min=0.000000,Max=0.000000))
        NoiseDeterminesEndPoint=False
        //Should be true if we don't want the beam to dissapear
        RespawnDeadParticles=True
        AutomaticInitialSpawning=True
        ColorMultiplierRange=(Y=(Min=0.500000,Max=0.500000))
        //how many particles should be spawned at once for this beam
        MaxParticles=1
        //How the emitter determine its rotation - PTRS_Actor means he will have the same rotation as actor it is attached to
	UseRotationFrom=PTRS_Actor
	//whether we want to add some rotation offset
	RotationOffset=(Pitch=0,Yaw=10000,Roll=0)
        StartLocationOffset=(X=0,Y=0.000000,Z=0.000000)
        StartLocationRange=(X=(Min=0.000000,Max=1.000000),Y=(Min=0.000000,Max=1.000000),Z=(Min=0.000000,Max=1.000000))
        StartLocationShape=PTLS_Sphere
        StartSizeRange=(X=(Min=0.000000,Max=0.000000),Y=(Max=0.200000))
        InitialParticlesPerSecond=30.000000
        //texture the beam will use
        Texture=Texture'GameBotsUE2.green_ray_black'
        LifetimeRange=(Min=0.100000,Max=0.30000)
        InitialDelayRange=(Min=0.100000,Max=0.150000)
        StartVelocityRange=(X=(Min=1.000000,Max=1.000000),Y=(Min=-0.300000,Max=-0.300000),Z=(Min=0.000000,Max=0.000000))
        //how many rotation sheets should this beam use. If set to 1 the beam will be flat.
	RotatingSheets=5
	//this below should make the beam spin, but so far I was unable to got it working
	SpinParticles=true
	SpinsPerSecondRange=(X=(Min=100.000000,Max=100.000000),Y=(Min=100.00000,Max=100.00000),Z=(Min=100.000000,Max=100.000000))
	StartSpinRange=(X=(Min=100.000000,Max=100.000000),Y=(Min=100.00000,Max=100.00000),Z=(Min=100.000000,Max=100.000000))
	SpinCCWorCW=(X=100,Y=100.000000,Z=100.000000)
        Name="BeamEmitter3"
    End Object
    Emitters(0)=BeamEmitter'BeamEmitter3'
 
    bNoDelete=false
    bAlwaysRelevant=True
    bNetTemporary=False
    bHidden=False
    bNetNotify=True  //this is important here, otherwise the function PostNetReceive() would not be called
    //if we want to be able to set this emitter dynamically in PostNetReceive fc.
    RemoteRole=ROLE_SimulatedProxy
    //Sets the distance this emitter should be visible from
    CullDistance=+2000.0
}
blog/ue2_beamemitter_example.txt · Last modified: 2012/06/14 10:30 by michal.bida