| Home Page | Recent Changes

VitalOverdose/SFX Ultralight

UT2004 :: Actor >> Emitter >>SFx_Ultralight (Package: custom)
 

by VitalOverdose

Part of Vital'sPMT

Overview

this custom emitter actor alters the weight of any vec its attached to. + Boost and FX

class SFx_Ultralight Extends VitalPMToolBox
placeable;

Var ()           bool                        bLockPlayersTo;
Var ()           float                       LandedLockTime;
Var ()           float                       TimerFrequency;
var ()           float                       ultralightTime;
Var (slide_in)   float                       slidein;
Var (slide_in)   Float                       IncSteps;
Var (slide_in)   Sound                       UltralightMax_Snd;
Var (slide_Out)  float                       Slidout;
Var (slide_Out)  float                       DecSteps;
Var (slide_Out)  Sound                       UltralightDec_Snd;
Var (OnCreation) bool                        bTagSuddenDeathFx;
Var (OnCreation) Sound                       OnCreation_Sound;
Var (OnCreation) Array< Class< Emitter > >   OnCreation_FxPool;
Var (suddenstop) sound                       SudenDeath_Sound;
var (suddenstop) Array< Class< Emitter > >   SudenDeath_FxPool;
Var bool                                     bScanningTargetVec;
Var Array< float >                           TimeKeeper;
Var float                                    Incamount;
Var float                                    DecAmount;

Function PostBeginPlay()
{
if (( base == none )&&(!Owner.IsA('OnsVehicle')))
    {
     Destroyed();
     Return;
    }
 SetBase( Owner );

If ((!OnsVehicle(Owner).Driver.IsA('xBot')) && ( bLockPlayersTo == false ))
    Return;

 TimeKeeper.Length = 4;
 TimeKeeper[0]     = slidein;
 TimeKeeper[1]     = ultralightTime;
 TimeKeeper[2]     = slidout;
 TimeKeeper[3]     = OnsVehicle(Owner).KGetActorGravScale();
 TogglelBotock();
 SetTimer(TimerFrequency,True);
}

Function Timer()
{
 if (vehicle(base).Driver == none)
    SuddenDeath()

 If (TimeKeeper[0] > 0 )
    {
     TimeKeeper[0]-=TimerFrequency;
     if (TimeKeeper[0]<0.1)
        SetTimer( TimeKeeper[1],False );
     Return;
   }

 if ( TimeKeeper[1] > 0 )
    {
     TimeKeeper[1] = 0;
     SetTimer(TimerFrequency,True);
     Return;
    }

 if ( TimeKeeper[2] > 0 )
    {
     TimeKeeper[2] -= TimerFrequency;
     if (TimeKeeper[2] < 0.1)
        Disable('Timer');
    }
}

function SuddenDeath()
{
 SpawnRND(SudenDeath_FxPool,bTagSuddenDeathFx);
 Disable('Timer');
 TogglelBotock();
}

Function SpawnRND(Array< Class< Emitter > > AvailableFx,Bool bTagFx)
{
 Local int              RNDPickedNumb;
 local Class< Emitter > RNDPickedEmitter;
 local Emitter          SpawnedEmitter;

 if ( AvailableFx.Length!=0 )
    {
    RNDPickedNumb  = Rand( AvailableFx.Length );
    RNDPickedEmitter = AvailableFx[RNDPickedNumb];
    SpawnedEmitter   = Spawn( RNDPickedEmitter , self ,, Owner.Location , Owner.Rotation );

    if ( ( SpawnedEmitter == none ) && ( bTagFx == True) )
       SpawnedEmitter.SetBase( Owner );
    }
}

Function TogglelBotock()
{
If ( OnsVehicle(Owner).bDriverCannotLeaveVehicle == False )
   {
    OnsVehicle(Owner).bDriverCannotLeaveVehicle = True;
    Return;
   }
 OnsVehicle(Owner).bDriverCannotLeaveVehicle = False;
}

Function Bool checkGrounded()
{
 Local Int counter;
 for ( counter=0 ; counter < OnsVehicle(Owner).wheels.Length ; counter++ )
     {
     If ( OnsVehicle(Owner).Wheels[counter].bWheelOnGround == False )
         return False;
     }
 Return True;
}

Discussion

Switch`: Rename this page to SFx_Ultralight

vitaloverdose: It was..


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