I need help with getting an effect I made to kill people without them going into a zombie mode state. Here's the code:
- Code: Select all
//=============================================================================
// DBBlastEffect.
//=============================================================================
class DBBlastEffect expands SphereEffect;
var(SuperMod) float BlastRadius;
var float blastTimer;
var(SuperMod) float BlastAmp;
simulated function tick(float deltatime)
{
local Actor A;
local DeusExMover M;
local DeusExProjectile P;
local Light L;
local ScriptedPawn S;
local DeusExDecoration D;
blastTimer += deltaTime;
DrawScale += (deltaTime * Default.DrawScale*BlastAmp);
BlastRadius = (Default.BlastRadius * DrawScale);
if (blastTimer > 1.0)
{
blastTimer = 0;
foreach RAdiusActors(class'Actor', A, BlastRadius)
if (A != None)
{
If (Level.Netmode!=NM_Client)
{
A.TakeDamage(4, None, A.Location, vect(0,0,0), 'Exploded');
A.TakeDamage(20, None, A.Location, vect(0,0,0), 'EMP');
}
If (Level.Netmode==NM_Client)
{
A.TakeDamage(20, None, A.Location, vect(0,0,0), 'EMP');
A.TakeDamage(4, None, A.Location, vect(0,0,0), 'Exploded');
}
}
foreach RAdiusActors(class'DeusExMover', M, BlastRadius)
if (M != None)
{
If (Level.Netmode!=NM_Client)
{
M.bBreakable=True;
M.DoorStrength=0.0;
}
If (Level.Netmode==NM_Client)
{
M.bBreakable=True;
M.DoorStrength=0.0;
}
}
foreach RAdiusActors(class'DeusExProjectile', P, BlastRadius)
if (P != None)
{
If (Level.Netmode!=NM_Client)
{
P.Explode(P.Location,Vect(0,0,1));
}
If (Level.Netmode==NM_Client)
{
P.Explode(P.Location,Vect(0,0,1));
}
}
foreach RAdiusActors(class'Light', L, BlastRadius)
if (L != None)
{
If (Level.Netmode!=NM_Client)
{
L.LightBrightness=L.LightBrightness/2;
If (L.LightBrightness<10)
{
L.Lightbrightness=10;
}
}
If (Level.Netmode==NM_Client)
{
L.LightBrightness=L.LightBrightness/2;
If (L.LightBrightness<10)
{
L.Lightbrightness=10;
}
}
}
foreach RAdiusActors(class'ScriptedPawn', S, BlastRadius)
if (S != None)
{
If (Level.Netmode!=NM_Client)
{
S.bInvincible=False;
S.TakeDamage(1, None, S.Location, vect(0,0,0), 'TearGas');
}
If (Level.Netmode==NM_Client)
{
S.bInvincible=False;
S.TakeDamage(1, None, S.Location, vect(0,0,0), 'TearGas');
}
}
foreach RAdiusActors(class'DeusExDecoration', D, BlastRadius)
if (D != None&&!D.IsA('DeathBombBlastOff')&&!D.IsA('Switch1')&&!D.IsA('Switch2')&&!D.IsA('Button1')&&!D.IsA('ElectronicDevices')&&!D.IsA('AutoTurret')&&!D.IsA('AmmoCrate'))
{
If (Level.Netmode!=NM_Client)
{
D.bInvincible=False;
}
If (Level.Netmode==NM_Client)
{
D.bInvincible=False;
}
}
}
}
That's the effect, and the projectile:
- Code: Select all
//=============================================================================
// DeathBomb.
//=============================================================================
class DeathBomb expands DeusExProjectile;
Var DBBlastoffgen DD;
Var ParticleGenerator FireGen;
Var ParticleGenerator FireGen2;
Simulated Function Tick(Float DeltaTime)
{}//Disables the effect of "Gravity" on the projectile
function PlayImpactSound()
{
PlaySound(ImpactSound, SLOT_None, 2.0,, blastRadius*16);
}
auto simulated state Flying
{
simulated function Explode(vector HitLocation, vector HitNormal)
{
PlayImpactSound();
GotoState('Exploding');
If (Level.Netmode!=NM_Client)
{
Spawn(class'DBBlastEffect',,, HitLocation);
Spawn(class'DBBlastEffectOuter',,, HitLocation);
Spawn(class'ScorchMark',,,Hitlocation);
}
}
}
Simulated function PostBeginPlay()
{
SpawnRocketEffects();
If (Level.Netmode==NM_StandAlone)
{
bExplodes=True;
DamageType='Exploded';
BlastRadius=64;
}
}
simulated function PostNetBeginPlay()
{
Super.PostNetBeginPlay();
if (Role != ROLE_Authority)
SpawnRocketEffects();
if (Level.Netmode!=NM_StandAlone)
{
bExplodes=True;
DamageType='Exploded';
BlastRadius=64;
}
}
simulated function SpawnRocketEffects()
{
DD = Spawn(class'DBBlastOffGen', Self);
if (DD != None)
{
DD.RemoteRole = ROLE_None;
DD.SetBase(Self);
}
fireGen = Spawn(class'ParticleGenerator', Self);
if (fireGen != None)
{
fireGen.RemoteRole = ROLE_None;
fireGen.particleTexture = Texture'CrazyKarkFlame';
fireGen.particleDrawScale = 0.15;
fireGen.checkTime = 0.01;
fireGen.riseRate = 0.0;
fireGen.ejectSpeed = 0.0;
fireGen.particleLifeSpan = 0.8;
fireGen.SetBase(Self);
}
fireGen2 = Spawn(class'ParticleGenerator', Self);
if (fireGen2 != None)
{
fireGen2.RemoteRole = ROLE_None;
fireGen2.particleTexture = Texture'DBTrailEffect';
fireGen2.particleDrawScale = 0.25;
fireGen2.checkTime = 0.05;
fireGen2.riseRate = 10.0;
fireGen2.ejectSpeed = 50.0;
fireGen2.particleLifeSpan = 0.8;
FireGen2.bGravity=True;
fireGen2.SetBase(Self);
}
}
simulated function Destroyed()
{
if (DD != None)
DD.DelayedDestroy();
if (fireGen != None)
fireGen.DelayedDestroy();
if (fireGen2 != None)
fireGen2.DelayedDestroy();
Super.Destroyed();
}
Ok, the effects such as the DBBlastOffGen work perfect as is, and the other sphere mentioned in the rocket code is an exact replica of the first one, except that it doesn't have any coding for trashing invincible stuff in levels.
I read somewhere in an old topic of MainMan's, that he overrided something in the Flying state to get this to work without the zombie mode effect. If anyone can help with this, i'll be most grateful, and you'll get SuperMod(Not SuperModv1, i'm not making a follow up anymore) out to the masses a lot faster

Thanks to anyone who helps in advance
