Ok, I'm working on the next version of my Proximity Mines mutator and I'm adding new detonation types. I'm currently working on a shock beam type detonation that mainly consists of a beam of electricity flowing from the mine to the player who triggered it. The beam is a beam xemitter that has been modified to give damage to whoever it is attached to. So far it works fine except for one thing. Keep in mind that I have only tested this in Instant Action with just bots so far. Anyway, I find that I only take damage from the beam when its Instigator has died. The bots take damage from my beams when I'm alive, yet it doesn't work when I'm the one being shocked. I'll post my code below to see if anyone can help.
Here is the xEmitter class:
And here is the portion in my mine class (a subclass of projectile) where the xEmitter is spawned, etc:
Here is the xEmitter class:
Code:
class Elecbeam extends xEmitter;
#exec OBJ LOAD FILE=XEffectMat.utx
var Actor StartActor, EndActor;
var bool bIsFirst;
var int DamTime;
var float Dist, WaitTime, DieTime;
var int Damage;
var class<DamageType> DamageType;
var vector Momentum, HitLocation;
var Pawn myInstigator;
simulated function PostNetBeginPlay()
{
if(Instigator != none)
myInstigator = Instigator;
DieTime = Level.TimeSeconds + WaitTime;
Super.PostNetBeginPlay();
}
simulated function Tick(float Delta)
{
DamTime++;
if(Instigator == none)
Instigator = myInstigator;
if(StartActor != none)
mSpawnVecB = StartActor.Location;
if(EndActor != none){
mSpawnVecA = EndActor.Location;
EndActor.AmbientSound = Sound'WeaponSounds.LinkGun.BLinkGunBeam4';
if(DamTime >= 10){
EndActor.TakeDamage(Damage,Instigator,HitLocation,Momentum,DamageType);
DamTime = 0;
}
}
Dist = Vsize(mSpawnVecA - mSpawnVecB);
if(Level.TimeSeconds >= DieTime || Dist >= 1000 || Pawn(EndActor).Health <= 0 || EndActor == none || StartActor == none){
if(bIsFirst)
StartActor.Destroy();
EndActor.AmbientSound = none;
Destroy();
}
}
defaultproperties
{
RemoteRole=ROLE_SimulatedProxy
bNetTemporary=false
bReplicateInstigator=true
mParticleType=PT_Beam
mStartParticles=1
mAttenuate=false
mSizeRange(0)=11.0 // width
mRegenDist=65.0 // section length
mMaxParticles=3 // planes
mColorRange(0)=(R=240,B=240,G=240)
mColorRange(1)=(R=240,B=240,G=240)
mSpinRange(0)=45000 // spin
mAttenKa=0.0
mWaveFrequency=0.25
mWaveAmplitude=10.0
mWaveShift=200000.0
mBendStrength=0.5
mWaveLockEnd=true
Skins(0)=FinalBlend'XEffectMat.Link.LinkBeamBlueFB'
Style=STY_Additive
bUnlit=true
//EffectOffset=(X=22,Y=11,Z=1.4)
SoundRadius=100
SoundVolume=255
AmbientSound=Sound'WeaponSounds.LinkGun.BLinkGunBeam4'
bIsFirst=false
DamTime=0
WaitTime=10
Damage=1
DamageType=class'DamTypeElecBeam'
Momentum=(X=0,Y=0,Z=0)
}
And here is the portion in my mine class (a subclass of projectile) where the xEmitter is spawned, etc:
Code:
if(ElecBeam == none){
ElecBeam = Spawn(class'ElecBeam',Instigator);
ElecBeam.StartActor = self;
ElecBeam.EndActor = Victim;
ElecBeam.Instigator = Instigator;
ElecBeam.bIsFirst = true;
}