home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Engine / Classes / SVehicleFactory.uc < prev    next >
Text File  |  2004-03-04  |  1KB  |  50 lines

  1. #exec Texture Import File=Textures\S_KVehFact.pcx Name=S_KVehFact Mips=Off MASKED=1
  2.  
  3. //=============================================================================
  4. // SVehicle spawner location.
  5. //=============================================================================
  6. class SVehicleFactory extends Actor 
  7.     placeable;
  8.  
  9. var()    class<SVehicle>        VehicleClass;
  10. var()    int                    MaxVehicleCount;
  11.  
  12. var        int                    VehicleCount;
  13.  
  14. event Trigger( Actor Other, Pawn EventInstigator )
  15. {
  16.     local SVehicle CreatedVehicle;
  17.  
  18.     if(VehicleClass == None)
  19.     {
  20.         Log("SVehicleFactory:"@self@"has no VehicleClass");
  21.         return;
  22.     }
  23.  
  24.     if(!EventInstigator.IsA('Pawn') || (EventInstigator.IsA('Pawn') && EventInstigator.IsA('SVehicle')) )
  25.         return;
  26.  
  27.     if(VehicleCount >= MaxVehicleCount)
  28.     {
  29.         // Send a message saying 'too many vehicles already'
  30.         return;
  31.     }
  32.  
  33.     if(VehicleClass != None)
  34.     {
  35.         CreatedVehicle = spawn(VehicleClass, , , Location, Rotation);
  36.         VehicleCount++;
  37.         CreatedVehicle.ParentFactory = self;
  38.     }
  39. }
  40.  
  41.  
  42. defaultproperties
  43. {
  44.     MaxVehicleCount=1
  45.     bHidden=true
  46.     Texture=S_KVehFact
  47.     RemoteRole=ROLE_None
  48.     bNoDelete=True
  49.     bDirectional=true
  50. }