Legacy:VitalOverdose/SFXBoosting
<Uscript>
class SFx_Boosting Extends Emitter
placeable;
struct VecRec
{
var OnsVehicle VevRef; Var float RecTime;
};Var Array< VecRec > Tracking;
var bool bTracking;
var int TotalParticles;
var () float CaptureTime;
Var () int ActiveEmitterNumb;
Var () int TimerFrequency;
Var () float ScanSize;
Var (Boost) bool bCuasesBoost_Player;
Var (Boost) bool bLocks_Player;
Var (Boost) bool bCuasesBoost_Bot;
Var (Boost) bool bbLocks_Bot;
var (Boost) sound VocBoost;
var (boost) vector AppliedBoostForce;
Simulated Function PostBeginPlay()
{
if ( Emitters[ActiveEmitterNumb].MaxParticles > 10) Destroyed(); if (AppliedBoostForce == Vect(0,0,0)) AppliedBoostForce.X=9000000.000000;
Super.PostBeginPlay();
}
Function tick(Float deltaTime)
{
local ONSvehicle FoundONSvec; Local Int Counter;
for ( Counter=0 ; Counter < Emitters[0].Particles.Length ; Counter++ ) { foreach visiblecollidingActors(Class'ONSvehicle', FoundONSvec , ScanSize , Emitters[ActiveEmitterNumb].Particles[Counter].Location ) { VecBoost(FoundONSvec); } }
}
Simulated Function VecBoost( OnsVehicle TheVec )
{
Local Vector PointOfBoostForce; //PointOfBoostForce defaults to(0,0,0) center of the vec Local Actor RotRelation; //point of boost force
EnterVecRec( TheVec ); if ( bDirectional) RotRelation = self ; else RotRelation = TheVec;
TheVec.KAddImpulse( AppliedBoostForce >> RotRelation.Rotation, PointOfBoostForce >> RotRelation.Rotation ) ;
}
Function enterVecRec( ONSVehicle NewVec )
{
Tracking.insert(0,1); Tracking[0].VevRef = NewVec; Tracking[0].RecTime = CaptureTime;
if ( Tracking.Length != 1 ) Return; // check to see if the Array was previously empty
if ( NewVec.Driver.IsA('xBot')) NewVec.bDriverCannotLeaveVehicle= True;
If (bTracking == false ) { bTracking = True; SetTimer(TimerFrequency,True); // set Timer to repeatedly be called every 'Timerfrequncy' }
} // Length of Time untill shut off.
Function Timer()
{
Local Int Counter; for ( Counter=0; Counter<Tracking.Length; Counter++ ) { Tracking[Counter].recTime -= TimerFrequency; if (Tracking[Counter].recTime<TimerFrequency) { Tracking[Counter].VevRef.bDriverCannotLeaveVehicle = False ; Tracking.remove( Counter , 1); if (Tracking.Length==0) { bTracking = False; disable('Timer'); } } }
}
Simulated Function postboost(Vehicle TheBoostedvec)
{
if ( VocBoost!= None ) PlaySound (VocBoost) ; //Sound Fx
}
defaultproperties
{
bNoDelete=False
RemoteRole=ROLE_SimulatedProxy
}
</UScript>
Related Topcs
- Vehicles
- Emitter
- Particle System
- ParticleEmitter
- ParticleEmitter Cookbook
- udn2:EmittersReference
- udn2:EmittersExamples
More custom SFX emitter scripts
- SFXVehicleTeleporting
- SFXPainful
- SFXTriggering
- SFXEjecting
- SFXMonsterSpawning
- SFXHealing
- SFXSelfScaling
- SFXUltraLight
- InventoryFlare
- ExampleFlares