Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Vehicle Scripting Part 2

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

    Vehicle Scripting Part 2

    ey up

    heres a guide that will cover the nuts and bolts of vehicle scripting. if you have already gone through "Inside the Scorpion" and Geodav's tutorials you should have a working vehicle of your own and a basic understanding of UDK vehicles.
    But whats actually going on inside? lets find out

    Player Interaction
    your player controller is responsible for handling this. look at PlayerController.uc

    Getting in and out the vehicle
    when you press use ("E" by default), PerformedUseAction() is called.
    inside that function you have this
    Code:
    PerformedUseAction()
    {
            // leave vehicle if currently in one
    	if( Vehicle(Pawn) != None )
    	{
    		return Vehicle(Pawn).DriverLeave(false);
    	}
    
    	// try to find a vehicle to drive
    	if( FindVehicleToDrive() )
    	{
    		return true;
    	}
    so this means if you are not already in a vehicle, it tries to find one by calling FindVehicleToDrive().
    this function checks for near by vehicles, preferably one the player is facing. if one is found it calls TryToDrive(Pawn) on the vehicle, passing the player pawn to that function. TryToDrive() eventually leads to the player driving the vehicle, follow the logic in that function for more info.

    if you are already in a vehicle, it calls DriverLeave() on that vehicle. pretty self explanitory.

    Seats
    TryToDrive() is defined in Vehicle.uc and basically just posseses the vehicle with your player controller.
    if you want seats, meaning you can have passengers and weapons, they are defined UDKVehicle.uc
    Code:
    /**	The VehicleSeat struct defines each available seat in the vehicle. */
    struct native VehicleSeat
    this struct contains variables for the weapon, seatpawn, camera and other things. you can have as many seats as you want because of the Seats array. Seats[0] is the driver.
    Code:
    /** information for each seat a player may occupy
     * @note: this array is on clients as well, but SeatPawn and Gun will only be valid for the client in that seat
     */
    var(Seats)	array<VehicleSeat> 	Seats;
    just add them in the vehicles DefaultProperties, here is the scorpions as an example
    Code:
    Seats(0)={(	GunClass=class'UTVWeap_ScorpionTurret',
    				GunSocket=(TurretFireSocket),
    				GunPivotPoints=(gun_rotate),
    				TurretVarPrefix="",
    				TurretControls=(TurretRotate),
    				SeatIconPos=(X=	0.415,Y=0.5),
    				CameraTag=GunViewSocket,
    				CameraBaseOffset=(X=-50.0),
    				CameraOffset=-175,
    				WeaponEffects=((SocketName=TurretFireSocket,Offset=(X=-14,Y=5),Scale3D=(X=2.0,Y=3.0,Z=3.0)),(SocketName=TurretFireSocket,Offset=(X=-14,Y=-5),Scale3D=(X=2.0,Y=3.0,Z=3.0)))
    				)}
    so a vehicle with 2 seats would also have Seats(1) in the defaults, and so on for as many seats as you like, Seats(2), Seats(3) ect..
    incidentally the animation, or sitting pose is defined in the defaults as DrivingAnim

    you can change seats while in the vehicle, this is defined in UDKVehicleBase.uc
    Code:
    /** 
      *  Use the SwitchWeapon binding (number keys bound on keyboard by default)
      *  to switch seats when in a multi-seat vehicle.
      */
    simulated function SwitchWeapon(byte NewGroup)
    {
    	ServerChangeSeat(NewGroup-1);
    }
    Controlling the vehicle
    when you are driving a vehicle, your player controller goes into state PlayerDriving.
    in that state there is:
    function ProcessDrive(float InForward, float InStrafe, float InUp, bool InJump)
    this takes the user input (from PlayerInput.uc) and passes it to the vehicle by calling SetInputs() on the vehicle.
    Code:
    function ProcessDrive(float InForward, float InStrafe, float InUp, bool InJump)
    {
    .....
    CurrentVehicle.SetInputs(InForward, -InStrafe, InUp);
    SetInputs() function is defined in Vehicle.uc
    Code:
    simulated function SetInputs(float InForward, float InStrafe, float InUp)
    {
    	Throttle = InForward;
    	Steering = InStrafe;
    	Rise = InUp;
    }
    Throttle, Steering and Rise are handled natively through the SimObject

    #2
    Physics and Sim Objects

    a vehicle by default has PHYS_RigidBody, set in SVehicle.uc default properties
    Code:
    Physics=PHYS_RigidBody
    this means it has rigid body physics, the shape of the physics object is defined in the vehicles Physics Asset, and the weight and friction ect is defined in the physics asset's Physical Material
    the physics asset, skelital mesh, morph targets and animations are set in the vehicles SVehicleMesh first declared in SVehicle.uc
    Code:
    Begin Object Class=SkeletalMeshComponent Name=SVehicleMesh
    look at the scorpion or any of the other UT vehicles for an example.

    SimObject
    if you have a vehicle with an SVehicleMesh and a physics asset, you can get in and out but it wont drive anywhere.
    this is because it has no SimObject.
    a SimObject is a native physics simulation added as a component to the vehicle that takes the input from SetInputs() to make it move and react in a particular way.
    eg
    Code:
    Begin Object Class=UDKVehicleSimCar Name=SimObject
    in that object there are lots of settings you can play with to make it move in the way you want
    the base class is SVehicleSimBase.uc, there are a few native (meaning the workings are hidden from us) sim objects we can use.
    SVehicleSimCar
    SVehicleSimTank
    UDKVehicleSimCar
    UDKVehicleSimChopper
    UDKVehicleSimHover
    UDKVehicleSimHoverboard

    you dont need to have a sim object but they are usefull if you are making a 'normal' vehicle.
    if you dont want any of those you could for example overide SetInputs() and add forces, as in this example .

    Wheels
    certain sim objects work in conjunction with wheel objects, such as SimCar, SimTank and even SimHover.
    a wheel object is merely a visual representation and does not play any real part in the physics.
    it tells the sim object if the wheel is on the ground and has parameters for grip ect.
    you can have as many wheels as you like by adding them to the Wheels array in the vehicles DefaultProperties
    declared in SVehicle
    Code:
    /** Data for each wheel. */
    var() editinline export		array<SVehicleWheel>	Wheels;
    add the wheels in the same manner as the seats, eg Wheels(0), Wheels(1)...
    Code:
    Begin Object Class=UDKVehicleWheel Name=RRWheel
            BoneName="B_R_Tire"
            BoneOffset=(X=0.0,Y=20.0,Z=0.0)
            LongSlipFactor=1.8
            LatSlipFactor=2.1
            SkelControlName="B_R_Tire_Cont"
        End Object
        Wheels(0)=RRWheel
    hover vehicles have wheels that are not skinned to any part of the mesh and therefore invisible.
    for example the UT Manta has 3 'hover' wheels offset from the main bone in the vehicle. there is no difference in terms of script apart from being able ride on top of water volumes. and thats only a single variable changed to true.
    Code:
    var()		bool				bHoverWheel;  // Determines whether this wheel will collide with water
    Upright Constraints
    defined in Svehicle, upright constraints act on the vehicle to keep it upright. usefull for standard flying and hovering vehicles.
    Code:
    // Stay-upright constraint
    	Begin Object Class=RB_StayUprightSetup Name=MyStayUprightSetup  --- /** Use the stay-upright world constraint */
    and activated with this bool
    Code:
    var(UprightConstraint)      bool                    bStayUpright;
    you can set the forces involved in default properties of the vehicle
    eg
    Code:
    UprightLiftStrength = 225.0;
    UprightTorqueStrength = 50.0;

    Comment


      #3
      ill leave it there for now as i think most of the important things are covered.
      let me know if theres any other aspect of vehicle scripting you want to know about.

      questions, comments?

      Comment


        #4
        Thanks for this TEgleg. I need to know how vehicles work (tanks particularly) so I can make them work as I want. It's good of you to offer your perspective and also links that helped you understand vehicles. Nice work.

        Comment


          #5
          I'm designing a rideable horse now, and I based it off pawn and it works pretty good, but there are a few bugs. Is this the best way to do it? Should I base it off vehicle instead? How does a vehicle keep moving after you let go of the forward button? Thank you!

          Comment


            #6
            Hello tegg its me again, I used you Escort to modify the code, I am liking it but there is one problem.

            How can I avoid the car from doing a 180/360 turn because of holding for some seconds the A or D while accelerating? I tested you Playground game, and the Lancia Delta works pretty good, I wanted something like that for my game (a Scud Race/Super GT Arcade game like).

            Comment


              #7
              its a case of tuning it to your liking, i can give you the code values for that car but with a different mesh it will behave differently. the shape and size of a car, as in real life, will dictate the kind of handling you will get.
              heres the handling related parts anyway so you know what to mess with
              Code:
              //in the sim car object
              // Longitudinal tire model based on 10% slip ratio peak
              		WheelLongExtremumSlip=0.1
              		WheelLongExtremumValue=1.0
              		WheelLongAsymptoteSlip=1.0
              		WheelLongAsymptoteValue=0.6
              
              		// Lateral tire model based on slip angle (radians)
                 		WheelLatExtremumSlip=0.35     // 20 degrees
              		WheelLatExtremumValue=0.9
              		WheelLatAsymptoteSlip=8.30     // 80 degrees
              		WheelLatAsymptoteValue=0.9
              
              //in the wheel objects
              LongSlipFactor=1.4
              LatSlipFactor=2.0
              WheelLatAsymptotexxx comes in to play at large sideways angles, tweaking that is the key to holding a drift

              Comment


                #8
                Originally posted by tegleg View Post
                its a case of tuning it to your liking, i can give you the code values for that car but with a different mesh it will behave differently. the shape and size of a car, as in real life, will dictate the kind of handling you will get.
                heres the handling related parts anyway so you know what to mess with
                Code:
                //in the sim car object
                // Longitudinal tire model based on 10% slip ratio peak
                		WheelLongExtremumSlip=0.1
                		WheelLongExtremumValue=1.0
                		WheelLongAsymptoteSlip=1.0
                		WheelLongAsymptoteValue=0.6
                
                		// Lateral tire model based on slip angle (radians)
                   		WheelLatExtremumSlip=0.35     // 20 degrees
                		WheelLatExtremumValue=0.9
                		WheelLatAsymptoteSlip=8.30     // 80 degrees
                		WheelLatAsymptoteValue=0.9
                
                //in the wheel objects
                LongSlipFactor=1.4
                LatSlipFactor=2.0
                WheelLatAsymptotexxx comes in to play at large sideways angles, tweaking that is the key to holding a drift
                Didn't work, in fact I never knew to use the WheelLatAsymptotexxx because I never saw changes in the steering , but did the Lancia Delta (Integrale 16v Evoluzione 90-92?) used the same code as Escort but with those changes in the sim car and wheel objects?

                My problem is that after you get a high speed, the car will easily make a 180/360 turn if you press the A or D for a few seconds and then release it, unless you do the opposite turn to avoid it, but it sounds like a delay, it doesn't happen with the Delta in the Playground, in fact I can see that in the high speed he won't be even able to do no more than a 40 angle curve (I guess).



                I am talking BS, but does UDK uses an kinda of Luck Based physics for vehicles? The size as you reffer, is from the model in the 3D modeller (Maya in my case)? Or is from the DrawScale?

                Comment


                  #9
                  you have to tune the values to your model, this happens in real life to real cars. try putting your foot down and turning in a real car and it will do just that unless you put in some opposite lock.
                  the lancia is short and wide and therefore handles like a short wide car.

                  is the main bone right in the centre of the 4 wheels?

                  try increasing WheelLatAsymptoteSlip and LatSlipFactor

                  Comment


                    #10
                    Originally posted by tegleg View Post
                    you have to tune the values to your model, this happens in real life to real cars. try putting your foot down and turning in a real car and it will do just that unless you put in some opposite lock.
                    the lancia is short and wide and therefore handles like a short wide car.

                    is the main bone right in the centre of the 4 wheels?

                    try increasing WheelLatAsymptoteSlip and LatSlipFactor

                    Well, I did increase the LongSlipFactor=3.0
                    LatSlipFactor=3.5

                    And now it works fine on the right side (not doing the 180/360 turn), but the left side will flip LOL.

                    Decided to reuse the UTVehicle as the extension again.

                    Code:
                    class MyVehicle_S10_Base extends UTVehicle;
                    
                    /** Som da buzina */
                    var AudioComponent HooterSound;
                    
                    /** Determeina se as luzes do veículo estão acesas */
                    var bool LighsOn;
                    
                    /** Internal variable.  Maintains brake light state to avoid extraMatInst calls.	*/
                    var bool bBrakeLightOn;
                    
                    /** material parameter que controla as luzes de freio */
                    var name BrakeLightParameterName;
                    
                    /** material parameter dos farois */
                    var name LanternName;
                    
                    /** If true, steering is very limited (enabled while boosting) */
                    var		bool	bSteeringLimited;
                    
                    /** Sound played whenever Suspension moves suddenly */
                    var SoundCue SuspensionShiftSound;
                    
                    /** luzes dinamicas do faról do veículo */
                    var	SpotLightComponent LeftBoosterLight, RightBoosterLight;
                    
                    // atualizado o tempo todo
                    function Tick(float DeltaSeconds)
                    {
                    	local bool bSetBrakeLightOn;
                    
                    	// checa se o veículo está parado
                    	if(((OutputBrake > 0.0) || bOutputHandbrake) && (VSizeSq(Velocity) > 4.0))
                    	{
                    		bSetBrakeLightOn = true;
                    		if (!bBrakeLightOn)
                    		{
                    			bBrakeLightOn = TRUE;
                    			if(DamageMaterialInstance[0] != None)
                    			{
                    				DamageMaterialInstance[0].SetScalarParameterValue(BrakeLightParameterName, 60.0 );
                    			}
                    		}
                    	}
                    
                    	if (bBrakeLightOn && !bSetBrakeLightOn)
                    	{
                    		bBrakeLightOn = false;
                    		if(DamageMaterialInstance[0] != None)
                    		{
                    			DamageMaterialInstance[0].SetScalarParameterValue(BrakeLightParameterName, 0.0 );
                    		}
                    	}
                    }
                    
                    // função executada quando o veículo nasce no jogo
                    simulated function PostBeginPlay()
                    {
                    	Super.PostBeginPlay();
                    
                    	if(SimObj.bAutoDrive)
                    	{
                    		SetDriving(true);
                    	}
                    
                    	if(HooterSound != none)
                    	{
                    		HooterSound.bShouldRemainActiveIfDropped = true;
                    	}
                    }
                    
                    // função de quando o personagem sai do veículo
                    function DriverLeft()
                    {
                    	super.DriverLeft();
                    	LeftBoosterLight.SetEnabled(false);
                    	RightBoosterLight.SetEnabled(false);
                    	if(DamageMaterialInstance[0] != None)
                    	{
                    		DamageMaterialInstance[0].SetScalarParameterValue(LanternName, 1.0 );
                    	}
                    }
                    
                    // Insere a camera no veiculo (sem socket)
                    
                    simulated function bool CalcCamera(float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV)
                    {
                    	local vector X, Y, Z;
                    
                    	GetActorEyesViewPoint( out_CamLoc, out_CamRot );
                    
                    	GetAxes(Rotation,X,Y,Z);
                    
                    	// Empurra para trás em X 
                    	out_CamLoc = Location - 430 * X;
                    	// Sobe um pouco em Z 
                    	out_CamLoc.Z = Location.Z + 100;
                    
                        // Rotação em Y da camera = Rotação em Y do veiculo
                    	out_CamRot.Yaw = Rotation.Yaw;
                    	//  Um pouco para baixo
                    	out_CamRot.Pitch = (-11.0f     *DegToRad) * RadToUnrRot;
                    	// Retire a linha abaixo se desejar que a camera gire livre em relação ao veículo
                    	out_CamRot.Roll = 0;
                    	return true;
                    }
                    
                    // função que troca o comando de pulo para acender os faróis
                    simulated function SetInputs(float InForward, float InStrafe, float InUp)
                    {
                    	local bool InJump;
                    
                    	InJump = UTPlayerController(Controller).bPressedJump;
                    	Throttle = InForward;
                    	Steering = InStrafe;
                    	Rise = Clamp(InUp, -1, 0);
                    	
                    	if(InJump == true)
                    	{
                    		if(LighsOn == false)
                    		{
                    			Mesh.AttachComponentToSocket(LeftBoosterLight, 'Lantern01');
                    			Mesh.AttachComponentToSocket(RightBoosterLight, 'Lantern02');
                    			LeftBoosterLight.SetEnabled(TRUE);
                    			RightBoosterLight.SetEnabled(TRUE);
                    			LighsOn = true;
                    			if(DamageMaterialInstance[0] != None)
                    			{
                    				DamageMaterialInstance[0].SetScalarParameterValue(LanternName, 120.0 );
                    			}
                    		}
                    
                    		else
                    		{
                    			LeftBoosterLight.SetEnabled(false);
                    			RightBoosterLight.SetEnabled(false);
                    			LighsOn = false;
                    			if(DamageMaterialInstance[0] != None)
                    			{
                    				DamageMaterialInstance[0].SetScalarParameterValue(LanternName, 1.0 );
                    			}
                    		}
                    	}
                    	 UTVWeap_ScorpionTurret(Weapon).CrosshairImage = none;
                    }
                    
                    // substitui o tiro da arma
                    simulated function bool OverrideBeginFire(byte FireModeNum)
                    {
                    	// se o tipo de tiro for o primeiro
                    	if(FireModeNum == 0)
                    	{
                    		HooterSound.FadeIn(0.35, 1);             // cria um fade in no som
                    		HooterSound.Play();                    // inicia o som da buzina
                    
                    		return true;
                    	}
                    
                    	return false;
                    }
                    
                    // substitui o fim do tiro
                    simulated function bool OverrideEndFire(byte FireModeNum)
                    {
                    	// se o tipo de tiro for o primeiro
                    	if (FireModeNum == 0)
                    	{
                    		HooterSound.FadeOut(0.35, 1);           // cria um fade out no som
                    		HooterSound.Stop();                     // para o som da buzina
                    		
                    		return true;
                    	}
                    
                    	return false;
                    }
                    
                    // desativa a partícula de fumaça do veículo depois de explodir
                    simulated function SetBurnOut()
                    {
                    	Super.SetBurnOut();
                    
                    	if( DeathExplosion != none )
                    	{
                    		DeathExplosion.ParticleSystemComponent.DeactivateSystem();
                    	}
                    
                    	VehicleEvent( 'NoDamageSmoke' );
                    }
                    
                    defaultproperties
                    {
                        Health=9999999                                 // HP do veículo
                    
                        COMOffset=(x=0.0,y=0.0,z=-53.0)         // local do centro de massa do veiculo
                    	UprightLiftStrength=160.0                 // força de elevação aplicada ao veículo quando ele sai do chão
                    	UprightTime=1.25                          // tempo em segundos em que a força de elevação ou rotação é aplicada
                    	UprightTorqueStrength=500.0               // força de rotação aplicada ao veículo quando ele sai do chão
                    	bCanFlip=false                              // indica se será possível desvirar o carro quando está de cabeça para baixo
                    	GroundSpeed=95000
                    	AirSpeed=4000
                    	bHasHandbrake=true
                    	ObjectiveGetOutDist=1500.0
                    	MaxDesireability=0.4
                    	HeavySuspensionShiftPercent=0.0f;
                    	bLookSteerOnNormalControls=true
                    	bLookSteerOnSimpleControls=true
                    	LookSteerSensitivity=3.5 (Sensividade da direção)
                    	LookSteerDamping=0.07
                    	ConsoleSteerScale=1.1
                    	DeflectionReverseThresh=-0.3
                    	bStickDeflectionThrottle=true
                    
                    	Begin Object Class=UDKVehicleSimCar Name=SimObject
                    		WheelSuspensionStiffness=160.0              // controla a rigidez da suspensão 
                    		WheelSuspensionDamping=3.0                  // controla o amortecimento da suspensão (quanto maior o valor, menor a oscilação da suspenção)
                    		WheelSuspensionBias=0.1                    // offset aplicado à posição de equilíbrio para a suspensão
                    		ChassisTorqueScale=0.0
                    		MaxBrakeTorque=50.0                          // força aplicada no veículo para parar de girar quando freia em uma curva
                    		StopThreshold=110                           // tempo em que o veículo para quando para de acelerar
                    		
                    		MaxSteerAngleCurve=(Points=((InVal=0,OutVal=45),(InVal=600.0,OutVal=35.0),(InVal=1500.0,OutVal=25.0),(InVal=2500.0,OutVal=18.0),(InVal=3500.0,OutVal=10.0))) //InVal = Velocidade maxima do veiculo na marcha,  
                    		//OutVal = posição da roda que estara na velocidade (EX: InVal=1300.0,OutVal=70.0: 70 é angulo de 70 graus da roda na velocidade 1300)
                    		SteerSpeed=130                      // determina o tempo de resposta da direção do carro
                    
                    		LSDFactor=0.0
                    		TorqueVSpeedCurve=(Points=((InVal=-600.0,OutVal=0.0),(InVal=-100.0,OutVal=280.0),(InVal=0.0,OutVal=2500.0),(InVal=4500.0,OutVal=6000.0),(InVal=6050.0,OutVal=10000.0),(InVal=9150.0,OutVal=0.0)))
                    		EngineRPMCurve=(Points=((InVal=-500.0,OutVal=250.0),(InVal=0.0,OutVal=500.0),(InVal=5490.0,OutVal=3500.0),(InVal=5500.0,OutVal=10000.0),(InVal=8490.0,OutVal=15000.0),(InVal=8500.0,OutVal=20000.0),(InVal=11000.0,OutVal=25000.0)))
                    		
                    		EngineBrakeFactor=0.025
                    		ThrottleSpeed=100000.25                 // velocidade em que o veículo aumenta a velocidade até chegar a velocidade máxima
                    		WheelInertia=0.2                    // determina a massa da roda (quando mais pesada, mais difícil de girar)
                    		NumWheelsForFullSteering=4          // número de rodas que encostam no chão, para não reduzir a direção
                    		SteeringReductionFactor=0.0         // fator de redução de direção, quando tem rodas no ar (para tornar o veículo mais fácil de dirigir)
                    		SteeringReductionMinSpeed=100000.0    // velocidade em que a redução de direção começa
                    		SteeringReductionSpeed=110000.0       // velocidade em que a redução de direção tem efeito total
                    		bAutoHandbrake=false                 // ativa o freio de mão quando as rodas de um lado estão fora do chão
                    		bClampedFrictionModel=true          // controla a força de fricção aplicada nas rodas, para tornar o veículo mais realista
                    		FrontalCollisionGripFactor=0.18     // reduz o atrito das rodas no solo
                    		ConsoleHardTurnGripFactor=1.0       // reduz o atrito quando o veículo faz a curva bruscamente (de 0 a 1)
                    		HardTurnMotorTorque=-1000.0             // quanto menor o valor, diminui a aceleração em curvas
                    		MinHardTurnSpeed=99999.0
                    
                    		SpeedBasedTurnDamping=20.0          // controla o amortecimento da suspensão em uma curva (quanto maior o valor, menor a oscilação da suspenção) (complica mais a curva)
                    		AirControlTurnTorque=90.0           // controle de curva quando o veículo está no ar
                    		InAirUprightMaxTorque=15.0          // força de giro máxima que pode ser aplicada no veículo quando está no ar 
                    		InAirUprightTorqueFactor=-30.0      // força aplicada quando o veículo está no ar, para tentar mantê-lo na horizontal
                    
                    		// controla o quanto as rodas do veículo escorregam
                    		WheelLongExtremumSlip=0.1
                    		WheelLongExtremumValue=1.0
                    		WheelLongAsymptoteSlip=2.0
                    		WheelLongAsymptoteValue=0.6
                    
                    		// controla o quanto as rodas do veículo escorregam na curva
                       		WheelLatExtremumSlip=0.35
                    		WheelLatExtremumValue=0.9
                    		WheelLatAsymptoteSlip=8.4
                    		WheelLatAsymptoteValue=0.9
                    
                    		bAutoDrive=false                    // determina se o veículo vai andar sozinho
                    		AutoDriveSteer=0.3                  // controle da direção automática
                    	End Object
                    	SimObj=SimObject
                    	Components.Add(SimObject)
                    
                    	/** cria o controle de rodas do veículo */
                    	Begin Object Class=UTVehicleScorpionWheel Name=RRWheel
                    		BoneName="B_R_Tire"                                   // nome da joint da roda
                    		BoneOffset=(X=0.0,Y=20.0,Z=0.0)                      // posição da roda
                    			LongSlipFactor=3.0
                    		LatSlipFactor=3.5
                    		SkelControlName="B_R_Tire_Cont"                       // nome do SkelControl da roda (no AnimTree)
                    	End Object
                    	Wheels(0)=RRWheel
                    
                    	Begin Object Class=UTVehicleScorpionWheel Name=LRWheel
                    		BoneName="B_L_Tire"
                    		BoneOffset=(X=0.0,Y=-20.0,Z=.0)
                    			LongSlipFactor=3.0
                    		LatSlipFactor=3.5
                    		SkelControlName="B_L_Tire_Cont"
                    	End Object
                    	Wheels(1)=LRWheel
                    
                    	Begin Object Class=UTVehicleScorpionWheel Name=RFWheel
                    		BoneName="F_R_Tire"
                    		BoneOffset=(X=0.0,Y=20.0,Z=.0)
                    		SteerFactor=1.0
                    			LongSlipFactor=3.0
                    		LatSlipFactor=3.5
                    		HandbrakeLongSlipFactor=0.8
                    		HandbrakeLatSlipFactor=0.5
                    		SkelControlName="F_R_Tire_Cont"
                    		bPoweredWheel = true;
                    	End Object
                    	Wheels(2)=RFWheel
                    
                    	Begin Object Class=UTVehicleScorpionWheel Name=LFWheel
                    		BoneName="F_L_Tire"
                    		BoneOffset=(X=0.0,Y=-20.0,Z=.0)
                    		SteerFactor=1.0
                    			LongSlipFactor=3.0
                    		LatSlipFactor=3.5
                    		HandbrakeLongSlipFactor=0.8
                    		HandbrakeLatSlipFactor=0.5
                    		SkelControlName="F_L_Tire_Cont"
                    		bPoweredWheel = true;
                    	End Object
                    	Wheels(3)=LFWheel
                    	/** =============================================== */
                    	
                    	ViewPitchMin=-12000                                                   // rotação mínima da camera (para cima)
                    	ViewPitchMax=2000                                                     // rotação máxima da camera (para baixo)
                    
                    	SpawnRadius=125.0                                                     // determina a zona de segurança para spawnar o veículo (ele não spawna até que o local esteja livre)
                    
                    	DefaultFOV=80                                                         // foco de visão padrão da camera do veículo
                    
                    	bReducedFallingCollisionDamage=true                                   // reduz o dano do veículo quando cai de um lugar alto
                    
                    	MomentumMult=0.5                                                      // o impulso do dano é multiplicado por esse valor antes de ser aplicado ao veículo
                    
                    	MaxSpeed=8500                                                         // velocidade máxima atingida pelo veículo
                    }
                    Well, here is the car with the script

                    https://dl.dropboxusercontent.com/u/52049309/MyMod.rar

                    EDIT: Just lowered the the AngleCurve, and it solved 90% (just a small delay after releasing the button on the left), just played Scud Race again with the McLaren F1, sounds like that the first second of the turn will have the highest angle (like 45) and then lower it (20 or less), and the vehicles are easy to drift to the point that you can make an accidental one, just reducing the speed a bit will make it drift already if you are turning (I think the logic would be "when the speed is reduced, lower the wheel slip factor).

                    Comment


                      #11
                      Originally posted by pavomba View Post
                      Well, here is the car with the script
                      https://dl.dropboxusercontent.com/u/52049309/MyMod.rar
                      Thanks for sharing pavomba / tegleg.

                      Comment


                        #12
                        @frankit
                        i have several vehicles to download on my tutorials page

                        Comment


                          #13
                          Thanks Tegleg, will check them out...

                          Comment


                            #14
                            Originally posted by frankit View Post
                            Thanks for sharing pavomba / tegleg. Some Feedback: The uc Compiles ok in Feb 2014, but needs a one line change to compile in Feb 2013. When you open the test map there is no texture on the track and nothing works when you play in editor or on PC. Out of time now but can investigate further..

                            Edit:
                            Dragging a vehicle factory to the map works, but no vehicle appears at game time. Are crucial files missing i.e. a mymod package?
                            I've forgot that I ran on the UDK 07-2013.

                            Comment


                              #15
                              Originally posted by pavomba View Post
                              I've forgot that I ran on the UDK 07-2013.
                              Please disregard that previous post. The vehicle compiles and works fine in the Feb-2013 build and the Rar is perfect! Its just the test map that needs the July 2013 build. Instead dragging the vehicle to a new map works fine! I forgot that Vehicles are more strict than weapons on the directory structure and INI set-up. I should have followed Tegleg's advice here instead of being lazy:

                              http://forums.epicgames.com/threads/...8easy-guide%29

                              Comment:
                              The car does flip over quite easily... But its much faster than any other vehicle (similar to slomo 9 by default).
                              So I wonder, if the speed was decreased would that be enough to address it?

                              Comment

                              Working...
                              X