| Home Page | Recent Changes

VitalOverdose/VecBooster

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

by VitalOverdose

Part of Vital'sPMT

Overview

The VecBooster uses one of the generic properties of the trigger bDirectionalto set the direction that any touching vecs will be boosted.If left at the default setting of false then the vec will be boosted in whatever direction it is traveling at the the time it makes contact with the vec booster. I set to true thec vec will be boosted in whichever direction the Vehicle booster is facing. As the vec booster cant move at all this of course will be the same every time.

The script works by using the 'KAddImpulse()' function thats built into every vehicle. KaddImpulse() only delivers force not damage so its quite safe to give the vec a good boost.

Note:

There are a few things to consider when using a vec booster in a level. The max speed of the Vehicles is set at 2500..and this is for a good reason.anything faster you have a good chance of getting stuck in Any meshes you collide with. Avoid using them in areas with trees or lamppost's and back up the collision on any nearby meshes with blocking volumes to be sure.

//     class vecbooster
//
// kicks ANY vehicle.
//
// By VitalOverdose
// optional vocal's(just remove sound to disable in unrealed)
// booster will boost the vehicle in the direction hes facing
// unless the directional option is set to true
//-----------------------------------------------------------

class vecbooster extends Trigger
placeable;

Var() vector                      AppliedBoostForce;
var() sound                       VocBoost;

function Touch( Actor Other )
{
 local vehicle vec;
 vec = vehicle( other );                    //typecasts other to vehicle
 if (vec == none) return;                   //use the typcasted variable to check 4 a vec
 VecBoost(Vec);                             //calls vecboost and passes the valid ref
}                                          //the vehicle that touched it

simulated function  VecBoost( vehicle theVec)
{
 local Vector PointOfBoostForce;    //PointOfBoostForce defaults to(0,0,0) center of the vec                                               //point of boost force
 local actor  rotrelation;
 
 rotrelation = thevec;             // will kick the vec in the diection its facing
 
 if ( VocBoost!= None )
      Playsound ( VocBoost) ;      //sound fx

 if ( bDirectional)               // if bdirectional is true: kick vec in direction this actor
     rotrelation = self;          // ia facing

 theVec.KAddImpulse( AppliedBoostForce >> theVec.Rotation, PointOfBoostForce >> theVec.Rotation ) ;
}

defaultproperties
{
     AppliedBoostForce=(X=9000000.000000)
     VocBoost=Sound'AnnouncerEvil.Booster'
     Texture=Texture'XEffectMat.Shock.Shock_ring_a'
     CollisionRadius=150.000000
     CollisionHeight=150.000000
}

Tested:Works Online.

Related Topics

VitalOverdose/VecBooster

VitalOverdose/VehicleTeleporter

VitalOverdose/RandomRelocator

 

 

Discussion

Category Custom Class

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In