PDA

View Full Version : Vehicle Script


Diocide
2003-08-27, 11:55 PM
im a newb so can someone make the vehicle data for a flying vehicle in a .cs file for me, just the mount stuff, colision stuff, jumping out of the vehicle, multipassenger mounting, and whatever else is needed, i just copied the vehicle data from tribes and my gunship crashes when i add this

function FlyingVehicleData::create(%data, %team, %oldObj)
{
if(%oldObj $= "")
{
%obj = new FlyingVehicle()
{
dataBlock = %data;
respawn = "0";
teamBought = %team;
team = %team;
};
}
else
{
%obj = new FlyingVehicle()
{
dataBlock = %data;
teamBought = %team;
team = %team;
mountable = %oldObj.mountable;
disableMove = %oldObj.disableMove;
resetPos = %oldObj.resetPos;
respawnTime = %oldObj.respawnTime;
marker = %oldObj;
};
}

//----------------------------------------------------------------------//

i also added this but this stuff doesnt crash it, and i dont know if it works

//----------------------------------------------------------------------//

function FlyingVehicleData::switchSidesSetPos(%data, %oldObj)
{
%team = %oldObj.curTeam == 1 ? 2 : 1;
%oldObj.curTeam = %team;
%obj = new FlyingVehicle()
{
dataBlock = %data;
teamBought = %team;
team = %team;
mountable = %oldObj.mountable;
disableMove = %oldObj.disableMove;
resetPos = %oldObj.resetPos;
respawnTime = %oldObj.respawnTime;
marker = %oldObj;
};
%obj.setTransform(%oldObj.getTransform());

return(%obj);
}

anyways can someone please help.

ilys
2003-08-28, 07:59 AM
You have to make sure everything is loading in the correct order, or it will crash Legends (or any other torque project for that matter).
In game.cs do you have the following:
exec("./vehicles/vehicle_spec_fx.cs");
exec("./vehicles/vehicle_yourvehiclegoeshere.cs");
exec("./vehicle.cs");
That needs to go bellow exec("./invManager.cs"); and in that exact order.
If you could upload the code you have for the vehicles it would make helping you a lot easier.

Diocide
2003-08-28, 08:53 AM
yes its in that order. how do i upload the code? dont see anything here hehe. also how do you know what order to put it in is it in alphabetical order hehe, only way i got it right cause i used the buggy example to reference .

ilys
2003-08-28, 09:39 AM
Well, thats the order the torque example told me to put it in, and every other torque project i've seen with vehicles uses the same order (including T2).
Pack your stuff into a zip, upload it to a website and link it here.

Diocide
2003-08-28, 10:17 AM
i dont have a website to upload it to or know any, can you PM me with your E-mail and ill mail it to you tomorrow? or do you have Aim or msn and i can send it through Direct connect.

ilys
2003-08-28, 11:11 AM
ilys@myrealbox.com

I dont use any IM proggies. They've all sucked since ICQ, and that has sucked since it turned into AOL.

Diocide
2003-08-29, 02:49 AM
i sent ya the stuff