Announcement

Collapse
No announcement yet.

Well BAKe my balls! (Codintg conundrums)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Well BAKe my balls! (Codintg conundrums)

    Ok I'm having a problem here, so I'll start with the most important facts.

    In my mod, I am subclassing the Skaarj monster.

    When a player is hit via the MeleeDamageTarget(int hitdamage, vector pushdir)

    function, they take the appropriate damage, etc. But NO blood (or gibs upon death) show up !

    Let's say, conversely that I use an instant fire gun to SHOOT the same pawn that the monster was attacking....I am greeted by the correct blood splashes and hit noises and gibs fly everywhere when the kill occurs.

    I have put logs all over the Pawn's TakeDamage function AND the monster's ClawDamageTarget function, and it would seem that the TakeDamage function is indeed callling a PlayHit() on the pawn when he is struck by the Monster...

    only , for some reason, there are no signs of damage (other than the actual damage being done);

    here is the code from the monster:

    Code:
     function bool MeleeDamageTarget(int hitdamage, vector pushdir)
    {
        local vector HitLocation, HitNormal;
        local actor HitActor;
    
        // check if still in melee range
        If ( (Controller.target != None) && (STUNNED == false) && (VSize(Controller.Target.Location - Location) <= MeleeRange * 1.4 + Controller.Target.CollisionRadius + CollisionRadius)
            && ((Physics == PHYS_Flying) || (Physics == PHYS_Swimming) || (Abs(Location.Z - Controller.Target.Location.Z)
                <= FMax(CollisionHeight, Controller.Target.CollisionHeight) + 0.5 * FMin(CollisionHeight, Controller.Target.CollisionHeight))) )
        {
            HitActor = Trace(HitLocation, HitNormal, Controller.Target.Location, Location, false);
            if ( HitActor != None )
                return false;
    
          if (Controller.Target.IsA('KFHumanPawn'))
          {
           KFPawn(Controller.Target).TakeDamage(hitdamage, Instigator ,HitLocation,pushdir, class 'KFmod.ZombieMeleeDamage');
           }
    
          else
          Controller.Target.TakeDamage(hitdamage, self ,HitLocation,pushdir, class 'KFmod.ZombieMeleeDamage');
    
    
          return true;
        }
        return false;
    }

    and here is the code from the Pawn he's hitting

    Code:
    // This may help show the hit effects when zombies hit players
    
    function PlayHit(float Damage, Pawn InstigatedBy, vector HitLocation, class<DamageType> damageType, vector Momentum)
    {
        local Vector HitNormal;
        local Vector HitRay;
        local Name HitBone;
        local float HitBoneDist;
        local PlayerController PC;
        local bool bShowEffects, bRecentHit;
        local BloodSpurt BloodHit;
    
        bRecentHit = Level.TimeSeconds - LastPainTime < 0.5;
        Super.PlayHit(Damage,InstigatedBy,HitLocation,DamageType,Momentum);
        if ( Damage <= 0 )
            return;
    
      // Log("You got smacked upside the head by: ");
       Log(InstigatedBy);
    
        PC = PlayerController(Controller);
        bShowEffects = ( (Level.NetMode != NM_Standalone) || (Level.TimeSeconds - LastRenderTime < 2.5)
                        || ((InstigatedBy != None)) );
        if ( !bShowEffects )
            return;
    
        HitRay = vect(0,0,0);
        if( InstigatedBy != None )
            HitRay = Normal(HitLocation-(InstigatedBy.Location+(vect(0,0,1)*InstigatedBy.EyeHeight)));
    
        if( DamageType.default.bLocationalHit )
            CalcHitLoc( HitLocation, HitRay, HitBone, HitBoneDist );
        else
        {
            HitLocation = Location;
            HitBone = 'None';
            HitBoneDist = 0.0f;
        }
    
        if( DamageType.default.bAlwaysSevers && DamageType.default.bSpecial )
            HitBone = 'head';
    
        if( InstigatedBy != None )
            HitNormal = Normal( Normal(InstigatedBy.Location-HitLocation) + VRand() * 0.2 + vect(0,0,2.8) );
        else
            HitNormal = Normal( Vect(0,0,1) + VRand() * 0.2 + vect(0,0,2.8) );
    
        if ( DamageType.Default.bCausesBlood )
        {
          // Log("The damagetype does cause blood");
    
            if ( class'GameInfo'.static.UseLowGore() )
            {
                if ( class'GameInfo'.static.NoBlood() )
                {
                   // Log("sorry, no blood");
                    BloodHit = BloodSpurt(Spawn( GibGroupClass.default.NoBloodHitClass,InstigatedBy,, HitLocation ));
                }
                else
                {
                   // Log("Low blood");
                    BloodHit = BloodSpurt(Spawn( GibGroupClass.default.LowGoreBloodHitClass,InstigatedBy,, HitLocation ));
                }
            }
            else
            {
               // Log("BLOOD WEEE!");
                BloodHit = BloodSpurt(Spawn(GibGroupClass.default.BloodHitClass,InstigatedBy,, HitLocation, Rotator(HitNormal)));
            }
            if ( BloodHit != None )
            {
                BloodHit.bMustShow = !bRecentHit;
                if ( Momentum != vect(0,0,0) )
                    BloodHit.HitDir = Momentum;
                else
                {
                    if ( InstigatedBy != None )
                        BloodHit.HitDir = Location - InstigatedBy.Location;
                    else
                        BloodHit.HitDir = Location - HitLocation;
                    BloodHit.HitDir.Z = 0;
                }
            }
        }
    
        // hack for flak cannon gibbing
        if ( (DamageType.name == 'DamTypeFlakChunk') && (Health < 0) && (InstigatedBy != None) && (VSize(InstigatedBy.Location - Location) < 350) )
            DoDamageFX( HitBone, 8*Damage, DamageType, Rotator(HitNormal) );
        else
            DoDamageFX( HitBone, Damage, DamageType, Rotator(HitNormal) );
    
        if (DamageType.default.DamageOverlayMaterial != None && Damage > 0 ) // additional check in case shield absorbed
                    SetOverlayMaterial( DamageType.default.DamageOverlayMaterial, DamageType.default.DamageOverlayTime, false );
    }


    (BTW, "ZombieMeleeDamage" has been set to showblood etc etc so it's not the damagetype that's the issue here)

    Any ideas ?


    #2
    no now shut your huge mouth you stinkin' ******

    Comment


      #3
      What?

      What the **** would you post that for.

      Comment


        #4
        He's banned.

        Comment


          #5
          Originally posted by Penguin
          He's banned.
          He doesn't seem to be banned, and what does it matter that he posts this, as long as there's no download or screen i think it's fine...

          EDIT:
          He really isn't banned, this was posted on: 09-27-2005 06:41 PM

          Originally posted by XAlexX
          Um. How could anyone tell without using it in a game?

          Release an open beta and you could get valid opinions from first hand use.

          Comment


            #6
            No, XAlexX is not banned, zac12222 is.

            Comment


              #7
              Uh....well guys, before this degenerated in a banning whodunnit , I *did* have a valid question that needed answering



              BTW, i have been able to get the blood splosh to show up (though it seems small)

              but the players still don't gib when killed by the zombie monster.

              Comment


                #8
                Doesn't gibbing depend on damage values, and how much health the victim has?

                Comment


                  #9
                  No, these pawns ALWYAS gib on death.

                  Comment

                  Working...
                  X