Game Development Community

Vechle Scripting

by Jason Griffith · in Torque Game Engine · 08/12/2002 (5:33 am) · 8 replies

Hi. I'm new to the scripting, but I'm OK with the language. Where can I find out about Vehicle Scripting. Where are the best places to learn about things like vehicle scripting, weapons, and others too. I've looked at the scripting stuff here but I didnt find much of it of use. I need to script vechle pretty much from scratch, but is there a script I can use as a template?

Thanks

-J

#1
08/12/2002 (6:25 am)
you can look at the car.cs in example\racing\server\scripts

or search the fourm for flying vehicle
#2
08/12/2002 (8:39 am)
Thanks for that, its a big help. Is there a way to sporn a vecihel using a consol command? OR is there a way to do it in script. Right now I dont have a vechle station so I cant do it that way.

-J
#3
08/12/2002 (10:50 am)
you can easyily spawn a vehicle with the in game editor,(press f11 once ingame then window/world editor creator, then to the right click shapes/vehicles and then the actual car)

get to know your ingame editors , they are your friends:)
here is a dev pic

www.planetquake.com/noescape/dev3/car.jpg
#4
08/13/2002 (5:20 am)
Hey Ace, thanks for that last advice, but I have a problem with that vehicle code you found. It says for all the objects there, that they are not members of other objects, or data blocks. Here are a few EG's:

OBJECT 'ShapeDebris' is not a member of the 'DebrisData' data block class.

there are loads like that.

and there was oine at the end:

Validation required for shape 'path of vehicle shape here'

What does that mean? Where 'path of vehicle shape here'
is a file path to the shape.

Thanks,

-J
#5
08/13/2002 (6:17 am)
that is the racing mod in the example directory.

you have to right click the the torque exe and create a short cut then right click the shortcut then click properties and put the following in the target line
-mod racing

so the whole line should look like:

C:\torque\example\torqueDemo.exe -mod racing

then click your short cut to start the racing mod
#6
08/18/2002 (5:06 am)
I Dont want the mod racing, and I allready have a shortcut to it. I just want to put a vehicle in the normal game engine game.

-J
#7
08/18/2002 (8:26 am)
well you would put one in the normal game the same way, as for the script , i did it once using a flying vehicle tut, from script recources, but never went beyond that.
#8
08/18/2002 (8:50 am)
You can do something like what I did below (this was to spawn a flyer):


Quote:

//Bind the "Cntl F" to spawn a New War Sparrow.
//This function should be placed in server/scripts/command.cs

function serverCmdAddFlyer(%client)
{
if(%client.player$="")
return;
if(%client.player)
if(%client.player.isMounted())
return;
%vehicle = new FlyingVehicle()
{
dataBlock = warsparrow;
};
%vehicle.mountable = true;
%vehicle.setEnergyLevel(60);
%vehicle.setTransform( %client.player.getEyeTransform() );
%vehicle.nextWeaponFire = 1;
//%vehicle.schedule(5500, "playThread", $ActivateThread, "activate");
MissionCleanup.add(%vehicle);

}

//And this line should be placed in client/scripts/defaultbinds.cs

moveMap.bindCmd(keyboard, "ctrl f", "commandToServer(\'addflyer\');", "");


If you want the wheeled vehicle to work in the regular demo, just move the buggy folder from the racing mod to the regular - example\fps\data\shapes and change the lines in the script above to spawn that shape. The car is called "default car" I believe.