home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / Gameplay / Classes / ACTION_SpawnActor.uc < prev    next >
Text File  |  2003-12-11  |  874b  |  41 lines

  1. class ACTION_SpawnActor extends ScriptedAction;
  2.  
  3. var(Action)        class<Actor>    ActorClass;
  4. var(Action)        vector            LocationOffset;
  5. var(Action)        rotator            RotationOffset;
  6. var(Action)        bool            bOffsetFromScriptedPawn;
  7. var(Action)        name            ActorTag;
  8.  
  9. function bool InitActionFor(ScriptedController C)
  10. {
  11.     local vector loc;
  12.     local rotator rot;
  13.     local actor a;
  14.  
  15.     if ( bOffsetFromScriptedPawn )
  16.     {
  17.         loc = C.Pawn.Location + LocationOffset;
  18.         rot = C.Pawn.Rotation + RotationOffset;
  19.     }
  20.     else
  21.     {
  22.         loc = C.SequenceScript.Location + LocationOffset;
  23.         rot = C.SequenceScript.Rotation + RotationOffset;
  24.     }
  25.     a = C.Spawn(ActorClass,,,loc,rot);
  26.     a.Instigator = C.Pawn;
  27.     if ( ActorTag != 'None' )
  28.         a.Tag = ActorTag;
  29.     return false;    
  30. }
  31.  
  32. function string GetActionString()
  33. {
  34.     return ActionString@ActorClass;
  35. }
  36.  
  37. defaultproperties
  38. {
  39.     ActionString="Spawn actor"
  40. }
  41.