GreatEmerald / UT3Vehicles

The vehicles portion of the UT3Style mod for Unreal Tournament 2004.
Other
3 stars 4 forks source link

UT3 Water Damage #240

Open HellDragon-HK opened 6 years ago

HellDragon-HK commented 6 years ago

This proved to be more difficult to figure out than I expected

In UT3 vehicles immediately start taking water damage rapidly (link gun alt fire kind of rapid) when they are under but in UT2004 it almost feels bugged or just plain random and feels different on different maps.

This is during driving, upon getting out in UT2004 it actually takes damage faster than UT3 it feels, wwhile driving underwater in UT2004 I've had one VCTF map doing significant damage every few seconds to the Hellbender, other maps I've tried do 1-2 damage sometimes instantly and other times none, 5 damage for a few seconds then stops, or none at all and this has been true with stock UT2004 vehicles too so I really have no clue how it works in UT2004.

There is a WaterDamage=150.000000 in UT2004's base vehicle code and UT3 has WaterDamage=20.000000 in it's base vehicle code which I have tried but doesn't seem to do anything.

I will also say damage is coded very differently between to 2 by the look of it....can anyone else figure this out?

UT3

/**
 * TakeWaterDamage() called every tick when AccumulatedWaterDamage>0 and PhysicsVolume.bWaterVolume=true
 *
 * @param   DeltaTime       The amount of time passed since it was last called
 */
event TakeWaterDamage()
{
    local int ImpartedWaterDamage;

    ImpartedWaterDamage = AccumulatedWaterDamage;
    AccumulatedWaterDamage -= ImpartedWaterDamage;
    TakeDamage(ImpartedWaterDamage, Controller, Location, vect(0,0,0), VehicleDrowningDamType);
}

I've been unable to find anything more in UT3 code but there must be something more somewhere.

UT2004

// TakeWaterDamage() called every tick when WaterDamage>0 and PhysicsVolume.bWaterVolume=true
event TakeWaterDamage(float DeltaTime)
{
    local vector HitLocation,HitNormal;
    local actor EntryActor;

    TakeDamage(WaterDamage * DeltaTime, Self, vect(0,0,0), vect(0,0,0), VehicleDrowningDamType);

    if ( (Level.TimeSeconds - SplashTime > 0.3) && (PhysicsVolume.PawnEntryActor != None) && !Level.bDropDetail && (Level.DetailMode != DM_Low) && EffectIsRelevant(Location,false)
        && (VSize(Velocity) > 300) )
    {
        SplashTime = Level.TimeSeconds;
        if ( !PhysicsVolume.TraceThisActor(HitLocation, HitNormal, Location - CollisionHeight*vect(0,0,1), Location + CollisionHeight*vect(0,0,1)) )    
        {
            EntryActor = Spawn(PhysicsVolume.PawnEntryActor,self,,HitLocation,rot(16384,0,0));
        }
    }
}
HellDragon-HK commented 6 years ago

Oh the VCTF map I was getting the damage on is apparently acid maybe and not water (although it looks like water to me) which explains the quick damage....didn't find this out until not in a vehicle heh my mistake.