Announcement

Collapse
No announcement yet.

Relative Physics Problem

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

    #61
    @KongWeezY: Do you want to use existing controls for your vehicle, e.g. "Feign Death" should act as boost for your vehicle. Or do you want to define new key functions that don't have an effect outside of the vehicle?

    Comment


      #62
      I won't to add a extra key.

      now I have Throttle(keys"W"-"S), Steering(left and right arrows) and Rise(space and Ctrl) ---- Default keys

      // Roll
      // No rolling for now, I will use q and e for the forward movement for the time being
      PZ_ForceRotationVectX *= 800 * Rise; // PZ_NewRise is between -1 and 1

      // Pitch
      PZ_ForceRotationVectY *= 30 * Throttle; // Throttle is between -1 and 1

      // Yaw
      PZ_ForceRotationVectZ *= 30 * -Steering; // Steering is between -1 and 1

      // The magic happens here ---- Forward
      PZ_ForceApplication = PZ_ForwardsNormal * 6000; I need a key here to control move forward and stop

      hope you can help me. I have tried many things to get it to work


      I have make me own spaceship In blender. 15 minutes of work. I will share the work, when it finished.
      If you have a cool concept or design of a spaceship, I can great it.
      some pictures


      Comment


        #63
        I suggest that you use the mouse for turning to free keys. The following code will ONLY work in single player.

        Code:
        // Roll
        PZ_ForceRotationVectX *= 800 * Rise; // PZ_NewRise is between -1 and 1
        
        // Pitch
        PZ_ForceRotationVectY *= 30 * -PlayerController(Controller).PlayerInput.aMouseY / 100;
        
        // Yaw
        PZ_ForceRotationVectZ *= 30 * PlayerController(Controller).PlayerInput.aMouseX / 100;
        
        // The magic happens here ---- Forward
        PZ_ForceApplication = PZ_ForwardsNormal * Throttle * 6000;
        This plane will turn with the mouse.
        You will have to keep W pressed to move forward.

        You might try instead:
        Code:
        PZ_ForceApplication = PZ_ForwardsNormal * (Throttle+1) * 6000;
        This should result in a default forward movement, W acts as an afterbruner, A as brakes. Similiar to Ubisoft's HAWX.

        Since Steering is unused now, you might want to add strafing.

        Comment


          #64
          I do not know what I'm doing wrong, but it does not work ... I have tried and bind buttons

          Bindings = (Name = "MouseX", Command = "Count bYAxis | Axis aMouseX")
          Bindings = (Name = "MouseY", Command = "Count bYAxis | Axis aMouseY")


          // Pitch
          PZ_ForceRotationVectY *= 30 * -PlayerController(Controller).PlayerInput.aMouseY / 100;

          // Yaw
          PZ_ForceRotationVectZ *= 30 * PlayerController(Controller).PlayerInput.aMouseX / 100;

          the debugging, does not fail, but nothing happens, when I use the mouse...




          Nice code..
          PZ_ForceApplication = PZ_ForwardsNormal * (Throttle+1) * 6000;

          Comment


            #65
            I haven't binded the MouseX/MouseY in my DefaultInput.ini at all. They are binded by default as far as I know.

            By the way there is a small mistakte in the bindings you posted:

            Bindings = (Name = "MouseX", Command = "Count bYAxis | Axis aMouseX")
            Bindings = (Name = "MouseY", Command = "Count bYAxis | Axis aMouseY")

            should be

            Bindings = (Name = "MouseX", Command = "Count bXAxis | Axis aMouseX")
            Bindings = (Name = "MouseY", Command = "Count bYAxis | Axis aMouseY")

            If removing the bindings from the DefaultInput.ini (if they are even there, don't remove them from UDKInput.ini) doesn't help, try logging to figure out the mistake.

            On top of that you might try to remove the "/100". The calculated values might be just to small.^^

            Code:
            // Pitch
            PZ_ForceRotationVectY *= 30 * -PlayerController(Controller).PlayerInput.aMouseY;
            
            // Yaw
            PZ_ForceRotationVectZ *= 30 * PlayerController(Controller).PlayerInput.aMouseX;
            
            `log("MOUSEX: "$PlayerController(Controller).PlayerInput.aMouseX);
            `log("MOUSEY: "$PlayerController(Controller).PlayerInput.aMouseY);
            If the values in your logging window are all 0 when you are moving the mouse, you are in trouble.^^
            If it works, remove the `log.


            [EDIT] Although you said spaceship, don't you mean plane? Because you asked how to fix/add gravity to the spacehsip. Spaceships aren't affected by earth's gravity since they are in space^^

            For a plane I would recommend a key layout as following:

            Roll with A/D (Steering),
            Pitch with W/S (Throttle),
            Forward/backward: Space/C (AR_NewRise) and a default forward speed

            Code:
            // Roll
            PZ_ForceRotationVectX *= 30* Steering; // you might want to play with 30
            
            // Pitch
            PZ_ForceRotationVectY *= 30 * Throttle;
            
            // No Yaw turning, planes turn mostly by a combination of roll and pitch, so let's ignore it for now
            PZ_ForceRotationVectZ *= 0;
            
            // The magic happens here ---- Forward
            PZ_ForceApplication = PZ_ForwardsNormal * (AR_NewRise+1)* 6000;
            This would result in a nice plane, that still isn't affected by gravity. If you want gravity, you have to consider (air) lift and drag forces as well. I can go into that after we have figured out your input issue.

            Comment


              #66
              Hey, I wanted to say a big thanks to those sharing their scripting knowledge in this thread, it's been a massive help for an unrealscript noob like me experimenting with vehicle controls. Out of curiosity: has anyone had any luck playing around with getting "lookSteer" similar to that on the Cicada working on both the vehicle's Yaw and the vehicle's Pitch? I've been struggling with this for a few days now, and the best I've managed was having the vehicle spinning on the spot nose down. :P

              Comment


                #67
                Please give me a short description of what lookSteer does/you want to archieve. I haven't used it, since I haven't bothered much with default vehicle controls. They are simply not meant to be used for a space/flight vehicle.

                Comment


                  #68
                  Sure, thanks I figured it wouldn't be as easy as copying one of their vehicle scripts, thought it would be a good start though to see how things are done though.

                  With the Cicada and Manta the vehicle's strafing and throttle are controlled with the keyboard while the player can freely look around using the mouse, with the vehicle's yaw following the camera view, slightly lagging behind. I've recorded a quick video of the Cicada here:


                  I'm looking for a similar effect but with the vehicle's pitch as well. After some digging around I've found the following input code with something relevant to the LookSteer in the UTVehicle.uc, I might tinker about with it a bit and see what happens.

                  Code:
                  simulated function SetInputs(float InForward, float InStrafe, float InUp)
                  {
                  	local bool bReverseThrottle;
                  	local UTConsolePlayerController ConsolePC;
                  	local rotator SteerRot, VehicleRot;
                  	local vector SteerDir, VehicleDir, AngVel;
                  	local float VehicleHeading, SteerHeading, DeltaTargetHeading, Deflection;
                  
                  	Throttle = InForward;
                  	Steering = InStrafe;
                  	Rise = InUp;
                  
                  	ConsolePC = UTConsolePlayerController(Controller);
                  	if (ConsolePC != None)
                  	{
                  		Steering = FClamp(Steering * ConsoleSteerScale, -1.0, 1.0);
                  
                  		UpdateLookSteerStatus();
                  
                  		// tank, wheeled / heavy vehicles will use this
                  
                  		// If we desire 'look steering' on this vehicle, do it here.
                  		if (bUsingLookSteer && IsHumanControlled())
                  		{
                  			// If there is a deflection, look at the angle that its point in.
                  			Deflection = Sqrt(Throttle*Throttle + Steering*Steering);
                  
                  			if(bStickDeflectionThrottle)
                  			{
                  				// The region we consider 'reverse' is anything below DeflectionReverseThresh, or anything withing the triangle below the center position.
                  				bReverseThrottle = ((Throttle < DeflectionReverseThresh) || (Throttle < 0.0 && Abs(Steering) < -Throttle));
                  				Throttle = Deflection;
                  
                  				if (bReverseThrottle)
                  				{
                  					Throttle *= -1;
                  				}
                  			}
                  
                  			VehicleRot.Yaw = Rotation.Yaw;
                  			VehicleDir = vector(VehicleRot);
                  
                  			SteerRot.Yaw = DriverViewYaw;
                  			SteerDir = vector(SteerRot);
                  
                  			VehicleHeading = GetHeadingAngle(VehicleDir);
                  			SteerHeading = GetHeadingAngle(SteerDir);
                  			DeltaTargetHeading = FindDeltaAngle(SteerHeading, VehicleHeading);
                  
                  			if (DeltaTargetHeading > LookSteerDeadZone)
                  			{
                  				Steering = FMin((DeltaTargetHeading - LookSteerDeadZone) * LookSteerSensitivity, 1.0);
                  			}
                  			else if (DeltaTargetHeading < -LookSteerDeadZone)
                  			{
                  				Steering = FMax((DeltaTargetHeading + LookSteerDeadZone) * LookSteerSensitivity, -1.0);
                  			}
                  			else
                  			{
                  				Steering = 0.0;
                  			}
                  
                  			AngVel = Mesh.BodyInstance.GetUnrealWorldAngularVelocity();
                  
                  			Steering = FClamp(Steering + (AngVel.Z * LookSteerDamping), -1.0, 1.0);
                  
                  			// Reverse steering when reversing
                  			if (Throttle < 0.0 && ForwardVel < 0.0)
                  			{
                  				Steering = -1.0 * Steering;
                  			}
                  		}
                  		// flying hovering vehicles will use this
                  		else
                  		{
                  			//`log( " flying hovering vehicle" );
                  			if (bStickDeflectionThrottle)
                  			{
                  				// The region we consider 'reverse' is anything below DeflectionReverseThresh, or anything withing the triangle below the center position.
                  				bReverseThrottle = ((Throttle < DeflectionReverseThresh) || (Throttle < 0.0 && Abs(Steering) < -Throttle));
                  
                  				Deflection = Sqrt(Throttle*Throttle + Steering*Steering);
                  				Throttle = Deflection;
                  
                  				if (bReverseThrottle)
                  				{
                  					Throttle *= -1;
                  				}
                  			}
                  		}
                  
                  		//`log( "Throttle: " $ Throttle $ " Steering: " $ Steering );
                  	}
                  }

                  Comment


                    #69
                    I see what you want to do. The problem is as following:

                    The whole UT-Code shipped with UDK is designed for a classic FPS. Meaning features like planes flying upside down or tilting a vehicle were not considered to be needed during development, because 99 % of FPSs do not need such features and those make the code a lot more complex.
                    In conclusion there is no easy way of achieving what you are after. It is possible, about medium difficultiy, but you have to code EVERYTHING yourself. Including the lockSteer for Yaw and Pitch, because the UT-Code considers only yaw rotation as valid player input and is basicly impossible to extend/modify. On top of that you have to understand how forces are used to move the cicada the way you want to. Don't forget vector math.
                    But don't let me stop you, just be aware that it is not an easy task for a beginner and will take some time. Go ahead and make something epic. ;-)

                    Comment


                      #70
                      Haha, I was afraid of that, interesting about not taking pitch into consideration. I'll focus on what I can do with the design and art side of things for now, thanks.

                      Comment


                        #71
                        Wow firstly, thanks to everyone in this thread, I have managed to get it in my game and 'semi-working' however it appears to turn very very slowly (whether using W,S or A,D), Space and C affect the speed quite fast, Ill add in all my code now if someone could quickly peruse it

                        I did have my own custom models and everything in there but they were causing more problems than solving so following what others said in here, I swapped over to referencing the Cicada in the code.

                        UTVehicle_PulseTest2.uc (AR_Aircraft.uc)

                        Code:
                        class UTVehicle_PulseTest2 extends UTAirVehicle;
                        
                        /* etc */
                        
                        var float AR_MaxLift, AR_TurnSpeed, AR_Speed, AR_CurrentForward, 
                        
                        AR_AddedLiftSpeed, AR_Acceleration;
                        
                        /* etc */
                        
                        simulated function AirRaidKinematics(float DeltaTime)
                        {
                        local Vector AR_ForceApplication, AR_ForceRotation, AR_ForwardsNormal, 
                        
                        AR_UpwardsNormal, AR_SidewardsNormal;
                        local Vector AR_ForceRotationVectX, AR_ForceRotationVectY, 
                        
                        AR_ForceRotationVectZ;
                        local float AR_NewRise;
                        
                        // While there is a player in the biplane:
                        if (PlayerController(Controller) != None)
                        {
                        GetAxes(Rotation, AR_ForwardsNormal, AR_SidewardsNormal, 
                        
                        AR_UpwardsNormal);
                        
                        // It's probably unnecessary to normalise these:
                        AR_ForceRotationVectX = Normal(AR_ForwardsNormal);
                        AR_ForceRotationVectY = Normal(AR_SidewardsNormal);
                        AR_ForceRotationVectZ = Normal(AR_UpwardsNormal);
                        
                        // Rise is NOT between -1 and 1, like it said it was
                        AR_NewRise = 0;
                        if (Rise != 0) AR_NewRise = Rise / Abs(Rise); // Avoid divide by 0
                        
                        // Calculate the XYZ components of the relative steering:
                        // Generic controls Steering, Throttle and Rise are set by the controller
                        
                        // Roll
                        // No rolling for now, I will use q and e for the forward movement for 
                        
                        the time being
                        // AR_ForceRotationVectX *= 35 * -AR_NewRise; // AR_NewRise is between -1 
                        
                        and 1
                        
                        // Pitch
                        AR_ForceRotationVectY *= 30 * Throttle; // Throttle is between -1 and 1
                        
                        // Yaw
                        AR_ForceRotationVectZ *= 25 * -Steering; // Steering is between -1 and 1
                        
                        // Add them together to get final global rotation vector:
                        AR_ForceRotation = AR_ForceRotationVectX + AR_ForceRotationVectY + 
                        
                        AR_ForceRotationVectZ;
                        
                        // The magic happens here
                        AR_ForceApplication = AR_UpwardsNormal * 0 + 50 * AR_NewRise * 
                        
                        AR_ForwardsNormal;
                        
                        // Add forces and rotations
                        Mesh.AddForce(AR_ForceApplication);
                        Mesh.AddTorque(AR_ForceRotation);
                        }
                        else
                        {
                        // if nobody is in the plane, don't apply forces to it, do nothing
                        }
                        }
                        
                        
                        simulated function Tick(float DeltaTime)
                        {
                        AirRaidKinematics(DeltaTime);
                        Super.Tick(DeltaTime);
                        }
                        
                        /* etc */
                        UTVehicleFactor_PulseTest2

                        Code:
                        class UTVehicleFactory_PulseTest2 extends UTVehicleFactory placeable;
                        
                        defaultproperties
                        {
                        	Begin Object Name=SVehicleMesh
                        		SkeletalMesh=SkeletalMesh'VH_Cicada.Mesh.SK_VH_Cicada'
                        		Translation=(X=-40.0,Y=0.0,Z=-70.0)
                        	End Object
                        
                        
                        	Begin Object Name=CollisionCylinder
                        		CollisionHeight=+120.0
                        		CollisionRadius=+200.0
                        		Translation=(X=0.0,Y=0.0,Z=-40.0)
                        	End Object
                        
                        	VehicleClassPath="UTGameContent.UTVehicle_PulseTest_Content2"
                        	DrawScale=1
                        }
                        UT_Vehicle_PulseTest_Content2.uc

                        Code:
                        class UTVehicle_PulseTest_Content2 extends UTVehicle_PulseTest2;
                        
                        var array<UTDecoy> Decoys;
                        
                        simulated function PostBeginPlay()
                        {
                        	Super.PostBeginPlay();
                        }
                        
                        function IncomingMissile(Projectile P)
                        {
                        	local UTVWeap_CicadaTurret Turret;
                        
                        	// notify the turret weapon
                        	if (Seats.length > 1)
                        	{
                        		Turret = UTVWeap_CicadaTurret(Seats[1].Gun);
                        		if (Turret != None)
                        		{
                        			Turret.IncomingMissile(P);
                        		}
                        	}
                        
                        	Super.IncomingMissile(P);
                        }
                        
                        defaultproperties
                        {
                        	Begin Object Name=CollisionCylinder
                        		CollisionHeight=+70.0
                        		CollisionRadius=+240.0
                        		Translation=(X=-40.0,Y=0.0,Z=40.0)
                        	End Object
                        
                        	Begin Object Name=SVehicleMesh
                        		SkeletalMesh=SkeletalMesh'VH_Cicada.Mesh.SK_VH_Cicada'
                        		AnimTreeTemplate=AnimTree'VH_Cicada.Anims.AT_VH_Cicada'
                        		
                        
                        PhysicsAsset=PhysicsAsset'VH_Cicada.Mesh.SK_VH_Cicada_Physics'
                        		AnimSets.Add(AnimSet'VH_Cicada.Anims.VH_Cicada_Anims')
                        	End Object
                        
                        	DrawScale=1.3
                        
                        	Health=500
                        	BigExplosionTemplates[0]=
                        
                        (Template=ParticleSystem'Envy_Effects.VH_Deaths.P_VH_Death_SMALL_Far',Min
                        
                        Distance=350)
                        	BigExplosionTemplates[1]=
                        
                        (Template=ParticleSystem'Envy_Effects.VH_Deaths.P_VH_Death_SMALL_Near')
                        	BigExplosionSocket=VH_Death
                        
                        	Seats.Empty
                        	Seats(0)={(	GunClass=class'UTVWeap_CicadaMissileLauncher',
                        				GunSocket=(Gun_Socket_02,Gun_Socket_01),
                        				CameraTag=ViewSocket,
                        				TurretControls=(LauncherA,LauncherB),
                        				CameraOffset=-400,
                        				CameraBaseOffset=(Z=25.0),
                        				SeatIconPos=(X=0.48,Y=0.25),
                        				GunPivotPoints=(Main),
                        				WeaponEffects=
                        
                        ((SocketName=Gun_Socket_01,Offset=(X=-80),Scale3D=
                        
                        (X=12.0,Y=15.0,Z=15.0)),(SocketName=Gun_Socket_02,Offset=(X=-
                        
                        80),Scale3D=(X=12.0,Y=15.0,Z=15.0)))
                        				)}
                        
                        	Seats(1)={(	GunClass=class'UTVWeap_CicadaTurret',
                        				GunSocket=
                        
                        (Turret_Gun_Socket_01,Turret_Gun_Socket_02,Turret_Gun_Socket_03,Turret_Gu
                        
                        n_Socket_04),
                        				TurretVarPrefix="Turret",
                        				TurretControls=(Turret_Rotate),
                        				CameraTag=Turret_ViewSocket,
                        				CameraOffset=0,
                        				GunPivotPoints=(MainTurret_Pitch),
                        				CameraEyeHeight=0,
                        				SeatIconPos=(X=0.48,Y=0.56),
                        				ViewPitchMin=-14000.0,
                        				ViewPitchMax=1.0,
                        				WeaponEffects=
                        
                        ((SocketName=Turret_Gun_Socket_04,Offset=(X=-80),Scale3D=
                        
                        (X=8.0,Y=10.0,Z=10.0)),(SocketName=Turret_Gun_Socket_03,Offset=(X=-
                        
                        80),Scale3D=(X=8.0,Y=10.0,Z=10.0)))
                        				)}
                        
                        
                        	
                        
                        TurretBeamTemplate=ParticleSystem'VH_Cicada.Effects.P_VH_Cicada_2ndPrim_B
                        
                        eam'
                        
                        	VehicleEffects.Empty
                        	
                        	VehicleEffects(0)=
                        
                        (EffectStartTag=TurretWeapon00,EffectEndTag=STOP_TurretWeapon00,EffectTem
                        
                        plate=ParticleSystem'VH_Cicada.Effects.P_VH_Cicada_2ndAltFlash',EffectSoc
                        
                        ket=Turret_Gun_Socket_01)
                        	VehicleEffects(1)=
                        
                        (EffectStartTag=TurretWeapon01,EffectEndTag=STOP_TurretWeapon01,EffectTem
                        
                        plate=ParticleSystem'VH_Cicada.Effects.P_VH_Cicada_2ndAltFlash',EffectSoc
                        
                        ket=Turret_Gun_Socket_02)
                        	VehicleEffects(2)=
                        
                        (EffectStartTag=TurretWeapon02,EffectEndTag=STOP_TurretWeapon02,EffectTem
                        
                        plate=ParticleSystem'VH_Cicada.Effects.P_VH_Cicada_2ndAltFlash',EffectSoc
                        
                        ket=Turret_Gun_Socket_03)
                        	VehicleEffects(3)=
                        
                        (EffectStartTag=TurretWeapon03,EffectEndTag=STOP_TurretWeapon03,EffectTem
                        
                        plate=ParticleSystem'VH_Cicada.Effects.P_VH_Cicada_2ndAltFlash',EffectSoc
                        
                        ket=Turret_Gun_Socket_04)
                        
                        	VehicleEffects(4)=
                        
                        (EffectStartTag=EngineStart,EffectEndTag=EngineStop,EffectTemplate=Partic
                        
                        leSystem'VH_Cicada.Effects.P_VH_Cicada_GroundEffect',EffectSocket=GroundE
                        
                        ffectBase)
                        	VehicleEffects(5)=
                        
                        (EffectStartTag=EngineStart,EffectEndTag=EngineStop,EffectTemplate=Partic
                        
                        leSystem'VH_Cicada.Effects.P_VH_Cicada_Exhaust',EffectSocket=LeftExhaust)
                        	VehicleEffects(6)=
                        
                        (EffectStartTag=EngineStart,EffectEndTag=EngineStop,EffectTemplate=Partic
                        
                        leSystem'VH_Cicada.Effects.P_VH_Cicada_Exhaust',EffectSocket=RightExhaust
                        
                        )
                        	VehicleEffects(7)=
                        
                        (EffectStartTag=DamageSmoke,EffectEndTag=NoDamageSmoke,bRestartRunning=fa
                        
                        lse,EffectTemplate=ParticleSystem'Envy_Effects.Vehicle_Damage.P_Vehicle_D
                        
                        amage_1_Cicada',EffectSocket=DamageSmoke_01)
                        
                        	VehicleAnims(0)=(AnimTag=Created,AnimSeqs=
                        
                        (InActiveStill),AnimRate=1.0,bAnimLoopLastSeq=false,AnimPlayerName=Cicada
                        
                        Player)
                        	VehicleAnims(1)=(AnimTag=EngineStart,AnimSeqs=
                        
                        (GetIn),AnimRate=1.0,bAnimLoopLastSeq=false,AnimPlayerName=CicadaPlayer)
                        	VehicleAnims(2)=(AnimTag=Idle,AnimSeqs=
                        
                        (Idle),AnimRate=1.0,bAnimLoopLastSeq=true,AnimPlayerName=CicadaPlayer)
                        	VehicleAnims(3)=(AnimTag=EngineStop,AnimSeqs=
                        
                        (GetOut),AnimRate=1.0,bAnimLoopLastSeq=false,AnimPlayerName=CicadaPlayer)
                        
                        	JetEffectIndices=(11,12)
                        	ContrailEffectIndices=(2,3,4,5,13,14)
                        	GroundEffectIndices=(10)
                        
                        	// Sounds
                        	// Engine sound.
                        	Begin Object Class=AudioComponent Name=RaptorEngineSound
                        		
                        
                        SoundCue=SoundCue'A_Vehicle_Cicada.SoundCues.A_Vehicle_Cicada_EngineLoop'
                        	End Object
                        	EngineSound=RaptorEngineSound
                        	Components.Add(RaptorEngineSound);
                        
                        	
                        
                        CollisionSound=SoundCue'A_Vehicle_Cicada.SoundCues.A_Vehicle_Cicada_Colli
                        
                        de'
                        	
                        
                        EnterVehicleSound=SoundCue'A_Vehicle_Cicada.SoundCues.A_Vehicle_Cicada_St
                        
                        art'
                        	
                        
                        ExitVehicleSound=SoundCue'A_Vehicle_Cicada.SoundCues.A_Vehicle_Cicada_Sto
                        
                        p'
                        
                        	// Scrape sound.
                        	Begin Object Class=AudioComponent Name=BaseScrapeSound
                        		
                        
                        SoundCue=SoundCue'A_Gameplay.A_Gameplay_Onslaught_MetalScrape01Cue'
                        	End Object
                        	ScrapeSound=BaseScrapeSound
                        	Components.Add(BaseScrapeSound);
                        
                        	// Initialize sound parameters.
                        	EngineStartOffsetSecs=2.0
                        	EngineStopOffsetSecs=1.0
                        
                        	IconCoords=(U=988,V=0,UL=33,VL=42)
                        
                        	
                        
                        ExplosionSound=SoundCue'A_Vehicle_Cicada.SoundCues.A_Vehicle_Cicada_Explo
                        
                        de'
                        	JetScalingParam=JetScale
                        
                        	PassengerTeamBeaconOffset=(X=-125.0f,Y=0.0f,Z=-105.0f);
                        	
                        
                        ReferenceMovementMesh=StaticMesh'Envy_Effects.Mesh.S_Air_Wind_Ball'
                        
                        	HudCoords=(U=106,V=125,UL=-106,VL=124)
                        	TeamMaterials[0]
                        
                        =MaterialInstanceConstant'VH_Cicada.Materials.MI_VH_Cicada_Red'
                        	TeamMaterials[1]
                        
                        =MaterialInstanceConstant'VH_Cicada.Materials.MI_VH_Cicada_Blue'
                        
                        	BurnOutMaterial[0]
                        
                        =MaterialInterface'VH_Cicada.Materials.MITV_VH_Cicada_Red_BO'
                        	BurnOutMaterial[1]
                        
                        =MaterialInterface'VH_Cicada.Materials.MITV_VH_Cicada_Blue_BO'
                        
                        	SpawnMaterialLists[0]=(Materials=
                        
                        (MaterialInterface'VH_Cicada.Materials.MI_VH_Cicada_Spawn_Red'))
                        	SpawnMaterialLists[1]=(Materials=
                        
                        (MaterialInterface'VH_Cicada.Materials.MI_VH_Cicada_Spawn_Blue'))
                        
                        	DamageMorphTargets(0)=
                        
                        (InfluenceBone=Lt_Gun_Yaw,MorphNodeName=none,Health=150,DamagePropNames=
                        
                        (Damage2))
                        	DamageMorphTargets(1)=
                        
                        (InfluenceBone=Rt_Gun_Yaw,MorphNodeName=none,Health=150,DamagePropNames=
                        
                        (Damage2))
                        	DamageMorphTargets(2)=
                        
                        (InfluenceBone=FrontGuardDamage,MorphNodeName=none,Health=150,DamagePropN
                        
                        ames=(Damage1))
                        	DamageMorphTargets(3)=
                        
                        (InfluenceBone=MainTurret_Yaw,MorphNodeName=none,Health=150,DamagePropNam
                        
                        es=(Damage3))
                        
                        	DamageParamScaleLevels(0)=(DamageParamName=Damage1,Scale=3)
                        	DamageParamScaleLevels(1)=(DamageParamName=Damage2,Scale=1.5)
                        	DamageParamScaleLevels(2)=(DamageParamName=Damage3,Scale=2.5)
                        
                        	
                        
                        DrivingPhysicalMaterial=PhysicalMaterial'VH_Cicada.materials.physmat_Cica
                        
                        da_driving'
                        	
                        
                        DefaultPhysicalMaterial=PhysicalMaterial'VH_Cicada.materials.physmat_Cica
                        
                        da'
                        
                        	bHasEnemyVehicleSound=true
                        	EnemyVehicleSound(0)
                        
                        =SoundNodeWave'A_Character_IGMale.BotStatus.A_BotStatus_IGMale_EnemyCicad
                        
                        a'
                        }
                        I have to get to class now or I would upload a vid, its clear how it should be moving, just the WASD keys are very slow to respond (in both default and edited gravity volume, as suggested)

                        Using Space and C I can accelerate forwards and back quite quickly if it is set to 500.

                        It was working quite well with the custom model/setup I had for my modification of the Cicada script except it was spinning round endlessly, I could combat this but it would then be going in the opposite direction quite quickly meaning it was very very sensitive. I'm wondering if that was due to scale/bone setup or something.

                        Anyways thanks again for the work in here and for any replies

                        Comment


                          #72
                          FIXED For some reason I need to use greatly exaggerated values :3 That break in the day really helped me get a clear perspective woohoo!

                          Comment


                            #73
                            The reason why you had to use exaggerated values is simple.

                            The mass of any rigid body, including your custom vehicle and the cicada, is based on its volume. The more volume (the bigger your vehicle) is, the more force you need to to move it.

                            Just imagine you would try to push a book of a desk. Easy, right?
                            Now imagine to push a car out of a garage. Although your are using roughly the same amount of force, the effect is vastly different.

                            Every ship/plane needs its own values.
                            The values I provided are aimed for a slow moving cicada.

                            Comment


                              #74
                              Ahh that makes sense, thanks a lot man! Tbf I should have realised that lol xD
                              Right now I'm tightening up all the values so its nice and responsive which is going great, this is some excellent code!

                              Utilising a chase cam with some snippets from the cicada code I've got it 'chasing' in full 360degree movement and really gives that sense of movement similar to Freelancer/Frontier Elite which is what I was gunning for with this project I'm working on!

                              I've unlocked the Roll as well so now I'm tackling with getting my head around the keybinds since Roll has replaced the accelerate and decelerate on Space and C, bit of trial and error though and all should be good ^_^

                              Comment


                                #75
                                Hokay I'm really struggling getting the mouse code on the previous page to work, so as it stands I'm short 2 keys

                                Code:
                                // Roll
                                // No rolling for now, I will use q and e for the forward movement for the time being
                                AR_ForceRotationVectX *= 110 * -AR_NewRise; // AR_NewRise is between -1 and 1
                                
                                // Pitch
                                AR_ForceRotationVectY *= 90 * Throttle; // Throttle is between -1 and 1
                                
                                // Yaw
                                AR_ForceRotationVectZ *= 110 * -Steering; // Steering is between -1 and 1
                                
                                // Add them together to get final global rotation vector:
                                AR_ForceRotation = AR_ForceRotationVectX + AR_ForceRotationVectY + AR_ForceRotationVectZ;
                                
                                // The magic happens here
                                AR_ForceApplication = AR_UpwardsNormal * 0 + 505 * AR_NewRise * AR_ForwardsNormal;
                                Code:
                                // Roll
                                // No rolling for now, I will use q and e for the forward movement for the time being
                                AR_ForceRotationVectX *= 110 * -Steering; // AR_NewRise is between -1 and 1
                                
                                // Pitch
                                AR_ForceRotationVectY *= PlayerController(Controller).PlayerInput.aMouseY; // Throttle is between -1 and 1
                                
                                // Yaw
                                AR_ForceRotationVectZ *= PlayerController(Controller).PlayerInput.aMouseX; // Steering is between -1 and 1
                                
                                // Add them together to get final global rotation vector:
                                AR_ForceRotation = AR_ForceRotationVectX + AR_ForceRotationVectY + AR_ForceRotationVectZ;
                                
                                // The magic happens here
                                AR_ForceApplication = AR_ForwardsNormal * Throttle * 505;
                                Using the mouse code from the previous page I have the same problem as KongWeeZy where it just does not respond at all to mouse movement. I've tried to add them as binds in DefaultInput.ini but also to no avail, really struggling here, tried to find where Throttle, Steering and Rise are defined as well so I could perhaps add an extra one for Z and X or something just so I can get it all working together.

                                EDIT: The mouse X and Y binds are in UDKInput.ini but missing from defaultinput.ini, not too sure where to add them in defaultinput.ini to activate? them.

                                All in all, whatever combination I use (minus the 2 buttons) works great except without the missing 2 buttons I am either spinning/rotating/or left dead in the air (with full movement).

                                Thanks for taking the time to read this!

                                Comment

                                Working...
                                X