Cogito, ergo sum

Difference between revisions of "Legacy:VitalOverdose/ONSVehicleSpeedTrap"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
m
m
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
 
===Overview        ===
 
===Overview        ===
  
This custom class is a trigger that tests the speed of an ONSVehicle against a value set by the mapper in unrealed.
+
This custom class is a [[Legacy:Trigger|Trigger]] that tests the speed(velocity) of an [[Legacy:ONSVehicle|ONSVehicle]] against a value set by the mapper in unrealed.
  
 
===Method===
 
===Method===
Line 11: Line 11:
 
The test against the value set can be greater than or lesser than. Its a boolean variable (true/false) and is set to greater than as a default and can set by the mapper in unrealed.
 
The test against the value set can be greater than or lesser than. Its a boolean variable (true/false) and is set to greater than as a default and can set by the mapper in unrealed.
  
Once the condition has been me the ONSVehicleSpeedTrap will trigger itself, calling whatever is in its event field like any other trigger.  
+
Once the condition has been met the ONSVehicleSpeedTrap will trigger itself, calling whatever is in its event field like any other trigger.  
 
* Can Test For > or < lower than the speed set by the mapper.
 
* Can Test For > or < lower than the speed set by the mapper.
 
* Triggers self when condition is met.  
 
* Triggers self when condition is met.  
Line 17: Line 17:
 
====Note ====
 
====Note ====
  
Max speed for an RV is about 1000.  
+
Max speed for an Scorpion is about 1000.  
  
 
===The script===
 
===The script===
Line 23: Line 23:
 
<uscript>
 
<uscript>
 
//-----------------------------------------------------------
 
//-----------------------------------------------------------
//ONSVehicleSpeedTrap : a trigger based actor that tests the speed of a vehicle.
+
// ONSVehicleSpeedTrap : a trigger based actor that tests the speed of a vehicle.
//By VitalOverdose //http://WWW.VitalOverdose.com
+
// By VitalOverdose //http://WWW.VitalOverdose.com
//Updated Oct 2007
+
// Updated dec 2007
 
//-----------------------------------------------------------
 
//-----------------------------------------------------------
 
class ONSVehicleSpeedTrap extends Triggers;
 
class ONSVehicleSpeedTrap extends Triggers;
Line 51: Line 51:
 
}
 
}
 
</uscript>
 
</uscript>
 
====Easy to embed into a level====
 
 
This script can be downloaded here : [http://www.fataloverdose.copperstream.co.uk/files/protools/onsvehiclespeedtrap/MyLevel.u MyLevel.u] or [http://www.fataloverdose.copperstream.co.uk/files/protools/onsvehiclespeedtrap/ONSVehicleSpeedTrap.uc ONSVehicleSpeedTrap.uc]
 
  
 
===Related===
 
===Related===
 
+
*[[Legacy:Vehicles|Vehicles]]
[[Legacy:Vehicle|Vehicle]]
+
*[[Legacy:ONSVehicle|ONSVehicle]]
 
+
*[[Legacy:VitalOverdose/AllMapVehicleFactory | AllMapVehicleFactory]]
[[Legacy:ONSVehicle|ONSVehicle]]
+
*[[Legacy:VitalOverdose/QuickVehicleSpawner | QuickVehicleSpawner]]
 
+
*[[Legacy:VitalOverdose/ONSVehicleTeleporter | ONSVehicleTeleporter]]
[[Legacy:VitalOverdose/ONSVehicleFXTagger | ONSVehicleFXTagger]]
+
*[[Legacy:VitalOverdose/ONSVehicleBooster | ONSVehicleBooster]]
 
+
*[[Legacy:VitalOverdose/ONSVehicleEjectionTrigger | ONSVehicleEjectionTrigger]]
[[Legacy:VitalOverdose/ONSVehicleBooster|VitalOverdose/ONSVehicleBooster]]
+
*[[Legacy:VitalOverdose/ONSVehicleFXTagger | ONSVehicleFXTagger]]
 
+
[[Legacy:VitalOverdose/QuickVecSpawner | QuickVecSpawner]]
+
 
+
[[Legacy:VitalOverdose/BoostingVehicleFactory | BoostingVehicleFactory]]
+
  
 
==Discussion==
 
==Discussion==
 
[[Category:Legacy Custom Class (UT2004)|{{PAGENAME}}]]
 
[[Category:Legacy Custom Class (UT2004)|{{PAGENAME}}]]

Latest revision as of 06:22, 14 September 2011

UT2004 :: Actor >> Triggers >> ONSVehicleSpeedTrap (Package: custom)

by VitalOverdose

Overview[edit]

This custom class is a Trigger that tests the speed(velocity) of an ONSVehicle against a value set by the mapper in unrealed.

Method[edit]

The test against the value set can be greater than or lesser than. Its a boolean variable (true/false) and is set to greater than as a default and can set by the mapper in unrealed.

Once the condition has been met the ONSVehicleSpeedTrap will trigger itself, calling whatever is in its event field like any other trigger.

  • Can Test For > or < lower than the speed set by the mapper.
  • Triggers self when condition is met.

Note[edit]

Max speed for an Scorpion is about 1000.

The script[edit]

//-----------------------------------------------------------
// ONSVehicleSpeedTrap : a trigger based actor that tests the speed of a vehicle.
// By VitalOverdose //http://WWW.VitalOverdose.com
// Updated dec 2007
//-----------------------------------------------------------
class ONSVehicleSpeedTrap extends Triggers;
 
var () float  TestSpeed;
var () bool   bLessThan;
 
// Generic function : overwriting
function Touch(actor other)
{
 local float      VehicleVelocity;
 local ONSVehicle VehicleToTest;
 
 if (!other.isa('ONSVehicle'))
     return;
 
 VehicleToTest   = ONSVehicle(Other);
 VehicleVelocity = Vsize(VehicleToTest.Velocity);
 
 if (((bLessThan == true) && (VehicleVelocity < TestSpeed)) ||
    ((bLessThan == false) && (VehicleVelocity > TestSpeed)))
      Triggerevent(event,self,instigator);
 
Super.Touch(Other);   // all the code from the parent function of the same name is added in here
}

Related[edit]

Discussion[edit]