Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UTGame.UTGib_Vehicle


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
/**
 *
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
 */

class UTGib_Vehicle extends UTGib
	abstract;


var float TimeBeforeGibExplosionEffect;

/** Effect to have when gib is first spawned.  Actually happens at TimeBeforeGibExplosionEffect after being spawned **/
var ParticleSystem PS_GibExplosionEffect;

/** PS to attach and trail behind the gib **/
var ParticleSystem PS_GibTrailEffect;

/** Played when the Gib has been spawned **/
var SoundCue LoopedSound;

var name BurnName;
var float BurnDuration;

var MaterialInstanceTimeVarying MITV;

var class<UTVehicle> OwningClass;



simulated event PostBeginPlay()
{
	Super.PostBeginPlay();

	CreateAudioComponent( LoopedSound, TRUE, TRUE );
}


simulated function ActivateGibExplosionEffect()
{
	local int TeamNum;
	local ParticleSystemComponent PSC_Trail;

	if(WorldInfo.NetMode == NM_DedicatedServer)
	{
		return;
	}
	if ( Instigator != None )
	{
		TeamNum = Instigator.GetTeamNum();
	}
	if( TeamNum > 1 )
	{
		TeamNum = 0;
	}

	if( OwningClass.default.BurnOutMaterial[TeamNum] != None )
	{
		GibMeshComp.SetMaterial( 0, OwningClass.default.BurnOutMaterial[TeamNum] );
	}

	// don't spawn the particle system
	if(WorldInfo.TimeSeconds - GibMeshComp.LastRenderTime < 1.0)
	{
		WorldInfo.MyEmitterPool.SpawnEmitter( PS_GibExplosionEffect, Location, Rotation );
		
		// we can't use the pool for trails as they have a long (infi) duration
		//WorldInfo.MyEmitterPool.SpawnEmitter( PS_GibTrailEffect, Location, Rotation, self );
		PSC_Trail = new(self) class'ParticleSystemComponent';
		PSC_Trail.SetTemplate( PS_GibTrailEffect );
		AttachComponent( PSC_Trail );
	}

	// if the vehicle could be close to us go ahead and do the MITV so that gibs near us will burn out nicely
	if(WorldInfo.TimeSeconds - GibMeshComp.LastRenderTime < 3.0)
	{	
		MITV = GibMeshComp.CreateAndSetMaterialInstanceTimeVarying( 0 );
		MITV.SetScalarStartTime( 'BurnTime', (LifeSpan-(BurnDuration-(FRand()*1.0f))) );
		//`log( "BurnDuration: " $ BurnDuration $ " LifeSpan: " $ LifeSpan $ " MITV: " $ MITV.Parent );
	}
}

defaultproperties
{
   TimeBeforeGibExplosionEffect=0.100000
   PS_GibExplosionEffect=ParticleSystem'Envy_Effects.Particles.P_VH_Gib_Explosion'
   PS_GibTrailEffect=ParticleSystem'Envy_Effects.Tests.Effects.P_Vehicle_Damage_1'
   LoopedSound=SoundCue'A_Vehicle_Generic.Fire.VehicleDerbisLoop_Cue'
   BurnName="BurnTime"
   BurnDuration=3.500000
   Begin Object Class=DynamicLightEnvironmentComponent Name=GibLightEnvironmentComp ObjName=GibLightEnvironmentComp Archetype=DynamicLightEnvironmentComponent'UTGame.Default__UTGib:GibLightEnvironmentComp'
      ObjectArchetype=DynamicLightEnvironmentComponent'UTGame.Default__UTGib:GibLightEnvironmentComp'
   End Object
   GibLightEnvironment=GibLightEnvironmentComp
   HitSound=SoundCue'A_Vehicle_Generic.Vehicle.VehicleImpact_MetalSmallCue'
   Components(0)=GibLightEnvironmentComp
   Name="Default__UTGib_Vehicle"
   ObjectArchetype=UTGib'UTGame.Default__UTGib'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: tr 31-1-2018 17:18:36.000 - Creation time: sk 18-3-2018 10:01:21.377 - Created with UnCodeX