Gah - a solution with more questions. – EntropicLqd

Legacy:VitalOverdose/SFXMonsterSpawning

From Unreal Wiki, The Unreal Engine Documentation Site
< Legacy:VitalOverdose
Revision as of 07:07, 14 September 2011 by Vitaloverdose (Talk | contribs) (More custom emitter scripts)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
UT2004 :: Actor >> Emitter >> SFXMonsterSpawning (Package: custom)

by VitalOverdose

Overview[edit]

class SFXMonsterSpawning Extends Emitter
placeable;
 
var ()         bool                   bRandomList;
Var            int                    TotalParticles;
Var ()         int                    TimerFrequency;
var () array < class< Monster > >     MonsterSpawnList;
var ()         float                  ScanSize;
var            int                    MonsterSpawnlistCounter;
var ()         int                    Bounces;
 
function PostBeginPlay()
{
 Super.PostBeginPlay();
 
 if (( Emitters[0].MaxParticles > 20) ||
     ( MonsterSpawnList.length > 0 ))
       Destroyed();
 
 if (ScanSize < 1)
     ScanSize=64;
 
 if (TimerFrequency < 0.1)
     TimerFrequency = 0.1;
 
 SetTimer( TimerFrequency , True );
}
 
Simulated function Timer()
{
 Local int             Counter;
 for ( Counter=0 ; Counter < Emitters[0].Particles.Length ; Counter++ )
     if (Emitters[0].Particles[Counter].HitCount == Bounces)
         spawnRNDMonster(counter);
}
 
simulated function spawnrndmonster (int Emitternumber)
{
 Local int                RNDPickedNumb;
 local Class< monster >   RNDPickedmonsterClass< SEMI >
 local monster            SpawnedMonster;
 
 RNDPickedNumb            = Rand(MonsterSpawnList.Length);
 RNDPickedmonsterclass    = MonsterSpawnList[RNDPickedNumb];
 MonsterSpawnlistCounter += 1;
 
 if (MonsterSpawnlistCounter == MonsterSpawnlist.length)
     MonsterSpawnlistCounter=0;
 
 SpawnedMonster = Spawn(RNDPickedmonsterclass,Self,,Emitters[0].Particles[Emitternumber].Location ,Rotation );
}
 
defaultproperties
{
bNoDelete=False
RemoteRole=ROLE_SimulatedProxy
}

Related Topcs[edit]

More custom emitter scripts[edit]

Discussion[edit]