| Home Page | Recent Changes | Preferences

VitalOverdose/SFX MonsterSpawning

UT2004 :: Actor >> Emitter >> SFX_MonsterSpawning (Package: custom)
 

by VitalOverdose

Part of Vital'sPMT

Overview

class SFx_MonsterSpawning 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;
 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 );
}

Related Topcs

Discusion


Category Custom Class

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In