UE2:TeamVehicleFactory

From Unreal Wiki, The Unreal Engine Documentation Site
UE2 SVehicleFactory >> Actor >> TeamVehicleFactory (custom)


This custom actor really duplicates much of the functionality of the ONSVehicleFactory subclasses, but the big feature is that nearly any vehicle class can be spawned. Although this actor cannot display the selected vehicle class in the editor, it does offer added controls that mappers for VCTF or other vehicle gametypes might want.

Features

  • The ability to spawn random vehicles from a list of vehicle classes
  • The ability to spawn nearly any vehicle class in gametypes that allow vehicles
  • The ability to trigger PreSpawn and (Post)Spawn events
  • The option to allow the vehicle to spawn over and crush other actors
  • The option to use this as either a triggerable or an automatic (timed) vehicle factory.
  • Greater control over spawn timing

Notes

  • If you use a TeamVehicleFactory "as is" in your custom map, please credit me in the readme file of the map. (SuperApe)
  • You have to supply spawning effects and sounds, via ScriptedTrigger, Emitter and the like. This is meant to allow flexibilty in the ways you want vehicles to spawn. An example VCTF map posted on this UP Forum thread gives my suggestion for spawning particles and sound. (It appears similar to pickup spawning.)
  • With bAutoSpawn on and without a PreSpawnTime of around 2 seconds, you run the risk of spawning a vehicle before headlights can be properly spawned at map start. Subsequent vehicles after map start will spawn headlights normally.
  • Turrets that are spawned automatically get an AIController. They are auto turrets; firing at enemies, or if set to neutral (team 255), firing at any non-neutral controlled pawn it detects.
  • The AS Spacefighters are spawned with a minimum velocity that makes them impractical to use. However, a custom launcher for these is easy to make with a TryToDrive() function.
  • This has a slightly larger bBlocked check radius than ONSVehicleFactory. ( 1.33 : 1.25 )

Properties

Main

int TeamNum
Team Number to be set on spawn. 0= red, 1= blue, 255= neutral / none
bool bPlayerControl
Only player instigators can trigger.
bool bAutoSpawn
Will spawn at regular intervals. The triggering ability is disabled.
int RespawnTime
Interval to wait before AutoSpawning.
name PreSpawnEvent
Event to trigger before spawn.
int PreSpawnTime
Time before spawn to trigger event. Will begin event this many seconds before the factory is set to AutoSpawn.
name SpawnEvent
Event to trigger after spawn. A post spawn event.
bool bCrushable
Allow spawning over colliding actors. Note: Turrets will normally spawn in collision with other actors, spawned vehicles will generally move out of the way.
int RetrySpawnTime
Interval to wait if bBlocked.
bool bRandomFlip
Neutral vehicles may face backwards.
bool bRandomSpawn
Will spawn random vehicle class.
struct class<Vehicle> SpawnedVehicle
Selected random vehicle class.
array<SpawnedVehicle> RandomVehicles
List for random vehicle spawn.

Hidden

bool bWaiting
Waiting to spawn.
int FactoryTime
Time last spawn. (in Level.TimeSeconds)
bool bPreSpawn
Should trigger PreSpawnEvent next.

Code

<uscript>

External Links

  • Mapping for VCTF – A thread on UnrealPlayground that includes a test map using this actor and suggested spawn EFX.

Related Topics