Cogito, ergo sum

Difference between revisions of "Legacy:VitalOverdose/Wormhole"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
m
 
m
(One intermediate revision by one other user not shown)
Line 2: Line 2:
  
 
by [[Legacy:VitalOverdose|VitalOverdose]]
 
by [[Legacy:VitalOverdose|VitalOverdose]]
 +
 +
Part of  [[Legacy:VitalOverdose/Vital'S Pro Mapping Tools| Vital'sPMT]]
  
 
<Uscript>
 
<Uscript>
Line 8: Line 10:
  
 
// Wormhole By vitaloverdose, Feb 2006, http://www.Vitaloverdose.com
 
// Wormhole By vitaloverdose, Feb 2006, http://www.Vitaloverdose.com
 +
 +
// This is part of the 'Vitals Pro Mapping Tools' Mod
 +
 +
// Full class list http://wiki.beyondunreal.com/wiki/Vital's_Pro_Mapping_Tools
 +
 +
// Direct Download the Mod in zipped format Http://promappingtools.zapto.org
  
 
//=============================================================================
 
//=============================================================================
Line 48: Line 56:
 
  SpawnFx( Self.Location , AmbiantFxPool  , Self );
 
  SpawnFx( Self.Location , AmbiantFxPool  , Self );
 
  If ( ( bScanDest == False ) && ( (AmbiantFxpool.Length <= 0 ) || ( ReScanDelay <= 0 )) )
 
  If ( ( bScanDest == False ) && ( (AmbiantFxpool.Length <= 0 ) || ( ReScanDelay <= 0 )) )
 +
    {
 
     Return;
 
     Return;
 
+
    }
 
  SetTimer(ReScanDelay,True);
 
  SetTimer(ReScanDelay,True);
  
Line 59: Line 68:
 
  Local Actor FoundTelPoint;
 
  Local Actor FoundTelPoint;
 
  if (TpAct.Length>0)
 
  if (TpAct.Length>0)
 +
    {
 
     TpAct.Remove(0,TpAct.Length);
 
     TpAct.Remove(0,TpAct.Length);
   
+
    }
 
+
  foreach AllActors( Class'Actor' , FoundTelPoint,'TP' )
foreach AllActors( Class'Actor' , FoundTelPoint,'TP' )
+
 
                   {
 
                   {
 
                   TpAct.Insert(0,1);
 
                   TpAct.Insert(0,1);
Line 74: Line 83:
 
{
 
{
 
  if (Other.IsA('Vehicle'))
 
  if (Other.IsA('Vehicle'))
 +
    {
 
     Vectel(vehicle(Other));
 
     Vectel(vehicle(Other));
 +
    }
 
  else
 
  else
 
  if ( Other.IsA('pawn'))
 
  if ( Other.IsA('pawn'))
 +
    {
 
     TPort(Pawn(Other));
 
     TPort(Pawn(Other));
 +
    }
  
 
}
 
}
Line 145: Line 158:
  
 
  if ( (SpawnedFx != none ) && ( Hardattachedto != none ) )
 
  if ( (SpawnedFx != none ) && ( Hardattachedto != none ) )
 +
    {
 
     SpawnedFx.SetBase( Hardattachedto );
 
     SpawnedFx.SetBase( Hardattachedto );
 +
    }
  
 
}
 
}
Line 168: Line 183:
  
 
       foreach radiusActors( Class'pawn' , Foundpawn , ScanRadius , SafeSpawnactor.location )
 
       foreach radiusActors( Class'pawn' , Foundpawn , ScanRadius , SafeSpawnactor.location )
 +
                          {
 
                           if ( ( Foundpawn != Self ) && ( Foundpawn.bCollideActors == True ) )
 
                           if ( ( Foundpawn != Self ) && ( Foundpawn.bCollideActors == True ) )
 +
                              {
 
                               SafeSpawnactor =none;
 
                               SafeSpawnactor =none;
 +
                              }
 +
                          }
 
       return SafeSpawnactor;
 
       return SafeSpawnactor;
 
     }
 
     }
Line 190: Line 209:
 
       Teleporting.IsA('ONSHoverCraft')    ||
 
       Teleporting.IsA('ONSHoverCraft')    ||
 
       Teleporting.IsA('ONSPlaneCraft'))
 
       Teleporting.IsA('ONSPlaneCraft'))
 +
    {
 
     Teleporting.KSetStayUpright( true , true );
 
     Teleporting.KSetStayUpright( true , true );
 +
    }
  
 
  if ( bDirectional )
 
  if ( bDirectional )
 +
    {
 
     RotRelation = Self;
 
     RotRelation = Self;
 +
    }
 
  else
 
  else
 +
  {
 
     RotRelation = Teleporting;
 
     RotRelation = Teleporting;
 +
  }
 
  Vehicle(Teleporting).KAddImpulse( ActualBoostForce >> RotRelation.rotation , PointOfBoostFoce >> RotRelation.rotation );
 
  Vehicle(Teleporting).KAddImpulse( ActualBoostForce >> RotRelation.rotation , PointOfBoostFoce >> RotRelation.rotation );
  
 
  if ( TeleportSound != None )
 
  if ( TeleportSound != None )
 +
    {
 
     PlaySound( TeleportSound );
 
     PlaySound( TeleportSound );
 +
    }
  
 
}
 
}
  
 
</Uscript>
 
</Uscript>
 +
 +
  
 
==Related topics==
 
==Related topics==
*[[Legacy:Vehicle|Vehicle]]
+
 
*[[Legacy:ONSVehicle|ONSVehicle]]
+
[[Legacy:VitalOverdose/VehicleTeleporter|VitalOverdose/VehicleTeleporter]]
*[[Legacy:VitalOverdose/ONSVehicleTeleporter | ONSVehicleTeleporter]]
+
 
*[[Legacy:VitalOverdose/RandomRelocator | RandomRelocator]]
+
[[Legacy:VitalOverdose/RandomRelocator|VitalOverdose/RandomRelocator]]
 +
 +
  
 
==Discussion==
 
==Discussion==
  
[[Category:Legacy Custom Class (UT2004)|{{PAGENAME}}]]
+
[[Category:Legacy Custom Class|{{PAGENAME}}]]

Revision as of 11:14, 15 June 2006

UT2004 :: Actor >> Trigger >> Wormhole (Package: custom)

by VitalOverdose

Part of Vital'sPMT

//=============================================================================
 
// Wormhole By vitaloverdose, Feb 2006, http://www.Vitaloverdose.com
 
// This is part of the 'Vitals Pro Mapping Tools' Mod 
 
// Full class list http://wiki.beyondunreal.com/wiki/Vital's_Pro_Mapping_Tools
 
// Direct Download the Mod in zipped format Http://promappingtools.zapto.org
 
//=============================================================================
 
class Wormhole Extends Trigger
 
placeable;
 
var    Array<Actor>                 TpAct;
 
Var () Array< Class< Emitter > >    VecTagFxPool;
 
Var () Array< Class< Emitter > >    AmbiantFxPool;
 
Var () Array< Class< Emitter > >    TeleportFxPool_Vec;
 
Var () Array< Class< Emitter > >    TeleportFxPool_Self;
 
Var () Sound                        TeleportSound;
 
Var () Emitter                      SpawnedAmbiantFx;
 
var () Emitter                      SpawnedVecFx;
 
Var () bool                         bScanDest;
 
var () bool                         bPlayTelePortEffect;
 
Var () float                        ReScanDelay;
 
Var () float                        SafeSpawnlocScanRadius;
 
Var () Vector                       ActualBoostForce;
 
Function PostBeginPlay()
 
{
 ScanTpAct();
 
 SpawnFx( Self.Location , AmbiantFxPool  , Self );
 If ( ( bScanDest == False ) && ( (AmbiantFxpool.Length <= 0 ) || ( ReScanDelay <= 0 )) )
    {
     Return;
    }
 SetTimer(ReScanDelay,True);
 
}
 
Simulated Function ScanTpAct()
 
{
 Local Actor FoundTelPoint;
 if (TpAct.Length>0)
    {
     TpAct.Remove(0,TpAct.Length);
    }
 foreach AllActors( Class'Actor' , FoundTelPoint,'TP' )
                  {
                   TpAct.Insert(0,1);
                   TpAct[0] = FoundTelPoint;
                   }
 
}
 
Function Touch( Actor Other)
 
{
 if (Other.IsA('Vehicle'))
    {
     Vectel(vehicle(Other));
    }
 else
 if ( Other.IsA('pawn'))
    {
     TPort(Pawn(Other));
    }
 
}
 
Simulated function  TPort( Pawn TPPawn )
 
{
 local actor SafeSpawnactor;
 
 SafeSpawnactor=FindSafeSpawnLoc(SafeSpawnlocScanRadius);
 
 TPPawn.SetLocation( SafeSpawnactor.Location);
 TPPawn.SetRotation( SafeSpawnactor.Rotation );
 TPPawn.OldRotYaw  = TPPawn.Rotation.Yaw;
 
}
 
Simulated Function Vectel(Pawn PTele)
 
{
 Local EPhysics     Entryphysics;
 Local Vehicle      Teleporting;
 local Rotator      OldRot;
 Local Rotator      NewRot;
 local actor        SafeSpawnactor;
 
 Teleporting      = Vehicle(pTele);
 NewRot           = Teleporting.Rotation;
 EntryPhysics     = Teleporting.Physics;
 ActualBoostForce = Teleporting.Velocity * 500;
 
 Teleporting.SetPhysics(PHYS_None);
 SafeSpawnactor=FindSafeSpawnLoc(SafeSpawnlocScanRadius);
 
 if ( SafeSpawnactor != none )
    {
     Teleporting.SetLocation(SafeSpawnactor.location);
     oldRot       = Teleporting.Rotation;
     NewRot.Yaw   = SafeSpawnactor.Rotation.Yaw + Teleporting.Rotation.Yaw - Self.Rotation.Yaw;
     posttel(Teleporting  , Newrot , EntryPhysics );
    }
 
}
 
function Timer()
 
{
 ScanTpAct();
 
}
 
Simulated Function  SpawnFx( Vector SpawnPos ,Array< Class< Emitter > > FxSpawnpool, Actor Hardattachedto )
 
{
 Local int            PickedNumb;
 local Class<Emitter> ChosenFxClass< SEMI >
 local Emitter        SpawnedFx;
 
 if ( FxSpawnpool.Length <= 0 )
    {
     PickedNumb    = FxSpawnpool.Length;
     PickedNumb    = Rand(PickedNumb);
     ChosenFxClass = FxSpawnpool[PickedNumb];
    }
 
 SpawnedFx = Spawn( ChosenFxClass , self , , SpawnPos , Rotation );
 
 if ( (SpawnedFx != none ) && ( Hardattachedto != none ) )
    {
     SpawnedFx.SetBase( Hardattachedto );
    }
 
}
 
Function actor FindSafeSpawnLoc( float ScanRadius )
 
{
 local pawn         Foundpawn;
 local Array<Actor> TempTpAct;
 Local Int          Counter;
 Local int          PickedRNDNo;
 local actor        SafeSpawnactor;
 
 TempTpAct.Length  = tpact.Length;
 TempTpAct         = TpAct;
 
 for ( Counter=0;Counter<tpact.Length;Counter++)        //here i want to pick Numbs at Random from a list
     {                                                 //First west up the Numbs in sequential order and then
      PickedRNDNo   = Rand( tempTpAct.Length -1 )+1;        //pick a RND No based on the Length of the list.Once Picked
      SafeSpawnactor  = tempTpAct[PickedRNDNo];      //the Numb is removed from the list and anOther Numb is pick
      tempTpAct.remove( PickedRNDNo ,1 );              //is Picked based on the new Length of the list
 
      foreach radiusActors( Class'pawn' , Foundpawn , ScanRadius , SafeSpawnactor.location )
                          {
                           if ( ( Foundpawn != Self ) && ( Foundpawn.bCollideActors == True ) )
                              {
                               SafeSpawnactor =none;
                              }
                           }
      return SafeSpawnactor;
     }
 
}
 
Simulated function Posttel( Pawn Teleporting , Rotator Newrot , EPhysics EntryPhysics )
 
{
 local Vector PointOfBoostFoce;
 local Actor  RotRelation;;
 
 Teleporting.SetPhysics( EntryPhysics );
 Teleporting.Controller.moveTimer = -1.0;
 Teleporting.SetmoveTarget( Self );
 Teleporting.Controller.SetRotation( NewRot );
 Teleporting.SetRotation( NewRot );
 
 if ( Teleporting.IsA('ONSChopperCraft')  ||
      Teleporting.IsA('ONSHoverCraft')    ||
      Teleporting.IsA('ONSPlaneCraft'))
    {
     Teleporting.KSetStayUpright( true , true );
    }
 
 if ( bDirectional )
    {
     RotRelation = Self;
    }
 else
   {
    RotRelation = Teleporting;
   }
 Vehicle(Teleporting).KAddImpulse( ActualBoostForce >> RotRelation.rotation , PointOfBoostFoce >> RotRelation.rotation );
 
 if ( TeleportSound != None )
    {
     PlaySound( TeleportSound );
    }
 
}


Related topics

VitalOverdose/VehicleTeleporter

VitalOverdose/RandomRelocator


Discussion