DeathBomb Zombie Mode Problem!!!

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

DeathBomb Zombie Mode Problem!!!

Postby Allan » Wed Apr 12, 06 1:42 pm

Ok, i'm trying to finish up a rather large modpack i've been working on for some time, and it's nearly done. I just need to fiddle with some of the settings for it's teleport rifle, and then the only main issue is this.

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 :D

Thanks to anyone who helps in advance :D
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby MainMan » Sun Apr 16, 06 8:15 pm

Mmm okay this is all about replication (whether something is called on the server or on the client)

You have got the right idea with "If (Level.Netmode!=NM_Client)", I think it's just some minor issues. As a personal preference, I prefer to check with "if (Role == ROLE_Authority)" - I don't really know why, just paranoia i guess haha.

Bomb:
Code: Select all
simulated function ILikeLag()
{
local DBBlastEffect eff;
local DBBlastEffectOuter eff2;
local ScorchMark eff3;

      eff=Spawn(class'DBBlastEffect',,, HitLocation);
      eff2=Spawn(class'DBBlastEffectOuter',,, HitLocation);
      eff3=Spawn(class'ScorchMark',,,Hitlocation);
}

auto simulated state Flying
{
   function Explode(vector HitLocation, vector HitNormal)
   {
      If (Role == ROLE_Authority)
   ILikeLag();

      PlayImpactSound();
      GotoState('Exploding');
   }
}


Effect:
Code: Select all

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 (Role == ROLE_Authority)
         {
            A.TakeDamage(4, None, A.Location, vect(0,0,0), 'Exploded');
            A.TakeDamage(20, None, A.Location, vect(0,0,0), 'EMP');
         }
//dunno why you need this to be honest lol
//         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 VisibleActors(class'DeusExMover', M, BlastRadius)
      if (M != None)
      {
         If (Role == ROLE_Authority)
         {
            M.bBreakable=True;
            M.DoorStrength=0.0;
         }
         If (Level.Netmode==NM_Client)
         {
            M.bBreakable=True;
            M.DoorStrength=0.0;
         }
      }
      foreach VisibleActors(class'DeusExProjectile', P, BlastRadius)
      if (P != None)
      {
         If (Role == ROLE_Authority)
         {
         P.Explode(P.Location,Vect(0,0,1));         
         }
//erm...
//         If (Level.Netmode==NM_Client)
//         {
//         P.Explode(P.Location,Vect(0,0,1));
//         }
      }
      foreach VisibleActors(class'Light', L, BlastRadius)
      if (L != None)
      {
         If (Role == ROLE_Authority)
         {
         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 VisibleActors(class'ScriptedPawn', S, BlastRadius)
      if (S != None)
      {
         If (Role == ROLE_Authority)
         {
            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 VisibleActors(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 (Role == ROLE_Authority)
         {
            D.bInvincible=False;
         }
//         If (Level.Netmode==NM_Client)
//         {
//            D.bInvincible=False;
//         }
      }

   }
}


Eeeh this is untested, so I wouldn't be suprised if it doesn't work.
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby Allan » Sun Apr 16, 06 10:02 pm

Only thing the compiler said was whong with that was it didn't recognise "HitLocation" in "ILikeLag", so i changed it to Location, as it'll still be in the level for a tiny amount of time after that function is called, i hope :)
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby MainMan » Sun Apr 16, 06 10:07 pm

In that case change it to:

Code: Select all
simulated function ILikeLag(vector HitLocation)
{
local DBBlastEffect eff;
local DBBlastEffectOuter eff2;
local ScorchMark eff3;

      eff=Spawn(class'DBBlastEffect',,, HitLocation);
      eff2=Spawn(class'DBBlastEffectOuter',,, HitLocation);
      eff3=Spawn(class'ScorchMark',,,Hitlocation);
}

auto simulated state Flying
{
   function Explode(vector HitLocation, vector HitNormal)
   {
      If (Role == ROLE_Authority)
   ILikeLag(HitLocation);

      PlayImpactSound();
      GotoState('Exploding');
   }
}
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 9 guests