Author Topic: Heedicalking's Troubles  (Read 478 times)

I decided to post all of my problems here on this topic.

1. I was wondering how you could have more then just 3 seats for a tank vehicle. When I make 4 mounts on the script, the turret goes away.

2. I was wondering how to mount multiple turrets to a vehicle. I am working on upgrading my Skyhawk so that the side turrets can be controlled by players.

Fixed that, but now none of the turret look or shoot up or down. I only changed this.
Code: [Select]
function TankVehicle::onAdd(%this,%obj)
{
   // Setup the car with some defaults tires & springs
   for(%i = 0; %i < %this.numWheels; %i++)
   {
      %obj.setWheelTire(%i, %this.defaultTire);
      %obj.setWheelSpring(%i, %this.defaultSpring);
   }

   // 4 wheel steering
   %obj.setWheelSteering(0,1);
   %obj.setWheelSteering(1,1);
   %obj.setWheelSteering(2,-0.8);
   %obj.setWheelSteering(3,-0.8);

   // 4 wheel drive
   %obj.setWheelPowered(0,true);
   %obj.setWheelPowered(1,true);
   %obj.setWheelPowered(2,true);
   %obj.setWheelPowered(3,true);

   // turret
   %t = new AIPlayer()
   {
      dataBlock = TankTurretPlayer;
   };
   MissionCleanup.add(%t);
   %obj.mountObject(%t, 2);
   %obj.turret = %t;

   %obj.creationTime = getSimTime();
   %t.schedule(10,"rigTurret");

   %g = new AIPlayer()
   {
      dataBlock = TankTurretPlayer;
   };
   MissionCleanup.add(%t);
   %obj.mountObject(%g, 1);
   %obj.turret = %g;

   %obj.creationTime = getSimTime();
   %t.schedule(10,"rigTurret");
}

3. I was wondering how I could use differant shootonclicks for differant slots. Like if one guy shoots the bullets while flying and another guy drops the bombs.
« Last Edit: June 23, 2009, 04:10:17 PM by heedicalking »

1. What script did you use?

2. Look at Tankvehicle::onadd

3. shootonclick_requiredslot = #;

1. What script did you use?

2. Look at Tankvehicle::onadd

3. shootonclick_requiredslot = #;
1. I used the default tank script.

2. Ok

3. THe problem is, using 2 shootonclick main codes doesn't work for me. By main code, I mean this.

Code: [Select]
ShootOnClick = 1;
   
   ShootOnClick_Hold = 1;
   ShootOnClick_ShootDelay = 100;
   ShootOnClick_ReShootDelay = 100;
   ShootOnClick_ProjectileCount = 5;
   ShootOnClick_RequiredSlot = 0;
   shootOnClick_Sound = gunshot1sound;