| Home Page | Recent Changes | Preferences

ProjectX/Code

Ok here is where you will see a lot of code that dont work cos im a n00b at coding, if u can please tell me what ive dun wrong and tell me how to crrect id be really greatful.

When i load the new bulldog in a level, it appears, but when i walk up to it, and press [use] i cant get in it. The code i've changed is:

00001  #exec OBJ LOAD FILE=..\staticmeshes\BulldogMeshes.usx
00002  #exec OBJ LOAD FILE=..\sounds\WeaponSounds.uax
00003  #exec OBJ LOAD FILE=..\textures\VehicleFX.utx
00004  
00005  class Betterbulldog extends KCar
00006      placeable;
00007  
00008  // triggers used to get into the Bulldog
00009  var const vector    FrontTriggerOffset;
00010  var BulldogTrigger  FLTrigger, FRTrigger, FlipTrigger;
00011  
00012  
00013  // headlight projector
00014  var const vector        HeadlightOffset;
00015  var BulldogHeadlight    Headlight;
00016  var bool                HeadlightOn;
00017  
00018  // Light materials
00019  var Material            ReverseMaterial;
00020  var Material            BrakeMaterial;
00021  var Material            TailOffMaterial;
00022  
00023  var Material            HeadlightOnMaterial;
00024  var Material            HeadlightOffMaterial;
00025  
00026  var BulldogHeadlightCorona HeadlightCorona[8];
00027  var (Bulldog) vector    HeadlightCoronaOffset[8];
00028  
00029  // Used to prevent triggering sounds continuously
00030  var float           UntilNextImpact;
00031  
00032  // Wheel dirt emitter
00033  var BulldogDust     Dust[4]; // FL, FR, RL, RR
00034  
00035  // Distance below centre of tire to place dust.
00036  var float           DustDrop;
00037  
00038  // Ratio between dust kicked up and amount wheels are slipping
00039  var (Bulldog) float DustSlipRate;
00040  var (Bulldog) float DustSlipThresh;
00041  
00042  // Maximum speed at which you can get in the vehicle.
00043  var (Bulldog) float TriggerSpeedThresh;
00044  var bool            TriggerState; // true for on, false for off.
00045  var bool            FlipTriggerState;
00046  
00047  // Destroyed Buggy
00048  var (Bulldog) class<Actor>  DestroyedEffect;
00049  var (Bulldog) sound         DestroyedSound;
00050  
00051  // Weapon
00052  var           float FireCountdown;
00053  var           float SinceLastTargetting;
00054  var           Pawn  CurrentTarget;
00055  
00056  var (Bulldog) float     FireInterval;
00057  var (Bulldog) float     TargettingInterval;
00058  var (Bulldog) vector    RocketFireOffset; // Position (car ref frame) that rockets are launched from
00059  var (Bulldog) float     TargettingRange;
00060  var (Bulldog) Material  TargetMaterial;
00061  
00062  
00063  // Bulldog sound things
00064  var (Bulldog) float EnginePitchScale;
00065  var (Bulldog) sound BulldogStartSound;
00066  var (Bulldog) sound BulldogIdleSound;
00067  var (Bulldog) float HitSoundThreshold;
00068  var (Bulldog) sound BulldogSquealSound;
00069  var (Bulldog) float SquealVelThresh;
00070  var (Bulldog) sound BulldogHitSound;
00071  
00072  var (Bulldog) String BulldogStartForce;
00073  var (Bulldog) String BulldogIdleForce;
00074  var (Bulldog) String BulldogSquealForce;
00075  var (Bulldog) String BulldogHitForce;
00076  
00077  replication
00078  {
00079      reliable if(Role == ROLE_Authority)
00080          HeadlightOn, CurrentTarget;
00081  }
00082  
00083  function PreBeginPlay()
00084  {
00085      Super.PreBeginPlay();
00086      if ( Level.IsDemoBuild() )
00087          Destroy();
00088  }
00089  
00090  simulated function PostNetBeginPlay()
00091  {
00092      local vector RotX, RotY, RotZ;
00093      local int i;
00094  
00095      Super.PostNetBeginPlay();
00096  
00097      GetAxes(Rotation,RotX,RotY,RotZ);
00098  
00099      // Only have triggers on server
00100      if(Level.NetMode != NM_Client)
00101      {
00102          // Create triggers for gettting into the Bulldog
00103          FLTrigger = spawn(class'BetterbulldogTrigger', self,, Location + FrontTriggerOffset.X * RotX + FrontTriggerOffset.Y * RotY + FrontTriggerOffset.Z * RotZ);
00104          FLTrigger.SetBase(self);
00105          FLTrigger.SetCollision(true, false, false);
00106  
00107          FRTrigger = spawn(class'BetterbulldogTrigger', self,, Location + FrontTriggerOffset.X * RotX - FrontTriggerOffset.Y * RotY + FrontTriggerOffset.Z * RotZ);
00108          FRTrigger.SetBase(self);
00109          FRTrigger.SetCollision(true, false, false);
00110  
00111          TriggerState = true;
00112  
00113          // Create trigger for flipping the bulldog back over.
00114          FlipTrigger = spawn(class'BetterbulldogTrigger', self,, Location);
00115          Fliptrigger.bCarFlipTrigger = true;
00116          FlipTrigger.SetBase(self);
00117          FlipTrigger.SetCollisionSize(350, 200);
00118          FlipTrigger.SetCollision(false, false, false);
00119  
00120          FlipTriggerState = false;
00121      }
00122  
00123      // Dont bother making emitters etc. on dedicated server
00124      if(Level.NetMode != NM_DedicatedServer)
00125      {
00126          // Create headlight projector. We make sure it doesn't project on the vehicle itself.
00127          Headlight = spawn(class'BulldogHeadlight', self,, Location + HeadlightOffset.X * RotX + HeadlightOffset.Y * RotY + HeadlightOffset.Z * RotZ);
00128          Headlight.SetBase(self);
00129          Headlight.SetRelativeRotation(rot(-2000, 32768, 0));
00130  
00131          // Create wheel dust emitters.
00132          Dust[0] = spawn(class'BulldogDust', self,, Location + WheelFrontAlong*RotX + WheelFrontAcross*RotY + (WheelVert-DustDrop)*RotZ);
00133          Dust[0].SetBase(self);
00134  
00135          Dust[1] = spawn(class'BulldogDust', self,, Location + WheelFrontAlong*RotX - WheelFrontAcross*RotY + (WheelVert-DustDrop)*RotZ);
00136          Dust[1].SetBase(self);  
00137  
00138          Dust[2] = spawn(class'BulldogDust', self,, Location + WheelRearAlong*RotX + WheelRearAcross*RotY + (WheelVert-DustDrop)*RotZ);
00139          Dust[2].SetBase(self);
00140  
00141          Dust[3] = spawn(class'BulldogDust', self,, Location + WheelRearAlong*RotX - WheelRearAcross*RotY + (WheelVert-DustDrop)*RotZ);
00142          Dust[3].SetBase(self);
00143  
00144          // Set light materials
00145          Skins[1]=BrakeMaterial;
00146          Skins[2]=HeadlightOffMaterial;
00147  
00148          // Spawn headlight coronas
00149          for(i=0; i<8; i++)
00150          {
00151              HeadlightCorona[i] = spawn(class'BulldogHeadlightCorona', self,, Location + (HeadlightCoronaOffset[i] >> Rotation) );
00152              HeadlightCorona[i].SetBase(self);
00153          }
00154      }
00155  
00156      // For KImpact event
00157      KSetImpactThreshold(HitSoundThreshold);
00158  
00159      // If this is not 'authority' version - don't destroy it if there is a problem. 
00160      // The network should sort things out.
00161      if(Role != ROLE_Authority)
00162      {
00163          KarmaParams(KParams).bDestroyOnSimError = False;
00164          KarmaParams(frontLeft.KParams).bDestroyOnSimError = False;
00165          KarmaParams(frontRight.KParams).bDestroyOnSimError = False;
00166          KarmaParams(rearLeft.KParams).bDestroyOnSimError = False;
00167          KarmaParams(rearRight.KParams).bDestroyOnSimError = False;
00168      }
00169  }
00170  
00171  simulated event Destroyed()
00172  {
00173      local int i;
00174  
00175      //Log("Betterbulldog Destroyed");
00176  
00177      // Clean up random stuff attached to the car
00178      if(Level.NetMode != NM_Client)
00179      {
00180  
00181          FLTrigger.Destroy();
00182          FRTrigger.Destroy();
00183          FlipTrigger.Destroy();
00184      }
00185  
00186      if(Level.NetMode != NM_DedicatedServer)
00187      {
00188          '''Headlight.Destroy();
00189  
00190          for(i=0; i<4; i++)
00191              Dust[i].Destroy();
00192  
00193          for(i=0; i<8; i++)
00194              HeadlightCorona[i].Destroy();'''
00195      }
00196  
00197      // This will destroy wheels & joints
00198      Super.Destroyed();
00199  
00200      // Trigger destroyed sound and effect
00201      if(Level.NetMode != NM_DedicatedServer)
00202      {
00203          spawn(DestroyedEffect, self, , Location );
00204          PlaySound(DestroyedSound);
00205      }
00206  }
00207  
00208  function KImpact(actor other, vector pos, vector impactVel, vector impactNorm)
00209  {
00210      /* Only make noises for Bulldog-world impacts */
00211      if(other != None)
00212          return;
00213  
00214      if(UntilNextImpact < 0)
00215      {
00216          //PlaySound(BulldogHitSound);
00217  
00218          // hack to stop the sound repeating rapidly on impacts
00219          //UntilNextImpact = GetSoundDuration(BulldogHitSound);
00220          
00221          
00222      }
00223  }
00224  
00225  simulated function ClientKDriverEnter(PlayerController pc)
00226  {
00227      //Log("Bulldog ClientKDriverEnter");
00228  
00229      Super.ClientKDriverEnter(pc);
00230  }
00231  
00232  function KDriverEnter(Pawn p)
00233  {
00234      //Log("Bulldog KDriverEnter");
00235  
00236      Super.KDriverEnter(p);
00237  
00238      //PlaySound(BulldogStartSound);
00239  
00240      //AmbientSound=BulldogIdleSound;
00241  
00242      p.bHidden = True;
00243      ReceiveLocalizedMessage(class'Vehicles.BulldogMessage', 1);
00244  }
00245  
00246  simulated function ClientKDriverLeave(PlayerController pc)
00247  {
00248      //Log("Bulldog ClientKDriverLeave");
00249  
00250      Super.ClientKDriverLeave(pc);
00251  }
00252  
00253  function bool KDriverLeave(bool bForceLeave)
00254  {
00255      local Pawn OldDriver;
00256  
00257      //Log("Bulldog KDriverLeave");
00258  
00259      OldDriver = Driver;
00260  
00261      // If we succesfully got out of the car, make driver visible again.
00262      if( Super.KDriverLeave(bForceLeave) )
00263      {
00264          OldDriver.bHidden = false;
00265          AmbientSound = None;    
00266          return true;
00267      }
00268      else
00269          return false;
00270  }
00271  
00272  function LaunchRocket(bool bWasAltFire)
00273  {
00274      local vector RotX, RotY, RotZ, FireLocation;
00275      local BulldogRocket R;
00276      local PlayerController PC;
00277  
00278      // Client can't do firing
00279      if(Role != ROLE_Authority)
00280          return;
00281  
00282      // Fire as many rockets as we have time to.
00283      GetAxes(Rotation, RotX, RotY, RotZ);
00284      FireLocation = Location + (RocketFireOffset >> Rotation);
00285  
00286      while(FireCountdown <= 0)
00287      {
00288          if(!bWasAltFire)
00289          {
00290              // Fire a rocket at the current target (starts flying forward and up a bit)
00291  
00292              R = spawn(class'Vehicles.BulldogRocket', self, , FireLocation, rotator(-1 * RotX + 0.2 * RotZ));
00293              R.Seeking = CurrentTarget;
00294      
00295              // Play firing noise
00296              PlaySound(Sound'WeaponSounds.RocketLauncher.RocketLauncherFire', SLOT_None,,,,, false);
00297              PC = PlayerController(Controller);
00298              if (PC != None && PC.bEnableWeaponForceFeedback)
00299                  PC.ClientPlayForceFeedback("RocketLauncherFire");
00300          }
00301          else
00302          {
00303              //Log("Would AltFire At:"$CurrentTarget);
00304          }
00305  
00306          FireCountdown += FireInterval;
00307      }
00308  }
00309  
00310  // Fire a rocket (if we've had time to reload!)
00311  function VehicleFire(bool bWasAltFire)
00312  {
00313      Super.VehicleFire(bWasAltFire);
00314  
00315      if(FireCountdown < 0)
00316      {
00317          FireCountdown = 0;
00318          LaunchRocket(bWasAltFire);
00319      }
00320  }
00321  
00322  // For drawing targetting reticule
00323  simulated function DrawHud(Canvas C)
00324  {
00325      local int XPos, YPos;
00326      local vector ScreenPos;
00327      local float RatioX, RatioY;
00328      local float tileX, tileY;
00329      local float SizeX, SizeY, PosDotDir;
00330      local vector CameraLocation, CamDir;
00331      local rotator CameraRotation;
00332  
00333      if(CurrentTarget == None)
00334          return;
00335  
00336      SizeX = 64.0;
00337      SizeY = 64.0;
00338  
00339      ScreenPos = C.WorldToScreen( CurrentTarget.Location );
00340  
00341      // Dont draw reticule if target is behind camera
00342      C.GetCameraLocation( CameraLocation, CameraRotation );
00343      CamDir = vector(CameraRotation);
00344      PosDotDir = (CurrentTarget.Location - CameraLocation) Dot CamDir;
00345      if( PosDotDir < 0)
00346          return;
00347  
00348      RatioX = C.SizeX / 640.0;
00349      RatioY = C.SizeY / 480.0;
00350  
00351      tileX = sizeX * RatioX;
00352      tileY = sizeY * RatioX;
00353  
00354      XPos = ScreenPos.X;
00355      YPos = ScreenPos.Y;
00356      C.Style = ERenderStyle.STY_Additive;
00357      C.DrawColor.R = 255;
00358      C.DrawColor.G = 255;
00359      C.DrawColor.B = 255;
00360      C.DrawColor.A = 255;
00361      C.SetPos(XPos - tileX*0.5, YPos - tileY*0.5);
00362      C.DrawTile( TargetMaterial, tileX, tileY, 0.0, 0.0, 256, 256); //--- TODO : Fix HARDCODED USIZE
00363  }
00364  
00365  simulated function Tick(float Delta)
00366  {
00367      Local float BestAim, BestDist, TotalSlip, EnginePitch, VMag;
00368      Local vector RotX, RotY, RotZ, FireLocation;
00369      local pawn NewTarget;
00370      local int i;
00371  
00372      Super.Tick(Delta);
00373  
00374      // Weapons (run on server and replicated to client)
00375      if(Role == ROLE_Authority)
00376      {
00377          // Only put headlights on when driver is in. Save batteries!
00378          if(Driver != None)
00379              HeadlightOn=true;
00380          else
00381              HeadlightOn=false;
00382  
00383          // Do targetting (do nothing if no controller)
00384          SinceLastTargetting += Delta;
00385          if(Controller != None && SinceLastTargetting > TargettingInterval)
00386          {
00387              GetAxes(Rotation, RotX, RotY, RotZ);
00388      
00389              FireLocation = Location + (RocketFireOffset >> Rotation);
00390  
00391              // BestAim is zero - so we will only target things in front of the buggy
00392              BestAim = 0;
00393              NewTarget = Controller.PickTarget(BestAim, BestDist, -1.0 * RotX, FireLocation, TargettingRange);
00394              
00395              // If this is a new lock - play lock-on noise
00396              if(NewTarget != CurrentTarget)
00397              {
00398                  if(NewTarget == None)
00399                      PlayerController(Controller).ClientPlaySound(Sound'WeaponSounds.SeekLost');
00400                  else
00401                      PlayerController(Controller).ClientPlaySound(Sound'WeaponSounds.LockOn');
00402              }
00403  
00404              CurrentTarget = NewTarget;
00405              SinceLastTargetting = 0;
00406          }
00407  
00408          // Countdown to next shot
00409          FireCountdown -= Delta;
00410  
00411          // This is for sustained barrages.
00412          // Primary fire takes priority
00413          if(bVehicleIsFiring)
00414              LaunchRocket(false);
00415          else if(bVehicleIsAltFiring)
00416              LaunchRocket(true);
00417      }
00418  
00419      // Dont bother doing effects on dedicated server.
00420      if(Level.NetMode != NM_DedicatedServer)
00421      {
00422          // Update brake light colors.
00423          if(Gear == -1 && OutputBrake == false)
00424          {
00425              // REVERSE
00426              Skins[1] = ReverseMaterial;
00427          }
00428          else if(Gear == 0 && OutputBrake == true)
00429          {
00430              // BRAKE
00431              Skins[1] = BrakeMaterial;
00432          }
00433          else
00434          {
00435              // OFF
00436              Skins[1] = TailOffMaterial;
00437          }
00438  
00439          // Set headlight projector state.
00440          Headlight.DetachProjector();
00441          if(HeadlightOn)
00442          {
00443              Headlight.AttachProjector();
00444              Skins[2] = HeadlightOnMaterial;
00445              for(i=0; i<8; i++)
00446                  HeadlightCorona[i].bHidden = false;
00447          }
00448          else
00449          {
00450              Skins[2] = HeadlightOffMaterial;
00451              for(i=0; i<8; i++)
00452                  HeadlightCorona[i].bHidden = true;
00453          }
00454  
00455          // Update dust kicked up by wheels.
00456          Dust[0].UpdateDust(frontLeft, DustSlipRate, DustSlipThresh);
00457          Dust[1].UpdateDust(frontRight, DustSlipRate, DustSlipThresh);
00458          Dust[2].UpdateDust(rearLeft, DustSlipRate, DustSlipThresh);
00459          Dust[3].UpdateDust(rearRight, DustSlipRate, DustSlipThresh);
00460      }
00461  
00462      UntilNextImpact -= Delta;
00463  
00464      // This assume the sound is an idle-ing sound, and increases with pitch
00465      // as wheels speed up.
00466      EnginePitch = 64 + ((WheelSpinSpeed/EnginePitchScale) * (255-64));
00467      SoundPitch = FClamp(EnginePitch, 0, 254);
00468      //Log("Engine Pitch:"$SoundPitch);
00469      //SoundVolume = 255;
00470  
00471      // Currently, just use rear wheels for slipping noise
00472      TotalSlip = rearLeft.GroundSlipVel + rearRight.GroundSlipVel;
00473      //log("TotalSlip:"$TotalSlip);
00474      if(TotalSlip > SquealVelThresh)
00475      {
00476          rearLeft.AmbientSound = BulldogSquealSound;
00477      }
00478      else
00479      {
00480          rearLeft.AmbientSound = None;
00481      }
00482  
00483      // Dont have triggers on network clients.
00484      if(Level.NetMode != NM_Client)
00485      {
00486          // If vehicle is moving, disable collision for trigger.
00487          VMag = VSize(Velocity);
00488  
00489          if(!bIsInverted && VMag < TriggerSpeedThresh && TriggerState == false)
00490          {
00491              FLTrigger.SetCollision(true, false, false);
00492              FRTrigger.SetCollision(true, false, false);
00493              TriggerState = true;
00494          }
00495          else if((bIsInverted || VMag > TriggerSpeedThresh) && TriggerState == true)
00496          {
00497              FLTrigger.SetCollision(false, false, false);
00498              FRTrigger.SetCollision(false, false, false);
00499              TriggerState = false;
00500          }
00501  
00502          // If vehicle is inverted, and slow, turn on big 'flip vehicle' trigger.
00503          if(bIsInverted && VMag < TriggerSpeedThresh && FlipTriggerState == false)
00504          {
00505              FlipTrigger.SetCollision(true, false, false);
00506              FlipTriggerState = true;    
00507          }
00508          else if((!bIsInverted || VMag > TriggerSpeedThresh) && FlipTriggerState == true)
00509          {
00510              FlipTrigger.SetCollision(false, false, false);
00511              FlipTriggerState = false;
00512          }
00513      }
00514  }
00515  
00516  // Really simple at the moment!
00517  function TakeDamage(int Damage, Pawn instigatedBy, Vector hitlocation, 
00518                          Vector momentum, class<DamageType> damageType)
00519  {
00520      // Avoid damage healing the car!
00521      if(Damage < 0)
00522          return;
00523  
00524      if(damageType == class'DamTypeSuperShockBeam')
00525          Health -= 100; // Instagib doesn't work on vehicles
00526      else
00527          Health -= 0.5 * Damage; // Weapons do less damage
00528  
00529      // The vehicle is dead!
00530      if(Health <= 0)
00531      {
00532          if ( Controller != None )
00533          {
00534              if( Controller.bIsPlayer )
00535              {
00536                  ClientKDriverLeave(PlayerController(Controller)); // Just to reset HUD etc.
00537                  Controller.PawnDied(self); // This should unpossess the controller and let the player respawn
00538              }
00539              else
00540                  Controller.Destroy();
00541          }
00542  
00543          Destroy(); // Destroy the vehicle itself (see Destroyed below)
00544      }
00545  
00546      //KAddImpulse(momentum, hitlocation);
00547  }
00548  
00549  defaultproperties
00550  {
00551      DrawType=DT_StaticMesh
00552      StaticMesh=StaticMesh'BulldogMeshes.Simple.S_Chassis'
00553  
00554      Begin Object Class=KarmaParamsRBFull Name=KParams0
00555          KInertiaTensor(0)=20
00556          KInertiaTensor(1)=0
00557          KInertiaTensor(2)=0
00558          KInertiaTensor(3)=30
00559          KInertiaTensor(4)=0
00560          KInertiaTensor(5)=48
00561          KCOMOffset=(X=0.8,Y=0.0,Z=-0.7)
00562          KStartEnabled=True
00563          KFriction=1.6
00564          KLinearDamping=0
00565          KAngularDamping=0
00566          bKNonSphericalInertia=False
00567          bHighDetailOnly=False
00568          bClientOnly=False
00569          bKDoubleTickRate=True
00570          Name="KParams0"
00571      End Object
00572      KParams=KarmaParams'KParams0'
00573  
00574      DrawScale=0.4
00575  
00576      FrontTireClass=class'BulldogTire'
00577      RearTireClass=class'BulldogTire'
00578  
00579      WheelFrontAlong=-100
00580      WheelFrontAcross=110
00581      WheelRearAlong=115
00582      WheelRearAcross=110
00583      WheelVert=-15
00584  
00585      DestroyedEffect=class'XEffects.RocketExplosion'
00586      DestroyedSound=sound'WeaponSounds.P1RocketLauncherAltFire'
00587  
00588  
00589      //FrontTriggerOffset=(X=174,Y=0,Z=20)
00590      FrontTriggerOffset=(X=0,Y=165,Z=10)
00591  
00592      TriggerSpeedThresh=40
00593  
00594      HeadlightOffset=(X=-200,Y=0,Z=50)
00595      HeadlightOn=false
00596  
00597      // Light materials
00598      ReverseMaterial=Material'VehicleFX.BDReverseLight_ON'
00599      BrakeMaterial=Material'VehicleFX.BDTaiLight_ON'
00600      TailOffMaterial=Material'VehicleFX.BDTailOff'
00601  
00602      HeadlightOnMaterial=Material'VehicleFX.BDHeadlights_ON'
00603      HeadlightOffMaterial=Material'VehicleFX.BDHeadlights'
00604  
00605      HeadlightCoronaOffset(0)=(X=-199,Y=51,Z=57)
00606      HeadlightCoronaOffset(1)=(X=-199,Y=-51,Z=57)
00607      HeadlightCoronaOffset(2)=(X=-128,Y=38,Z=125)
00608      HeadlightCoronaOffset(3)=(X=-189,Y=93,Z=28)
00609      HeadlightCoronaOffset(4)=(X=-183,Y=-93,Z=26)
00610      HeadlightCoronaOffset(5)=(X=-190,Y=-51,Z=77)
00611      HeadlightCoronaOffset(6)=(X=-128,Y=63,Z=123)
00612      HeadlightCoronaOffset(7)=(X=-185,Y=85,Z=10)
00613  
00614      // Sounds
00615      EnginePitchScale=655350
00616      HitSoundThreshold=30
00617      SquealVelThresh=15
00618  
00619      DustSlipRate=2.8
00620      DustSlipThresh=0.1
00621      DustDrop=30
00622  
00623      // Weaponary
00624      bSpecialHUD=true
00625      FireInterval=0.9
00626      TargettingInterval=0.5
00627      RocketFireOffset=(X=0,Y=0,Z=180)
00628      TargettingRange=5000
00629      TargetMaterial=Material'InterfaceContent.Hud.fbBombFocus'
00630      
00631  
00632      // Driver positions
00633      
00634      ExitPositions(0)=(X=0,Y=200,Z=100)
00635      ExitPositions(1)=(X=0,Y=-200,Z=100)
00636      ExitPositions(2)=(X=350,Y=0,Z=100)
00637      ExitPositions(3)=(X=-350,Y=0,Z=100)
00638      
00639      DrivePos=(X=-165,Y=0,Z=-100)
00640  
00641      OutputBrake=1
00642      Steering=0
00643      Throttle=0
00644      Gear=1
00645      StopThreshold=40
00646  
00647      MaxSteerAngle=3400
00648      MaxBrakeTorque=55
00649  
00650      TorqueCurve=(Points=((InVal=0,OutVal=270),(InVal=20000,OutVal=170),(InVal=300000,OutVal=0)))
00651      TorqueSplit=0.5
00652      SteerPropGap=500
00653      SteerTorque=15000
00654      SteerSpeed=20000
00655  
00656      TireMass=0.5    
00657      ChassisMass=8
00658  
00659      TireRollFriction=1.5
00660      TireLateralFriction=1.5
00661      TireRollSlip=0.06
00662      TireLateralSlip=0.04
00663      TireMinSlip=0.001
00664      TireSlipRate=0.007
00665      TireSoftness=0.0
00666      TireAdhesion=0
00667      TireRestitution=0
00668  
00669      HandbrakeThresh=1000
00670      TireHandbrakeSlip=0.2
00671      TireHandbrakeFriction=-1.2
00672  
00673      SuspStiffness=150
00674      SuspDamping=14.5
00675      SuspHighLimit=0.5
00676      SuspLowLimit=-0.5
00677      SuspRef=0
00678  
00679      AirSpeed = 5000
00680  
00681      Health=300
00682  
00683      // sound
00684      SoundRadius=255
00685      
00686      UntilNextImpact=500
00687  }

Pz. help.

EntropicLqd: Is this in a new class? Any reason why you didn't post the whole code segment?

ProjectX: It's a modification of the bulldog, so it has lower acceleration and slightly higher speed, this is the only part i've changed so far, and this is the only part, therefore, where my problem will be.

ZxAnPhOrIaN: I am a n00b at uscripting also.. Look at my new map component at the open source area. It is a multi skybox zone thing similar to slickwilly's UT one, but more "user(or n00b)-friendly". And its for UT2003!

AlphaOne: What happens when you try to run this codes? Does it actually compile?

ProjectX: It compiles fine in UCC make and it appears in-game, i just cant enter it, thats the only thing wrong.

ProjectX: I've found the problem, i forgot to change one of the class names in bulldog trigger. My new problem is now occurring (isn't debugging fun!?!?!?) Its in the uscript section above and heres the error i get in UCC MAKE: Error, type mismatch in '='. Ok, the line is line 292 in the script.

ProjectX: Does anyone know what's wrong?

AlphaOne: You must be really frustrated with this!? Before I try to help you, I would like to know if you modified the actuall bulldog code or created a subclass of a bulldog? If you modified the original bulldog, then you shouldn't be doing that. Really. That's why most of the original game code says that if you modify it you'll have problems. You either subclass the bulldog, or copy+pase the bulldog code into your own version of the bulldog. You can find how to Create A Subclass here. Alternatively, you can totally recreate your own bulldog, by creating a new package, creating classes MyBulldog and MyBulldogTires. Then fool around with those variables. The first step is easier (I think). When you subclass the bulldog, only include (in the defaultproperties) those variables that you've changed. If you don't know Object Oriented Programming (OOP), then you should search the net or this site for more info. It is the key to programming in UScript. I hope that helps.

ProjectX: I copied the script to my own folder and compiled with UCC Make, changing the name to "betterbulldog"

ProjectX: so ure all as infuriatingly n00bish as me/ have other stuff to do/ dont like me?

ProjectX: I know this is a lot of code for you to help me with, but this is my first time at coding and if i dont get help now you may forever lose out on some great random insanity (like Food Fight UT2K3 not copyrighted in anyway, i would love to see this idea made)and anyway, the problem is only with 1 line of code, though i recognise that it may be due to another line of code somewhere else.

Mychaeel: What's your problem with that code, again? Compiler error in line 292?

EntropicLqd: Bah - beat me to it.

Daid303: Uh, can't find anything that wrong with line 292. Are you really really sure that this is YOUR code, and that that is the Right error?

Mychaeel: Do you happen to have your own version of class BulldogRocket in your package? Then that class and class Vehicles.BulldogRocket would indeed mismatch.

ProjectX: That could be it, i shall check

MythOpus: As you may or may not know... line ' 292 ' refers to the class that shoots the rocket. Are you sure you have changed this to the class you have? Ex- Vehicles.OriginalBulldogFire to MyPackage.MyClassFire ?

Foxpaw: I decided to pore over this and figure out "what's down with that." :P

This is a part that doesn't work. It may have been an error in the copying, but other than this it compiled fine. (Actually I didn't have any betterbulldogtriggers so I just substituted them for regular bulldog triggers and made it so you can enter an empty betterbulldog by shooting it.. but you would probrably like to retain the method you have now.

  '''Headlight.Destroy();

  for(i=0; i<4; i++)
    Dust[i].Destroy();

  for(i=0; i<8; i++)
    HeadlightCorona[i].Destroy();'''

''' specifies a name constant, and obviously, is an invalid one.

Other than the bit above, it compiled and drove fine. It flips a lot less than the regular bulldog too.

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

Mapping Topics

Mapping Lessons

UnrealEd Interface

Questions&Answers

Scripting Topics

Scripting Lessons

Making Mods

Class Tree

Questions&Answers

Modeling Topics

Questions&Answers

Log In