| Home Page | Recent Changes

Fyfe/PawnFactory

UT2004 :: Actor >> PawnFactory (Custom)

A generic factory for spawning pawns. The pawns need to be a sub-class of AnotherPawn.

NOTE: If your looking for a factory for vehicles check out Engine.SVehicleFactory

Properties

Main

bool bEnabled
Factory is enabled by default.
class<AnotherPawn> PawnClass
The pawn to spawn.
int MaxPawnCount
The max number of pawns this factory can create.

Hidden

int PawnCount
The current number of pawns this factory has created.

Events

PawnCreated( AnotherPawn Pawn )
Called by the factory when a pawn is created.
PawnDestroyed( AnotherPawn Pawn )
Called by the pawn when it's destroyed.
Trigger( Actor Other, Pawn EventInstigator )
Spawns a new pawn if PawnClass is set and we haven't reached the MaxPawnCount.

Code

 >>

Related Topics

Discussion

fyfe: Nothing overly fancy or original, it's based off of Engine.SVehicleFactory.

fyfe: Added PawnCreated(), and added some code to set bEnabled to false while PawnCount == MaxPawnCount or if PawnClass isn't set.


Category Custom Class

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

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