//============================================================================= // ParticleFireSpawner. // // ParticleFireSpawner script by: // Steve Nabors // www.planetunreal.com/slick // slickwilly@planetunreal.com // // This script is used to spawn fire particles for use // as torches or whatever you need it for // // When the particles spawn they are going at a speed of // 0. The Acceleration and Variance can be used to modify // how fast they speed up. vAccleration is the minimum speed // and a Random number in the Rand of vAccelerationVariance // will be added to this speed. If hAcceleration is above 0 // then a random Horizontal Acceleration in the range of // hAcceleration is added to the particle physics. // hAcceleration is used to add a little bit of horizontal // Variance so the particles don't go just staight up. // // FireRadius is used to determine the coverage area. Fire // Particles will randomly spawn within the radius you set. // // 2 Textures can be Choosen. These are the Fire and Smoke // Textures. Each has their own BaseSize and Variance in // case the textures are different sizes. // // If your spawner only spawns Smoke or nothing at all then // try raising it up a little from whatever it is sitting // on. // // This actor is trigger controlled. You must be currently triggering // this actor for it to run. Do not create a large radius trigger // to keep this actor going as it will eat up CPU time, Especially // if you have many of them. Try to keep the trigger area as small // as possible around the Spawner. If it can't be seen then it // shouldn't be triggered. // //============================================================================= class FSParticleFireSpawner expands Effects; var() int vAcceleration; var() int vAccelerationVariance; var() Texture FireTexture; var() float FireBaseSize; var() Float FireSizeVariance; var() int hAcceleration; var() float SmokeBaseSize; var() float SmokeSizeVariance; var() Texture SmokeTexture; var() int FireRadius; var() bool bSpawnSmoke; var() float SpawnDelay; var vector newloc; var effects e; Replication { Reliable if(Role == Role_Authority && bNetInitial) FireRadius, vAcceleration, vAccelerationVariance, hAcceleration, FireBaseSize, FireSizeVariance, SmokeBaseSize, SmokeSizeVariance, SmokeTexture, bSpawnSmoke, SpawnDelay, FireTexture; } simulated function BeginPlay() { Texture = None; if(Level.NetMode != NM_DedicatedServer) settimer(SpawnDelay, True); else Disable('Timer'); } simulated function Timer() { Newloc = Vrand() * FireRadius + Location; Newloc.z = Location.z + 1; e = Spawn(class'FSFireBall',,,newloc); e.Texture = FireTexture; e.DrawScale = FireBaseSize + Frand() * FireSizeVariance; e.Acceleration = Vrand() * hAcceleration; e.Acceleration.z = vAcceleration + Rand(vAccelerationVariance); if(Frand()< 0.4 && bSpawnSmoke) { newloc.z = Location.z + 20; e = Spawn(class'FSFireSmoke',,,newloc); e.Texture = SmokeTexture; e.DrawScale = SmokeBaseSize + Frand() * SmokeSizeVariance; e.Acceleration.z = vAcceleration + Rand(vAccelerationVariance); e.Velocity.z = vAcceleration; } } defaultproperties { vAcceleration=100 vAccelerationVariance=50 FireTexture=FireTexture'UnrealShare.Effect1.FireEffect1pb' FireBaseSize=0.500000 FireSizeVariance=0.250000 hAcceleration=10 SmokeBaseSize=0.750000 SmokeSizeVariance=1.000000 SmokeTexture=FireTexture'UnrealShare.Effect16.fireeffect16' FireRadius=4 bSpawnSmoke=True SpawnDelay=0.200000 bStasis=True bNetTemporary=False RemoteRole=ROLE_SimulatedProxy AmbientSound=Sound'AmbAncient.Looping.afire4' DrawType=DT_Sprite SoundRadius=12 SoundVolume=192 }