Game Development Community

Flight Compendium problem

by CodingChris · in Torque Game Engine · 08/24/2006 (3:50 am) · 2 replies

I work on the flight compendium(http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7079)
When I finished it all, and I want to mount a vehicle I get this error:
power.race/server/scripts/car.cs (192): Unable to find function onMountVehicle
I think I haven't got this function. Not in the engine-code or in the examples. So, where is this function? Can somebody help me??? Thanks

#1
08/25/2006 (8:11 am)
Does nobody know where this function is???
#2
08/31/2006 (7:48 pm)
This is the kind of thing you are looking for. I load the player in as the pilot automatically.

function onMountVehicle(%vehicle, %obj, %col){
//*************************************************************************
//
//*************************************************************************
// Is the vehicle currently mountable?
if (%col.mountable == false)
{
echo("Sorry, the vehicle is not mountable.");
return;
}

// Check the speed of the vehicle. If it's moving, we can't mount it.
// Note there is a threshold that determines if the vehicle is moving.
%vel = %col.getVelocity();
%speed = vectorLen(%vel);

%seat = 0;
%obj.isMounted = true;

echo("Mounting vehicle in seat " @ %seat);

%col.mountObject(%obj, %seat);
// %obj.setControlObject(%vehicle);

}