Announcement

Collapse
No announcement yet.

DestroyEffectClass?

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

    DestroyEffectClass?

    I have a vehicle that has a VERY devistating, and VERY short-ranged weapon. I was looking for a way to reduce the damage it takes when it destroys a vehicle (since they are so close due to it's short range, it often takes a bit of damage when the target explodes). While looking for this, I tracked down Destroyeffectclass, which is spawned in SVehicle's Destroyed() function. "DestroyedEffectClass" is a variable that seems as if it is never set to any value.
    Anyways, I'm trying to check to see if the damage taken is the result of a vehicle dying (I can handle the check to see if it is dying because of my Vec). Can anyone help me here? Thanks.

    BTW, I have 2 vehicles that are still in beta stage, the Air Defense Truck, and the Lightning Rod. The LightningRod needs a decent texture, and the AirDef needs network testing and balance tested. If any helpful soul could help me with these, I'd appreciate it. Any credit due will be given when the vehicle goes final.

    #2
    DestroyedEffectClass is set in the defaultproperties of the actual vehicles, not in the SVehicle base class. Wouldn't be the first variable with no readily apparent use... Hurray for the clarity of OO programming, eh?

    DestroyedEffectClass is just pretty particles... a collection of Emitters. It doesn't deal any damage.

    Check out ONSVehicle. In state VehicleDestroyed and event TakeImpactDamage it calls VehicleExplosion, which calls HurtRadius with ExplosionDamageType, which is set in defaultproperties like this: ExplosionDamageType=class'DamTypeONSVehicleExplosi on'

    If you're taking that type of damage, you should reduce it.

    Comment


      #3
      Yep, in the take damage funciton of your vec jsut add a check for the vehicle explosion damage type and away you go

      Comment


        #4
        Thanks, That's what I was looking for.

        Comment


          #5
          Might want to make is check that hte vec it is hit with is also the last vec you hit, so your vec still takes damage form other vecs that explode.

          Comment


            #6
            The only problem is that InstigatedBy in the takedamage function refers to the vehicle I am in, not the vehicle I have destroyed. I think it's set up like that so whoever desrtoys a vehicle gets credit for whoever gets killed when it explodes.

            Either way, I'm not seeing where to get what vehicle causes 'takeimpactdamage', since it passes 'self' as the instigator to the takedamage function.

            Comment


              #7
              dont worry about the InstigatedBy in takedamage, just check if the DamageType passed to takedamage is the type done by a vehicle exploding ( probably DamTypeONSVehicleExplosion ).

              Comment


                #8
                Impact damage also results from flying into walls and stuff...

                What's it matter who caused a vehicle to explode? If your vehicle is armored from the front, you could perhaps check the direction the damage is coming from and dampen it accordingly.

                Comment


                  #9
                  What's it matter who caused a vehicle to explode?
                  Because I only want to dampen the damage if my vecs main weapon destroyed it.

                  I think I got it though. I have it arranged so that it only dampens the damage if the last vehicle hit with the weapon has <= 0 health, and it's been less than .1 seconds since I hit it, and the damagetype I am taking is DamTypeONSVehicleExplosion. Might not be the cleanest way of doing it, but it'll be accurate enough for a video game. Thanks all.

                  Comment

                  Working...
                  X