I'm changing the dust emitter that is used for the KVehicle. The spawning of the emitters is hardcoded in ONSWheeledCraft's(my KV's parent) event DrivingStatusChanged()
So I overrid that event so I could spawn my own emitter - a copy+paste job the only diff is that I deleted the Super call.
Because I omitted the Super call I added what would have been missed in Vehicle's event DiverStatuschanged()
So I combined them in my own event-
The problem is that my KV no longer emits dust.
Any thoughts?
Code:
simulated event DrivingStatusChanged()
{
local int i;
local Coords WheelCoords;
Super.DrivingStatusChanged();
if (bDriving && Level.NetMode != NM_DedicatedServer && !bDropDetail)
{
Dust.length = Wheels.length;
for(i=0; i<Wheels.Length; i++)
if (Dust[i] == None)
{
// Create wheel dust emitters.
WheelCoords = GetBoneCoords(Wheels[i].BoneName);
The spawning-> Dust[i] = spawn(class'ONSDirtSlipEffect', self,, WheelCoords.Origin + ((vect(0,0,-1) * Wheels[i].WheelRadius) >> Rotation));
Dust[i].SetBase(self);
Dust[i].SetDirtColor( Level.DustColor );
}
if (Level.NetMode != NM_DedicatedServer)
{
for(i=0; i<Dust.Length; i++)
Dust[i].Destroy();
Dust.Length = 0;
....omited code
}
So I overrid that event so I could spawn my own emitter - a copy+paste job the only diff is that I deleted the Super call.
Because I omitted the Super call I added what would have been missed in Vehicle's event DiverStatuschanged()
Code:
local PlayerController PC;
PC = Level.GetLocalPlayerController();
if (bDriving && PC != None && (PC.ViewTarget == None || !(PC.ViewTarget.IsJoinedTo(self))))
bDropDetail = (Level.bDropDetail || (Level.DetailMode == DM_Low));
else
bDropDetail = False;
if (bDriving)
Enable('Tick');
else
Disable('Tick');
So I combined them in my own event-
Code:
simulated event DrivingStatusChanged()
{
local int i;
local Coords WheelCoords;
local PlayerController PC;
PC = Level.GetLocalPlayerController();
if (bDriving && PC != None && (PC.ViewTarget == None || !(PC.ViewTarget.IsJoinedTo(self))))
bDropDetail = (Level.bDropDetail || (Level.DetailMode == DM_Low));
else
bDropDetail = False;
if (bDriving)
Enable('Tick');
else
Disable('Tick');
if (bDriving && Level.NetMode != NM_DedicatedServer && !bDropDetail)
{
Dust.length = Wheels.length;
for(i=0; i<Wheels.Length; i++)
if (Dust[i] == None)
{
// Create wheel dust emitters.
WheelCoords = GetBoneCoords(Wheels[i].BoneName);
Dust[i] = spawn(class'ONSDirtSlipEffect', self,, WheelCoords.Origin + ((vect(0,0,-1) * Wheels[i].WheelRadius) >> Rotation));
Dust[i].SetBase(self);
Dust[i].SetDirtColor( Level.DustColor );
log("ddddssssssss"$i);//check spawn
}
if(bMakeBrakeLights)
{
for(i=0; i<2; i++)
if (BrakeLight[i] == None)
{
BrakeLight[i] = spawn(class'ONSBrakelightCorona', self,, Location + (BrakeLightOffset[i] >> Rotation) );
BrakeLight[i].SetBase(self);
BrakeLight[i].SetRelativeRotation( rot(0,32768,0) ); // Point lights backwards.
BrakeLight[i].Skins[0] = BrakeLightMaterial;
}
}
}
else
{
if (Level.NetMode != NM_DedicatedServer)
{
for(i=0; i<Dust.Length; i++)
{
Dust[i].Destroy();
log("ssssssss"$i);//
}
Dust.Length = 0;
if(bMakeBrakeLights)
{
for(i=0; i<2; i++)
if (BrakeLight[i] != None)
BrakeLight[i].Destroy();
}
}
TurnDamping = 0.0;
}
}
The problem is that my KV no longer emits dust.
Any thoughts?