I'm porting a weapon from Unreal v220 and it uses effects to create a muzzle flash, effects are spawned as the weapon fires, and where it hits. The problem is, is that online, the effects just hang in mid-air and don't disappear. I don't understand much about replication, but I'm assuming it is not being destroyed, either client side or server side.
I pasted in the 3 effect classes with code, the parent class and 2 child classes. There are sub-classes of those child classes, but they have no code. Could someone help?
Code:class KlingonEffects expands Effects;
var() float ScaleRate;
var() float ScaleGlowRate;
var() float EffectTimer;
var() sound EffectSound;
var() class<Effects> ChildEffect;
var() class<Effects> TickEffect;
var() class<Effects> DestroyedEffect;
var() texture Frames[20];
var int CurrentFrame;
var actor ChildActor,
DestroyedActor,
TickActor;
function EffectAnim(float delta)
{
if (Frames[0] != None) {
if (Frames[CurrentFrame] == None || CurrentFrame == 19) {
Destroy();
}
else {
Texture=Frames[CurrentFrame];
CurrentFrame++;
}
}
if (ScaleRate != 0.0) {
DrawScale+=ScaleRate;
if (DrawScale <= 0.0) {
Destroy();
}
}
if (ScaleGlowRate != 0.0) {
ScaleGlow+=ScaleGlowRate;
if (ScaleGlow <= 0.0) {
Destroy();
}
}
if (TickEffect != None) {
TickActor=Spawn(TickEffect);
}
}
auto state SpecialEffect
{
function Tick(float delta)
{
EffectAnim(delta);
}
function Timer()
{
EffectAnim(EffectTimer);
}
function Destroyed()
{
if (DestroyedEffect != None) {
DestroyedActor=Spawn(DestroyedEffect);
}
if (EffectSound2 != None) {
PlaySound(EffectSound2);
}
}
function BeginState()
{
if (EffectSound != None) {
PlaySound(EffectSound);
}
if (EffectSound1 != None) {
PlaySound(EffectSound1);
}
if (ChildEffect != None) {
ChildActor=Spawn(ChildEffect);
}
if (EffectTimer != 0.0) {
Disable('Tick');
SetTimer(EffectTimer,True);
}
}
}
Code:class AnySmoke expands KlingonEffects;
var() class<Effects> SmokeList[10];
auto state SpecialEffect
{
function BeginState()
{
ChildEffect=SmokeList[Rand(10)];
Super.BeginState();
Destroy();
}
}
Code:Class Smokes espands KlingonEffects;
var() bool bRising;
auto state SpecialEffect
{
function BeginState()
{
Super.BeginState();
if (bRising) {
SetPhysics(PHYS_Projectile);
Velocity=vect(0,0,50.0)*(0.25+FRand());
}
}
}