Game Development Community

Vehicle Adding Bugs

by Jorge Luis Gandulfo · in Torque Game Engine · 10/02/2003 (2:53 pm) · 2 replies

I bought the JetBike model from Garage Shop.

And im experiencing this problem..

Adding a jetbike using the assigned key (CTRL+J) will work fine.

But adding it as a shape in the mission editor, won't allow me to mount the vehicle and will even dmg my player.

Can anyone solve this arround?

Im pretty noob at the scriptiong, and still finding my way arround.

This is Some of the Code from JetBike.Cs

//--------------------------------------------------------------
function JetBikeData::onAdd(%this,%obj)
{
// Setup the car with some defaults tires & springs
for (%i = %obj.getWheelCount() - 1; %i >= 0; %i--) {
%obj.setWheelTire(%i,JetbikeTire);
%obj.setWheelSpring(%i,JetbikeSpring);
}
}

//------------------------------------------------------------------
function serverCmdAddJetbike(%client)
{
if(%client.player$="")
return;
if(%client.player)
if(%client.player.isMounted())
return;
%vehicle = new WheeledVehicle()
{
dataBlock = Jetbike;
};
%vehicle.mountable = true;
%vehicle.setEnergyLevel(60);
%vehicle.setTransform( %client.player.getEyeTransform() );
//%vehicle.setGravity(0);// Optional recommended :)
%vehicle.nextWeaponFire = 1;
//%vehicle.schedule(5500, "playThread", $ActivateThread, "activate");
MissionCleanup.add(%vehicle);
}

moveMap.bindCmd(keyboard, "ctrl j", "commandToServer(\'addJetbike\');", "");

#1
10/02/2003 (5:21 pm)
You need to create it as a shape.. not a static shape.

And I'm not sure if you are allowed to post those scripts.
#2
10/02/2003 (5:23 pm)
Mm.. I don't know there are already script like this in the resource section, so i think it won't hurt anybody.

Well if i create is at a Shape it gave me the problem i described before.

As a static shape it does nothing.

There must be a fix in this code to allow adding as a Shape with all the functions.