I don't need to test my programs. I have an error-correcting modem.

UE2:PawnFactory

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 14:41, 1 April 2008 by DalinSeivewright (Talk | contribs) (Moved Legacy Custom Class)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
The classbox template is only supposed to be used by the converted content imported into the Legacy: namespace. Consider adding descriptions to existing class pages instead.

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

Notes

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.