home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Level Design
/
GLDesign.bin
/
Software
/
UnrealEngine2Runtime
/
UE2Runtime-22262001_Demo.exe
/
Engine
/
Classes
/
SVehicleFactory.uc
< prev
next >
Wrap
Text File
|
2004-03-04
|
1KB
|
50 lines
#exec Texture Import File=Textures\S_KVehFact.pcx Name=S_KVehFact Mips=Off MASKED=1
//=============================================================================
// SVehicle spawner location.
//=============================================================================
class SVehicleFactory extends Actor
placeable;
var() class<SVehicle> VehicleClass;
var() int MaxVehicleCount;
var int VehicleCount;
event Trigger( Actor Other, Pawn EventInstigator )
{
local SVehicle CreatedVehicle;
if(VehicleClass == None)
{
Log("SVehicleFactory:"@self@"has no VehicleClass");
return;
}
if(!EventInstigator.IsA('Pawn') || (EventInstigator.IsA('Pawn') && EventInstigator.IsA('SVehicle')) )
return;
if(VehicleCount >= MaxVehicleCount)
{
// Send a message saying 'too many vehicles already'
return;
}
if(VehicleClass != None)
{
CreatedVehicle = spawn(VehicleClass, , , Location, Rotation);
VehicleCount++;
CreatedVehicle.ParentFactory = self;
}
}
defaultproperties
{
MaxVehicleCount=1
bHidden=true
Texture=S_KVehFact
RemoteRole=ROLE_None
bNoDelete=True
bDirectional=true
}