XIDMaps
Class CableStart

source: C:\XIII\XIDMaps\Classes\CableStart.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Keypoint
         |
         +--XIDMaps.CableStart
Direct Known Subclasses:None

class CableStart
extends Engine.Keypoint

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 int Count
 float Delay
 CableEnd EndCable
 CableLink MyLink

States
FreeCable
State FreeCable Function Summary



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class CableStart extends Keypoint;
00005	
00006	var() CableEnd EndCable;
00007	var CableLink MyLink;
00008	var transient int Count;
00009	var transient float Delay;
00010	
00011	//_____________________________________________________________________________
00012	event PostBeginPlay()
00013	{
00014	    if ( EndCable == none )
00015	    {
00016	      Log("### "$self$" destroying because CableEnd not initialized");
00017	      destroy();
00018	    }
00019	    Super.PostBeginplay();
00020	    MyLink = spawn(class'CableLink',self,,Location + (class'CableLink'.Default.LinkLength/2.0) * Normal(EndCable.Location - Location), rotator(EndCable.Location - Location));
00021	    if ( MyLink != none )
00022	    {
00023	      MyLink.StartPoint = self;
00024	      MyLink.EndPoint = EndCable;
00025	      MyLink.CreateNextLink();
00026	    }
00027	    else
00028	    {
00029	      Log("### "$self$" destroying because MyLink could not be spawned");
00030	      destroy();
00031	    }
00032	}
00033	
00034	//_____________________________________________________________________________
00035	event Trigger(Actor Other, Pawn EventInstigator)
00036	{
00037	    Log("### "$self$" Trigger");
00038	    Tag='ShoudNotBeTriggeredAgain';
00039	    GotoState('FreeCable');
00040	}
00041	
00042	//_____________________________________________________________________________
00043	State FreeCable
00044	{
00045	    event BeginState()
00046	    {
00047	      Count = 0;
00048	      Delay = 0.0;
00049	    }
00050	    event Tick(float dT)
00051	    {
00052	      Count ++;
00053	      if ( Count%4 == 0)
00054	        MyLink.FreeMove(dT*4);
00055	      Delay += dT;
00056	      if ( Delay > 10.0 )
00057	        GotoState('');
00058	    }
00059	}
00060	
00061	//_____________________________________________________________________________
00062	event Destroyed()
00063	{
00064	    MyLink.Destroy();
00065	}
00066	
00067	
00068	
00069	defaultproperties
00070	{
00071	     bStatic=False
00072	}

End Source Code