| Home Page | Recent Changes

V2VecBooster

UT2004 :: Actor >> Trigger >> VecBooster >> V2VecBooster (Package: custom) - works online.

by VitalOverdose

Part of Vital'sPMT

Overview

One of the main problems with the VecBooster is that a sudden kick scares any bot drivers and they instantly bail from the vehicle. One way around this is to use the property bDriverCannotLeaveVehicle to lock them inside the vehicle untiluntil they calm down a little.

//     class VecBooster
//
// kicks ANY Vehicle.
//
// By FatalOverdose (c) 2005 www.fataloverdose.copperstream.co.uk
// 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 V2VecBooster extends trigger
placeable;

struct                            VecRec
{
var OnsVehicle                    VecRef;
var float                         RecTime;
};var array< VecRec >             Tracking;

Var() float                       Capturetime;
var   float                       TimerFrequency;

simulated function Touch( Actor Other )
{
super.touch(Other);
EnterVecRec(onsvehicle(other));
}                                          //the Vehicle that touched it

simulated function EnterVecRec(OnsVehicle NewVec)
{
 Tracking.insert(0,1);
 NewVec.bDriverCannotLeaveVehicle = true;
 Tracking[0].VecRef               = NewVec;
 Tracking[0].RecTime              = -1;
 if (Tracking.length==1)
     SetTimer(TimerFrequency,false);        // set timer to repeatedly be called every 'timerfrequncy'
}                                     // length of time untill shut off.

function Timer()
{
 local Int I;
 for (i=0 ; i < Tracking.length ; I++)
     {
     IF (Tracking[i].VecRef == None)
        {
         Tracking.remove(i , 1);
         i -= 1;
        }
     else
    if (Tracking[i].RecTime <= 0)
        {
         Tracking[i].RecTime += TimerFrequency;
         if ((Tracking[i].RecTime == 0 ) && ( Tracking[i].VecRef.bVehicleOnGround))
         Tracking[i].RecTime = Capturetime;
         }
     else
     if (Tracking[i].RecTime > 0)
         {
         Tracking[i].RecTime -= TimerFrequency;
         if ( Tracking[i].RecTime < 0 )

            {
             Tracking[i].VecRef.bDriverCannotLeaveVehicle = false;
             Tracking.remove(i , 1);
             i -= 1;
            }
         }
     }
 if (Tracking.length != 0 )
     SetTimer(TimerFrequency , false);
}

defaultproperties
{
     TimerFrequency = 0.1
}

Related Topics

VitalOverdose/VecBooster

VitalOverdose/VehicleTeleporter

VitalOverdose/RandomRelocator


Discussion

SuperApe: So you are clearly aware of why I'm personally confused by code and code pages like this, I will leave these observations: 1) You have made a vehicle booster actor from Trigger instead of something similar like JumpPad. 2) You chose to redefine the relevant Trigger functions; you have a TimerFrequency property defined, but never modified or modifyable, that seems to duplicate the job of the ReTriggerDelay property in the Trigger class. 3) In your code comments, it says it works on any vehicle, yet I can see in the code it only affects ONSVehicle classes. 4) This code does not boost vehicles. I believe you meant to define this as a subclass of your VecBooster custom actor, but it is a subclass of Trigger. Without that, this code has no KAddImpulse function. So you have obviously not compiled and tested this code. 5) It appears by your class overview that you have made a whole new class based off of your original custom actor in order to fix a bug that makes bots jump out, instead of fixing the original. 6) If this is a work in progress, you have not said so anywhere on this page. 7) You are still not creating pages that fall in line with the standard wiki page formatting. I don't think I'm the only one who has wondered why your contributions the wiki fail to meet basic standards of wiki etiquette and programming logic.

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