Announcement

Collapse
No announcement yet.

Looking for a video tutorial on vehicles

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

    Yesterday:
    Here is what I want to do, make the main cannon fire regular, but have the machine gun be on the Alt fire.

    Next day: Problem solved
    It is such a good feeling to figure out how to acomplish a goal on your own
    by having just a little bit of an understanding how things are linked when you see other code.

    After looking at the Hammerhead code I figured out how to do it and decided to share my findings.




    Here is the code for H2_Wraith_Chassis.uc
    Code:
    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------
    class H2_Wraith_Chassis extends ONSHoverCraft;
    
    
    
    //// Switch weapons when alt-fire is pressed and display a message.
    function AltFire(optional float F)
    {
        if(IsFiring())
            return;
    
        if(ActiveWeapon == 0)
        {
            if(PlayerController(Controller) != None)
                PlayerController(Controller).ReceiveLocalizedMessage(class'H2_Wraith_Message', 1);
    
            SetActiveWeapon(1);
        }
        else
        {
            if(PlayerController(Controller) != None)
                PlayerController(Controller).ReceiveLocalizedMessage(class'H2_Wraith_Message', 0);
    
            SetActiveWeapon(0);
        }
    }
    //Switch back to main gun when driver leaves.
    function UnPossessed()
    {
        Super.UnPossessed();
    
        SetActiveWeapon(0);
    }
    ////
    
    
    defaultproperties
    {
         ThrusterOffsets(0)=(X=95.000000,Z=10.000000)
         ThrusterOffsets(1)=(X=-10.000000,Y=80.000000,Z=10.000000)
         ThrusterOffsets(2)=(X=-10.000000,Y=-80.000000,Z=10.000000)
         HoverSoftness=0.220000
         HoverPenScale=1.000000
         HoverCheckDist=150.000000
         UprightStiffness=500.000000
         UprightDamping=300.000000
         MaxThrustForce=27.000000
         LongDamping=0.020000
         MaxStrafeForce=15.000000
         LatDamping=0.100000
         TurnTorqueFactor=1000.000000
         TurnTorqueMax=125.000000
         TurnDamping=40.000000
         MaxYawRate=1.500000
         PitchTorqueFactor=200.000000
         PitchTorqueMax=9.000000
         PitchDamping=20.000000
         RollTorqueTurnFactor=450.000000
         RollTorqueStrafeFactor=200.000000
         RollTorqueMax=12.500000
         RollDamping=30.000000
         StopThreshold=50.000000
         DriverWeapons(0)=(WeaponClass=Class'H2_Vehicles.H2_Wraith_Cannon',WeaponBone="Cannon")
         DriverWeapons(1)=(WeaponClass=Class'H2_Vehicles.H2_Wraith_MinigunMaster',WeaponBone="Gun_Fire_R")
         DriverWeapons(2)=(WeaponClass=Class'H2_Vehicles.H2_Wraith_Gun_Fire',WeaponBone="Gun_Fire_L")
         bHasAltFire=False
         IdleSound=Sound'Ghost.Ghost.ghost_hover'
         StartUpSound=Sound'Ghost.Ghost.ghost_in'
         ShutDownSound=Sound'Ghost.Ghost.ghost_out'
         StartUpForce="HoverBikeStartUp"
         ShutDownForce="HoverBikeShutDown"
         DestroyedVehicleMesh=ONSDeadVehicles-SM.HoverBikeDead
         DestructionEffectClass=Onslaught.ONSSmallVehicleExplosionEffect
         DisintegrationEffectClass=Onslaught.ONSVehDeathHoverBike
         DestructionLinearMomentum=(Min=62000.000000,Max=100000.000000)
         DestructionAngularMomentum=(Min=25.000000,Max=75.000000)
         DamagedEffectScale=0.600000
         DamagedEffectOffset=(X=50.000000,Y=-25.000000,Z=10.000000)
         ImpactDamageMult=0.000100
         HeadlightCoronaOffset(0)=(X=73.000000,Y=10.000000,Z=14.000000)
         HeadlightCoronaOffset(1)=(X=73.000000,Y=-10.000000,Z=14.000000)
         HeadlightCoronaMaterial=Texture'EpicParticles.Flares.FlashFlare1'
         HeadlightCoronaMaxSize=60.000000
         bDrawDriverInTP=False
         bTurnInPlace=True
         bShowDamageOverlay=True
         bScriptedRise=True
         bShowChargingBar=True
         bDriverHoldsFlag=False
         bCanCarryFlag=False
         DrivePos=(Z=130.000000)
         ExitPositions(0)=(Y=-200.000000,Z=100.000000)
         ExitPositions(1)=(Y=200.000000,Z=100.000000)
         EntryRadius=375.000000
         FPCamPos=(X=-70.000000,Z=130.000000)
         FPCamViewOffset=(X=90.000000)
         TPCamLookat=(X=-50.000000,Z=0.000000)
         TPCamWorldOffset=(Z=250.000000)
         VehiclePositionString="in a H2 Wraith Tank"
         VehicleNameString="H2 Wraith Tank"
         RanOverDamageType=Onslaught.DamTypeHoverBikeHeadshot
         CrushedDamageType=Onslaught.DamTypeHoverBikePancake
         ObjectiveGetOutDist=750.000000
         FlagBone="HoverCraft"
         FlagOffset=(Z=45.000000)
         FlagRotation=(Yaw=32768)
         HornSounds(0)=ONSVehicleSounds-S.Horns.Horn02
         HornSounds(1)=ONSVehicleSounds-S.Horns.La_Cucharacha_Horn
         bCanStrafe=True
         MeleeRange=-100.000000
         GroundSpeed=520.000000
         HealthMax=900.000000
         Health=900
         Mesh=SkeletalMesh'H2_Vehicles_A.H2_Wraith_Chassis'
         SoundRadius=900.000000
         Begin Object Class=KarmaParamsRBFull Name=KParams0
             KInertiaTensor(0)=1.300000
             KInertiaTensor(3)=4.000000
             KInertiaTensor(5)=4.500000
             KLinearDamping=0.150000
             KAngularDamping=0.000000
             KStartEnabled=True
             bHighDetailOnly=False
             bClientOnly=False
             bKDoubleTickRate=True
             bKStayUpright=True
             bKAllowRotate=True
             bDestroyOnWorldPenetrate=True
             bDoSafetime=True
             KFriction=0.500000
             KImpactThreshold=700.000000
         End Object
         KParams=KarmaParamsRBFull'H2_Vehicles.H2_Wraith_Chassis.KParams0'
    
    }



    Here is the code for H2_Wraith_Cannon.uc
    Code:
    //=============================================================================
    //
    //
    //=============================================================================
    
    class H2_Wraith_Cannon extends ONSHoverTankCannon;
    
    var()    class<FX_Turret_IonCannon_BeamFire> BeamEffectClass;
    var        float    StartHoldTime, MaxHoldTime, ShockMomentum, ShockRadius;
    var        bool    bHoldingFire, bFireMode;
    var        int        BeamCount, OldBeamCount;
    
    var    sound    ChargingSound, ShockSound;
    
    var    FX_IonPlasmaTank_AimLaser    AimLaser;
    
    replication
    {
        reliable if ( bNetDirty && !bNetOwner && Role == ROLE_Authority )
            bFireMode, BeamCount;
    }
    
    simulated function Destroyed()
    {
        KillLaserBeam();
    
        super.Destroyed();
    }
    
    function PlayFiring()
    {
        AmbientSound = None;
        PlaySound(sound'WeaponSounds.BExplosion5', SLOT_None, FireSoundVolume/255.0,,,, False);
    }
    
    function PlayChargeUp()
    {
        AmbientSound = ChargingSound;
    }
    
    function PlayRelease()
    {
        AmbientSound = None;
        PlaySound(sound'WeaponSounds.TranslocatorModuleRegeneration', SLOT_None, FireSoundVolume/255.0,,,, False);
    }
    
    simulated event FlashMuzzleFlash()
    {
        super.FlashMuzzleFlash();
    
        if ( Level.NetMode != NM_DedicatedServer )
        {
            if ( !IsAltFire() && BeamCount != OldBeamCount )
            {
                OldBeamCount = BeamCount;
                PlayAnim('Fire', 0.5, 0);
                super.ShakeView();
            }
        }
    }
    
    simulated function bool IsAltFire()
    {
        if ( Instigator.IsLocallyControlled() )
            return bIsAltFire;
    
        return bFireMode;
    }
    
    simulated function ShakeView()
    {
        if ( IsAltFire() )
            super.ShakeView();
    }
    
    simulated function float ChargeBar()
    {
        if ( bHoldingFire )
            return (FMin(Level.TimeSeconds - StartHoldTime, MaxHoldTime) / MaxHoldTime);
        else
            return 0;
    }
    
    function SpawnBeamEffect(Vector Start, Rotator Dir, Vector HitLocation, Vector HitNormal, int ReflectNum)
    {
        local FX_Turret_IonCannon_BeamFire Beam;
    
        Beam = Spawn(BeamEffectClass,,, Start, Dir);
        if (ReflectNum != 0) Beam.Instigator = None; // prevents client side repositioning of beam start
        Beam.AimAt(HitLocation, HitNormal);
    }
    
    function SpawnLaserBeam()
    {
        CalcWeaponFire();
        AimLaser = Spawn(class'FX_IonPlasmaTank_AimLaser', Self,, WeaponFireLocation, WeaponFireRotation);
    }
    
    function KillLaserBeam()
    {
        if ( AimLaser != None )
        {
            AimLaser.Destroy();
            AimLaser = None;
        }
    }
    
    simulated function UpdateLaserBeamLocation( out vector Start, out vector HitLocation )
    {
        local vector    HitNormal;
        local rotator    Dir;
    
        CalcWeaponFire();
        Start        = WeaponFireLocation;
        Dir            = WeaponFireRotation;
        HitLocation    = vect(0,0,0);
        SimulateTraceFire( Start, Dir, HitLocation, HitNormal );
        //log("UpdateLaserBeamLocation WFL:" @ WeaponFireLocation @ "WFR:" @ WeaponFireRotation
        //    @ "Start:" @ Start @ "HL:" @ HitLocation );
    }
    
    event bool AttemptFire( Controller C, bool bAltFire )
    {
        bFireMode = bAltFire;
        return super.AttemptFire( C, bAltFire );
    }
    
    state ProjectileFireMode
    {
        simulated function ClientStartFire(Controller C, bool bAltFire)
        {
            bFireMode    = bAltFire;
            bIsAltFire    = bAltFire;
            //log("ClientStartFire");
            if ( !bAltFire )
            {
                if ( Role < ROLE_Authority && FireCountdown <= 0 )
                {
                    bHoldingFire    = true;
                    StartHoldTime    = Level.TimeSeconds;
                    SetTimer( MaxHoldTime, false );
                }
                else
                    SetTimer( FireCountDown, false );    // synch to starthold matches server (done in timer)
                //super.ClientStartFire(C, bAltFire);
    
    
            }
            else
            {
                super.ClientStartFire(C, bAltFire);
            }
        }
    
        simulated function Timer()
        {
            if ( !bHoldingFire )
            {
                if ( Role < Role_Authority && !bFireMode )
                {
                    bHoldingFire    = true;
                    StartHoldTime    = Level.TimeSeconds;
                    SetTimer( MaxHoldTime, false );
                }
                return;
            }
    
            bHoldingFire    = false;
            FireCountdown    = FireInterval;
            SetTimer(FireInterval, false);
    
            if ( Role == ROLE_Authority )
            {
                KillLaserBeam();
                CalcWeaponFire();
                FlashCount++;
                PlayFiring();
    
                if ( AmbientEffectEmitter != None )
                    AmbientEffectEmitter.SetEmitterStatus( true );
    
                TraceFire(WeaponFireLocation, WeaponFireRotation);
            }
            BeamCount++;
            FlashMuzzleFlash();
        }
    
        simulated function ClientStopFire(Controller C, bool bWasAltFire)
        {
            //log("ClientStopFire");
            super.ClientStopFire(C, bWasAltFire);
    
            if ( bHoldingFire )
            {
                bHoldingFire    = false;
                FireCountdown    = FireInterval;
                ClientPlayForceFeedback("BioRifleFire");
            }
            SetTimer(0, false);
        }
    
        function Fire(Controller C)
        {
            NetUpdateTime = Level.TimeSeconds - 1;
            bFireMode = false;
            //log("Fire");
            if ( !bHoldingFire )
            {
                PlayChargeUp();
                StartHoldTime    = Level.TimeSeconds;
                bHoldingFire    = true;
                SetTimer( MaxHoldTime, false );
                SpawnLaserBeam();
            }
        }
    
        function AltFire(Controller C)
        {
            local actor        Shock;
            local float        DistScale, dist;
            local vector    dir, StartLocation;
            local Pawn        Victims;
    
            NetUpdateTime = Level.TimeSeconds - 1;
            bFireMode = true;
            //log("AltFire");
            StartLocation = Instigator.Location;
    
            PlaySound(ShockSound, SLOT_None, 128/255.0,,, 2.5, False);
    
            Shock = Spawn(class'FX_IonPlasmaTank_ShockWave', Self,, StartLocation);
            Shock.SetBase( Instigator );
    
            foreach VisibleCollidingActors( class'Pawn', Victims, ShockRadius, StartLocation )
            {
                //log("found:" @ Victims.GetHumanReadableName() );
                // don't let Shock affect fluid - VisibleCollisingActors doesn't really work for them - jag
                if( (Victims != Instigator) && (Victims.Controller != None)
                    && (Victims.Controller.GetTeamNum() != Instigator.GetTeamNum())
                    && (Victims.Role == ROLE_Authority) )
                {
    
                    dir = Victims.Location - StartLocation;
                    dir.Z = 0;
                    dist = FMax(1,VSize(dir));
                    dir = Normal(Dir)*0.5 + vect(0,0,1);
                    DistScale = 1 - FMax(0,(dist - Victims.CollisionRadius)/ShockRadius);
                    Victims.AddVelocity( DistScale * ShockMomentum * dir );
                    //Victims.Velocity = (DistScale * ShockMomentum * dir);
                    //Victims.TakeDamage(0, Instigator, Victims.Location - 0.5 * (Victims.CollisionHeight +
    
    Victims.CollisionRadius) * dir,
                    //(DistScale * ShockMomentum * dir), None    );
                    //log("Victims:" @ Victims.GetHumanReadableName() @ "DistScale:" @ DistScale );
                }
            }
        }
    
        function CeaseFire(Controller C)
        {
            //log("CeaseFire");
    
            KillLaserBeam();
    
            if ( bHoldingFire )
            {
                if ( Role == Role_Authority )
                    PlayRelease();
    
                SetTimer(0, false);
                bHoldingFire    = false;
                FireCountdown    = FireInterval;
            }
        }
    }
    
    defaultproperties
    {
         BeamEffectClass=Class'H2_Vehicles.H2_Wraith_BeamFire',WeaponBone="TankTurret")
         MaxHoldTime=2.000000
         ShockMomentum=750.000000
         ShockRadius=1792.000000
         ChargingSound=AssaultSounds.AssaultRifle.IonPowerUp
         ShockSound=ONSVehicleSounds-S.AVRiL.AvrilFire01
         RedSkin=None
         BlueSkin=None
         FireInterval=1.500000
         AltFireInterval=1.500000
         EffectEmitterClass=None
         FireSoundClass=WeaponSounds.BaseImpactAndExplosions.BExplosion5
         DamageMin=0
         DamageMax=0
         TraceRange=20000.000000
         ProjectileClass=None
         AIInfo(0)=(WarnTargetPct=0.990000,RefireRate=0.990000)
         Mesh=SkeletalMesh'H2_Vehicles_A.H2_Wraith_Cannon'
         SoundPitch=112
         SoundRadius=512.000000
    }



    Here is the code for H2_Wraith_BeamFire.uc
    Code:
    //=============================================================================
    //
    //
    //=============================================================================
    
    class H2_Wraith_BeamFire extends FX_Turret_IonCannon_BeamFire;
    
    defaultproperties
    {
         DamageType=OnslaughtFull.DamTypeIonTankBlast
    }



    Here is the code for H2_Wraith_MinigunMaster.uc for duo fire
    Code:
    //=============================================================================
    // H2_Wraith_MinigunMaster - Makes the Wraith Minigun mirror its actions.
    //=============================================================================
    class H2_Wraith_MinigunMaster extends H2_Wraith_Gun_Fire;
    
    var bool bOwnerSound;
    
    //Makes sure the second minigun is active at the same time as this one, and is aiming at the same point.
    function Tick(float Delta)
    {
        Super.Tick(Delta);
    
        if(Owner == None)
            return;
    
        ONSVehicle(Owner).Weapons[2].bActive = bActive;
        ONSVehicle(Owner).Weapons[2].CurrentHitLocation = CurrentHitLocation;
    }
    
    //Fire the second minigun at the same time as this one.
    function bool AttemptFire(Controller C, bool bAltFire)
    {
        ONSVehicle(Owner).Weapons[2].AttemptFire(C, bAltFire);
    
        return Super.AttemptFire(C, bAltFire);
    }
    
    //Makes sure effects are stopped for the second minigun.
    function CeaseFire(Controller C)
    {
        Super.CeaseFire(C);
    
        ONSVehicle(Owner).Weapons[2].CeaseFire(C);
    }
    
    simulated function ClientStopFire(Controller C, bool bWasAltFire)
    {
        Super.ClientStopFire(C, bWasAltFire);
    
        ONSVehicle(Owner).Weapons[2].ClientStopFire(C, bWasAltFire);
    }
    
    //The code down there delays the firing sound for this weapon by half the FireInterval so it plays alternately with the other slave
    
    weapon (makes it sound faster and gives a better stereo effect).
    state InstantFireMode
    {
        function Fire(Controller C)
        {
            FlashMuzzleFlash();
    
            if (AmbientEffectEmitter != None)
            {
                AmbientEffectEmitter.SetEmitterStatus(true);
            }
    
            // Play firing noise
            if (bAmbientFireSound)
                AmbientSound = FireSoundClass;
            else
            SetTimer(FireInterval * 0.5, false);
    
            TraceFire(WeaponFireLocation, WeaponFireRotation);
        }
    }
    
    simulated event OwnerEffects()
    {
        if (!bIsRepeatingFF)
        {
            if (bIsAltFire)
                ClientPlayForceFeedback( AltFireForce );
            else
                ClientPlayForceFeedback( FireForce );
        }
        ShakeView();
    
        if (Role < ROLE_Authority)
        {
            if (bIsAltFire)
                FireCountdown = AltFireInterval;
            else
                FireCountdown = FireInterval;
    
            AimLockReleaseTime = Level.TimeSeconds + FireCountdown * FireIntervalAimLock;
    
            FlashMuzzleFlash();
    
            if (AmbientEffectEmitter != None)
                AmbientEffectEmitter.SetEmitterStatus(true);
    
            // Play firing noise
            if (!bAmbientFireSound)
            {
            bOwnerSound = true;
            SetTimer(FireInterval * 0.5, false);
            }
        }
    }
    
    simulated function Timer()
    {
        if(bOwnerSound)
        {
            PlaySound(FireSoundClass, SLOT_None, FireSoundVolume/255.0,, FireSoundRadius, FireSoundPitch, False);
            bOwnerSound = false;
        }
        else
            PlayOwnedSound(FireSoundClass, SLOT_None, FireSoundVolume/255.0,, FireSoundRadius, FireSoundPitch, False);
    }
    
    defaultproperties
    {
         FireSoundPitch=1.500000
    }




    Here is the code for H2_Wraith_Gun_Fire.uc
    Code:
    //=============================================================================
    // H2_Wraith_Gun_Fire - This weapon is passive; It obeys the MinigunMaster!
    //=============================================================================
    class H2_Wraith_Gun_Fire extends ONSWeapon;
    
    function byte BestMode()
    {
        return 0;
    }
    
    defaultproperties
    {
         YawBone="Dummy_Fire"
         PitchBone="Dummy_Fire"
         PitchUpLimit=12500
         PitchDownLimit=59500
         WeaponFireAttachmentBone="Dummy_Fire"
         RotationsPerSecond=2.000000
         bInstantFire=True
         bIsRepeatingFF=True
         Spread=0.010000
         RedSkin=Texture'H2_VehiclesTX.Wraith'
         BlueSkin=Texture'H2_VehiclesTX.Wraith'
         FireInterval=0.100000
         AmbientEffectEmitterClass=Class'Onslaught.ONSRVChainGunFireEffect'
         FireSoundClass=Sound'ONSVehicleSounds-S.Tank.TankMachineGun01'
         FireSoundVolume=150.000000
         AmbientSoundScaling=0.500000
         FireForce="minifireb"
         DamageType=Class'Onslaught.DamTypeONSChainGun'
         DamageMin=9
         DamageMax=9
         TraceRange=15000.000000
         ShakeRotMag=(X=50.000000,Y=50.000000,Z=50.000000)
         ShakeRotRate=(X=10000.000000,Y=10000.000000,Z=10000.000000)
         ShakeRotTime=2.000000
         ShakeOffsetMag=(X=1.000000,Y=1.000000,Z=1.000000)
         ShakeOffsetRate=(X=1000.000000,Y=1000.000000,Z=1000.000000)
         ShakeOffsetTime=2.000000
         AIInfo(0)=(bInstantHit=True,aimerror=750.000000)
         CullDistance=8000.000000
         Mesh=SkeletalMesh'H2_Vehicles_A.Dummy_Fire'
    }



    Here is the code for H2_Wraith_Message.uc
    Code:
    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------
    class H2_Wraith_Message extends LocalMessage;
    
    static function string GetString(
        optional int Switch,
        optional PlayerReplicationInfo RelatedPRI_1,
        optional PlayerReplicationInfo RelatedPRI_2,
        optional Object OptionalObject
        )
    {
        if(Switch == 0)
            return "Artillery";
        else if(Switch == 1)
            return "Miniguns";
        else
            return "";
    }
    
    defaultproperties
    {
         bIsUnique=True
         bFadeMessage=True
         Lifetime=2
         StackMode=SM_Down
         PosY=0.800000
         FontSize=2
    }



    Here is the code for H2_Wraith_Factory.uc
    Code:
    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------
    class H2_Wraith_Factory extends ONSVehicleFactory;
    
    defaultproperties
    {
         RedBuildEffectClass=Class'Onslaught.ONSRVBuildEffectRed'
         BlueBuildEffectClass=Class'Onslaught.ONSRVBuildEffectBlue'
         VehicleClass=Class'H2_Vehicles.H2_Wraith_Chassis'
         Mesh=SkeletalMesh'H2_Vehicles_A.H2_Wraith_Chassis'
    }

    Comment


      HI guys just a quick question: anyone have an idea where from exactly is the function "ClientSetViewTarget"/"SetViewTarget"/"BecomeViewTarget" called from? Looking for the one responsible for switching the Eye position to another Pawn/Vehicle)
      Is it called from KDriverEntered, or PossessedBy, or from somewhere else, possibly native?
      This is the function that tells the player to switch it's 'camera' to the vehicle itself.
      Thx in advance!

      Comment


        From what it looks like ClientSetViewTarget calls come from other functions in the PlayerController.uc class.

        From what I can tell, the 'KDriverEnter' function in the Vehicle.uc class calls 'C.Possess(self)' on the controller to take charge of the vehicle. Possess (in the PlayerController.uc version) assign the pawn (vehicle in this case) to the controller, then calls the function 'Restart()'. This function then calls 'SetViewTarget()' and also the 'ClientRestart()' function which is replicated down to the Client's version of the controller.

        Comment


          Hey meowcat,

          For the longest time I have wanted to fire a blue plasma arch (if you know what I mean) from my wraith tank.
          Some one told me a long time ago that the HaloUT team made a H1 wraith tank, but I cant find it anywhere.
          I have looked high and low and cant find a mod that does this or something similar.
          The closest thing I found is that standard ut2004 green blob gun. It does fire the blobs in an arch, so I think it is possible.
          I just need to find out how to change its property's (I think) from blob to energy and make it bigger and fire slower.

          So, do you have any ideas how this can be done?

          Comment


            I am having trouble with a custom vehicle of mine, the problem is that when I try to steer, the vehicle just stops dead and even starts moving sideways a bit. I tried increasing the output values for MaxSteerAngleCurve, and also reducing the turn damping but I am still not able to fix it.
            My values are:

            MaxSteerAngleCurve=(Points=((OutVal=1000.000000),(InVal=300.000000,OutVal=850.000000),(InVal=500.000000,OutVal=700.000000),(InVal=600.000000,OutVal=600.000000),(InVal=1000000000.000000,OutVal=500.000000)))


            TorqueCurve=(Points=((OutVal=3/*12.000000*/),(InVal=200.000000,OutVal=6/*3.000000*/),(InVal=1500.000000,OutVal=12/*4.000000*/),(InVal=5000,OutVal=16),(InVal=7000,OutVal=20),(InVal=10000000000.000000,OutVal=0.900000)))

            GearRatios(0)=-0.200000
            GearRatios(1)=0.200000
            TransRatio=0.12//0.3//0.120000
            SteeringScaleFactor=4//0.750000//2//0.750000
            ChangeUpPoint=7000//3000.000000
            ChangeDownPoint=1000.000000

            My vehicle has only ONE forward gear.

            ChassisTorqueScale=0.095
            MinBrakeFriction=4.000000

            SteerSpeed=300 //is is the number of Unreal degrees (65536 = 360) per second that the front tires try to turn at. In almost all cases the tires turn at this rate but really it depends on SteerTorque.
            TurnDamping=25

            LSDFactor=1


            WheelSoftness=0.075
            WheelPenScale=1.5//0.9 //0.03 calculated.//2.000000 //higher =more bounce medium value 1
            WheelPenOffset=0.010000
            WheelRestitution=0.100000
            WheelInertia=0.025//0.100000
            WheelLongFrictionFunc=(Points=(,(InVal=100.000000,OutVal=1.000000),(InVal=200.000000,OutVal=0.900000),(InVal=10000000000.000000,OutVal=0.900000)))
            WheelLongSlip=0.001000
            WheelLatSlipFunc=(Points=(,(InVal=30.000000,OutVal=0.009000),(InVal=10000000000.000000)))
            WheelLongFrictionScale=1.500000
            WheelLatFrictionScale=3.000000
            WheelHandbrakeSlip=0.010000
            WheelHandbrakeFriction=0.100000
            WheelSuspensionTravel=7//10//5//15.000000
            WheelSuspensionMaxRenderTravel=15.000000
            //WheelSuspensionOffset //This is the vertical offset of the suspension. This is the number of unreal units to offset the initial position of the wheels by. Positive number will make the wheels closer to the car (more like a sports car) while negative numbers will make the wheels further below the car (like a monster truck).
            WheelSuspensionOffset=-5

            The left and right (physical) wheels are spaced at around 50-60 UUs from each other.
            Wheel Radius is 15.
            All wheels are powered.

            The vehicle is similar in size with the TC 1200 toilet car.
            Last edited by Deggenyr; 03-05-2018, 11:55 AM.

            Comment


              ut2004isdead/Max: Most of that arc-projectile effect will be in the projectile class and its effect and explosion effect class. I recommend starting with the ONSPlasmaProjectile as a base class, or maybe just subclass it. It already has similar particle effects already. To get the arcing effect, you will then need to change its Physics mode, either in the default properties or via a 'timer' call sometime after it spawns, to PHYS_Falling. You will have to learn about emitters and experiment a bit to get an effect that you like. I usually just copy and paste and Emitter effect that I like from something else into a new class, then edit it as necessary until I get something I like.

              Here is a simple subclass to start from:

              Code:
              class WraithProjectile extends ONSPlasmaProjectile;
              
              defaultproperties
              {
                  ExplosionDecal=class'LinkBoltScorch'
                  HitEffectClass=class'Onslaught.ONSPlasmaHitGreen' // <- maybe make a subclass of this, then scale everything larger
                 PlasmaEffectClass=class'Onslaught.ONSBluePlasmaFireEffect'  
                  Lifespan=5.0 //1.2
                  Speed=7000
                  MaxSpeed=7000
                  AccelerationMagnitude=0.0
                  Damage=95 //70
                  DamageRadius=350 // 240.0
                  MomentumTransfer=4000
                  Physics=PHYS_falling // Physics=PHYS_Projectile // <- changed this to have it drop
                  DrawType=DT_None
                  Style=STY_Additive
                  AmbientGlow=100
              }
              @Deggenyr: I think I've seen that before... but I don't quite remember what setting was causing it. You can use 'code' tags by putting the word 'code' in place of the word brackets like this [brackets] code paste goes here [/brackets], to make your default properties paste show up in the forum as a code block (easier to read).

              I have a small ATV vehicle in my own mod that works fairly well, here are the default properties for comparison. I've noticed that small karma physics vehicle seem to behave "squirrely", I don't know if that is just because the forces then applied to them can so easily perturb them or what, just that they seem to get wonky pretty easily. I bumped up the mass of my ATV (to almost half the HellBender's) in a partially successful effort to have be less "bouncy". The other thing to keep track of is where the Vehicle's center of mass is located (it can be adjusted by the Offset in the KarmaParams properties, or by physically shifting the model's center point), and how its collision boxes and wheel traces are interacting, good debug commands can be found here, and here is the old psyonix svehicle tutorial (highly recommend downloading offline copies of these webpages, and any of these UDN2 ones.... they probably won't be around for much longer considering they are already 14+ years old).
              Code:
              defaultproperties
              {
              ...
              
                  DrawScale=1.0
                  DrawScale3D=(X=1.0,Y=1.0,Z=1.0)
                  CollisionRadius=85.0
                  bDoStuntInfo=true
              
                  AirTurnTorque=35.0
                  AirPitchTorque=55.0
                  AirPitchDamping=35.0
                  AirRollTorque=35.0
                  AirRollDamping=35.0
                  bHasHandbrake=true
              
              ....
              
                  StartUpForce="RVStartUp"
                  ShutDownForce="PRVShutDown"
              
                  SteerBoneName="Steering"
                  SteerBoneAxis=AXIS_Z
                  SteerBoneMaxAngle=-25
              
               ....
              
                  WheelPenScale=1.2
                  WheelPenOffset=0.01
                  WheelSoftness=0.025
                  WheelRestitution=0.1
                  WheelAdhesion=0.0
                  WheelLongFrictionFunc=(Points=((InVal=0,OutVal=0.0),(InVal=100.0,OutVal=1.0),(InVal=200.0,OutVal=0.9),(InVal=10000000000.0,OutVal=0.9)))
                  WheelLongFrictionScale=1.1
                  WheelLatFrictionScale=1.35
                  WheelLongSlip=0.001
                  WheelLatSlipFunc=(Points=((InVal=0.0,OutVal=0.0),(InVal=30.0,OutVal=0.009),(InVal=45.0,OutVal=0.00),(InVal=10000000000.0,OutVal=0.00)))
                  WheelHandbrakeSlip=0.01
                  WheelHandbrakeFriction=0.1
                  WheelSuspensionTravel=5.0
                  WheelSuspensionOffset=-4.0
                  WheelSuspensionMaxRenderTravel=5.0
                  TurnDamping=35
              
                  HandbrakeThresh=200
                  FTScale=0.03
                  ChassisTorqueScale=0.08
              
                  MinBrakeFriction=4.0
                  MaxBrakeTorque=20.0
                  MaxSteerAngleCurve=(Points=((InVal=0,OutVal=45),(InVal=600.0,OutVal=25.0),(InVal=1100.0,OutVal=10.0),(InVal=1300.0,OutVal=6.0),(InVal=1600.0,OutVal=1.0)))
                  SteerSpeed=160
                  StopThreshold=100
                  TorqueCurve=(Points=((InVal=0,OutVal=9.0),(InVal=200,OutVal=10.0),(InVal=1500,OutVal=11.0),(InVal=2800,OutVal=0.0)))
                  EngineBrakeFactor=0.0001
                  EngineBrakeRPMScale=0.1
                  EngineInertia=0.1
                  WheelInertia=0.1
              
                  TransRatio=0.15
                  GearRatios[0]=-0.5
                  GearRatios[1]=0.4
                  GearRatios[2]=0.65
                  GearRatios[3]=0.85
                  GearRatios[4]=1.1
                  ChangeUpPoint=2000
                  ChangeDownPoint=1000
                  LSDFactor=1.0
              
                  VehicleMass=1.9 //was 1.1
              
                  Begin Object Class=KarmaParamsRBFull Name=KParams0
                      KStartEnabled=True
                      KFriction=0.5
                      KLinearDamping=0.05
                      KAngularDamping=0.05
                      KImpactThreshold=700
                      bKNonSphericalInertia=True
                      bHighDetailOnly=False
                      bClientOnly=False
                      bKDoubleTickRate=True
                      KInertiaTensor(0)=1.0
                      KInertiaTensor(1)=0.0
                      KInertiaTensor(2)=0.0
                      KInertiaTensor(3)=3.0
                      KInertiaTensor(4)=0.0
                      KInertiaTensor(5)=3.0
                      KCOMOffset=(X=0.0,Y=0.0,Z=-0.3)
                      bDestroyOnWorldPenetrate=True
                      bDoSafetime=True
                      Name="KParams0"
                  End Object
                  KParams=KarmaParams'KParams0'
              
                  Begin Object Class=SVehicleWheel Name=RRWheel
                      BoneName="RRgtTire"
                      BoneRollAxis=AXIS_Y
                      BoneSteerAxis=AXIS_Z
                      BoneOffset=(X=0.0,Y=0.0,Z=0.0)
                      WheelRadius=16
                      bPoweredWheel=True
                      bHandbrakeWheel=True
                      SteerType=VST_Fixed
                      SupportBoneName=""
                      SupportBoneAxis=AXIS_X
                  End Object
                  Wheels(0)=SVehicleWheel'RRWheel'
              
                  Begin Object Class=SVehicleWheel Name=LRWheel
                      BoneName="RLftTire"
                      BoneRollAxis=AXIS_Y
                      BoneSteerAxis=AXIS_Z
                      BoneOffset=(X=0.0,Y=0.0,Z=0.0)
                      WheelRadius=16
                      bPoweredWheel=True
                      bHandbrakeWheel=True
                      SteerType=VST_Fixed
                      SupportBoneName=""
                      SupportBoneAxis=AXIS_X
                  End Object
                  Wheels(1)=SVehicleWheel'LRWheel'
              
                  Begin Object Class=SVehicleWheel Name=RFWheel
                      BoneName="FRgtTire"
                      BoneRollAxis=AXIS_Y
                      BoneSteerAxis=AXIS_Z
                      BoneOffset=(X=0.0,Y=0.0,Z=0.0)
                      WheelRadius=16
                      bPoweredWheel=True
                      SteerType=VST_Steered
                      SupportBoneName=""
                      SupportBoneAxis=AXIS_X
                  End Object
                  Wheels(2)=SVehicleWheel'RFWheel'
              
                  Begin Object Class=SVehicleWheel Name=LFWheel
                      BoneName="FLftTire"
                      BoneRollAxis=AXIS_Y
                      BoneSteerAxis=AXIS_Z
                      BoneOffset=(X=0.0,Y=0.0,Z=0.0)
                      WheelRadius=16
                      bPoweredWheel=True
                      SteerType=VST_Steered
                      SupportBoneName=""
                      SupportBoneAxis=AXIS_X
                  End Object
                  Wheels(3)=SVehicleWheel'LFWheel'
              
                  GroundSpeed=920
                  bDriverHoldsFlag=false
              }
              Last edited by meowcatbuf; 03-05-2018, 09:47 PM.

              Comment


                I am having a problem getting my vehicles into a total conversion mod.
                The TC mod is in a folder called Halo_1, I was able to run my custom maps from the Halo_1 folder
                but when I try to compile my vehicles in that folder I get this error.

                Code:
                Init: Base directory: C:\UT2004\System\
                
                Heading: ------------------------H1_Vehicles - Release-------------------------
                Warning: Failed to load 'H1_Vehicles.u': Can't find file 'H1_Vehicles.u'
                Warning: Failed loading package: Can't find file 'H1_Vehicles.u'
                Log: Analyzing...
                Critical: Can't find files matching H1_Vehicles\Classes\*.uc
                Exit: Executing UObject::StaticShutdownAfterError
                Critical: UMakeCommandlet::Main
                Exit: Exiting.
                Do I need to put all files in one folder to compile or do something different?

                Comment


                  Hi Maxx, I had my mod running in its own folder using UT2K4's mod system at one time, but I don't know if I ever actually compiled anything in that folder. I think I compiled the .u files normally in the UT200/System directory and then just moved them to the other folder afterwards. I think you can specify extra folder paths in the .ini file so that the compiler can check other folders... but its been over ten years since I tired that.

                  These two old links over at the UDN2 may help
                  PublicModResource
                  Improved Mod Support

                  Comment


                    The link you gave me fixed the problem.
                    Now I have vehicles in my mod.

                    I changed the folder paths on the MyMod.ini inside of the MyMod folder.

                    Paths=../MyMod/Animations/*.ukx
                    Paths=../MyMod/Help/*.ukx
                    Paths=../MyMod/Maps/*.ut2
                    Paths=../MyMod/Music/*.umx
                    Paths=../MyMod/Sounds/*.uax
                    Paths=../MyMod/StaticMeshes/*.uax
                    Paths=../MyMod/System/*.u
                    Paths=../MyMod/Textures/*.utx

                    Then I made a shortcut to UnrealEd and in the properties/target I add this command line
                    C:\UT2004\System\unrealed.exe -mod=MyMod

                    Then I was able to add vehicles to my mod maps.

                    Thanks meowcatbuf

                    ------------------------
                    One other thing:

                    In the "UDN - Two - ImprovedModSupport" link under the script packages section,
                    it mentions the MyModGUI but it does not tell you how you create one.
                    Is there a way to copy the ut2004 menu/gui code and textures so I can create a custom menu/gui in the MyMod folder?

                    Comment


                      Yeah, there was a way to do that (a bunch of the TC mods had their own really slick looking menus), but I don't quite recall how. You usually ended up having to edit all of the little GUI textures yourself (to make them your preferred color as I recall), but the I think it was just a couple of classes.

                      When I'd worked on my own TC mod, I used a simple "base mod" that someone had put together for other to use and build on, I recall it being pretty straight forward to setup. I'll see if I can find the zip file.

                      Comment


                        Originally posted by meowcatbuf
                        a bunch of the TC mods had their own really slick looking menus
                        I know what you mean, a TC mod called "The Soul Keeper" has a 3d animated background. I would love to know how to do that.
                        But for now I would be happy with just a copy of the ut2004 menu running on my mod (with a different background image of course)

                        Comment

                        Working...
                        X