Game Development Community

MULTIPASSENGER CODE FIXED

by Anthony Rosenbaum · in Torque Game Engine · 03/16/2002 (5:51 pm) · 0 replies

have you gotten a muilti passenger vehices in the engine and wonder why all the players always sit int the pilot postion. Well thanks to our communtiy Ed Gardner and Tim "Spock" Newell I am PROUD to show you how to do it

first of all in vehicle.cs (from t2) replace the function findEmptySeat() to
function findEmptySeat(%vehicle, %vehicleblock)
{
 for (%i = 0; %i <  %vehicleblock.numMountPoints; %i++)
 {
        %node = %vehicle.getMountNodeObject(%i);
        
        if (%node == 0)
          {

         return %i;

          }
  }
 return -1;

}
thats right just copy and paste THEN
go to player.cs
in the
Armor::onCollision() fuction
replace
// Only mount drivers for now.
      %node = 0;
to
%node = findEmptySeat(%col, %this);
make sure the mesh has mount0 and mount1 ( at least) and walla there you have it
THANKS EVERYONE for the help
Vinci_smurf