There is no spoon

Difference between revisions of "Legacy:Fyfe/PawnFactory"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
 
(Added PawnCreated(), and added some code to set bEnabled to false while PawnCount == MaxPawnCount or if PawnClass isn't set.)
Line 142: Line 142:
 
'''fyfe:''' Added <code>PawnCreated()</code>, and added some code to set <code>bEnabled</code> to false while <code>PawnCount == MaxPawnCount</code> or if <code>PawnClass</code> isn't set.
 
'''fyfe:''' Added <code>PawnCreated()</code>, and added some code to set <code>bEnabled</code> to false while <code>PawnCount == MaxPawnCount</code> or if <code>PawnClass</code> isn't set.
  
[[Category:Legacy Custom Class (UT2004)|{{PAGENAME}}]]
+
[[Category:Legacy Custom Class|{{PAGENAME}}]]

Revision as of 16:36, 11 October 2006

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.