Vehicles Galore
by Tom Feni · 10/14/2004 (12:59 pm) · 47 comments
4 vehicles to use as learning tools.
included:
Dts shapes for vehicles, scripts for the vehicles, milkshape files for all vehicles. all the textures for the vehicles.
Vehicle spawners. 3 vehicle spawns for the hover, car, and tank.. didnt get the plane one done but its fairly simple to see how I did it.
Its mainly a way to see how the script works and to fine tune your own shapes..
all of these work great out of the box.. none of them will fly thru the terrain and will not crash the game.. :)
so if you do fiddle try to do so slowly so you dont get things out of whack.. :)
Now you will want to take all the scripts and add them to your scripts folder in server..
ie/ server/scripts
then open game.cs and add
with the other exec's
now add all the shapes to your client/shapes folder...
now when you open your editor all the vehicles should show up in the editor.. all save the hover will spawn by clicking on the vehicles/ shape name..
for some reason the hover wont load normally.. use the vehicle spawn points which are also loaded into the editor under vehspawns...
play around and if you have any questions let me know.. :)
oh and hey, you might need the link:
New Vehicle Zip
* ok had some probs with the server.. feel bad about it so going to upload my recent vehicle stuff.. so there are alot of things in semi-finished state.. all as-is...
Finally.. its fixed..
enjoy.. :)
ok reuploaded the files as of 4-10-2006
included:
Dts shapes for vehicles, scripts for the vehicles, milkshape files for all vehicles. all the textures for the vehicles.
Vehicle spawners. 3 vehicle spawns for the hover, car, and tank.. didnt get the plane one done but its fairly simple to see how I did it.
Its mainly a way to see how the script works and to fine tune your own shapes..
all of these work great out of the box.. none of them will fly thru the terrain and will not crash the game.. :)
so if you do fiddle try to do so slowly so you dont get things out of whack.. :)
Now you will want to take all the scripts and add them to your scripts folder in server..
ie/ server/scripts
then open game.cs and add
exec("./tooncar.cs");
exec("./toontank.cs");
exec("./hovervehicle.cs");
exec("./flyer.cs");
exec("./flyervehicle.cs");
exec("./vehiclespawn.cs");with the other exec's
now add all the shapes to your client/shapes folder...
now when you open your editor all the vehicles should show up in the editor.. all save the hover will spawn by clicking on the vehicles/ shape name..
for some reason the hover wont load normally.. use the vehicle spawn points which are also loaded into the editor under vehspawns...
play around and if you have any questions let me know.. :)
oh and hey, you might need the link:
New Vehicle Zip
* ok had some probs with the server.. feel bad about it so going to upload my recent vehicle stuff.. so there are alot of things in semi-finished state.. all as-is...
Finally.. its fixed..
enjoy.. :)
ok reuploaded the files as of 4-10-2006
About the author
#22
11/02/2004 (4:35 am)
The milkshape file for the tank seems to be incorrect. When you load the tank.ms3d file, it's the same as the turret.ms3d, but without the joints.
#23
-Barzahd
11/02/2004 (5:02 am)
I know this may be slightly off topic, but I have a question. What if I don't wan't to use vehicle spawners in the game? I would like to have the cars already spawned when the game loads as opposed to spawning it by contacting a spawner. Personally, I never really liked the idea. Takes away from the realism factor. I'm not saying it doesn't work in some games, and I am not saying your code is bad or anything of the sort, I just need something more realistic for my game. How would I make vehicles spawn a certain distance along a path from the character? (I.E. a car spawning 300 meters from the player on the street). Thanks guys,-Barzahd
#24
11/02/2004 (5:10 am)
Travis... Use a trigger... Then just put the Spawner 300m away...
#25
you can place a vehicle and save the map and the vehicle will stay.. but if you destroy the vehicle.. no more vehicle.. Thats why I did the spawners..
which are actually doen by game beavers, but I redid the shapes for the spawn shapes.. :)
I will redo the zip and get more up to date stuff in there.. including my new biplane.. :)
11/02/2004 (12:43 pm)
I will double check the files..you can place a vehicle and save the map and the vehicle will stay.. but if you destroy the vehicle.. no more vehicle.. Thats why I did the spawners..
which are actually doen by game beavers, but I redid the shapes for the spawn shapes.. :)
I will redo the zip and get more up to date stuff in there.. including my new biplane.. :)
#26
Still, I like what I've seen overall, and I look forward to the next release! :D
12/18/2004 (6:15 pm)
Downloaded and installed this today, very nice! I was only able to get the car to work, the others had problems with being clipped halfway into the ground. I was also unable to mount the others (possibly related?). Further, I noticed while driving the car around, I could drive into lava and remain unhurt.Still, I like what I've seen overall, and I look forward to the next release! :D
#27
12/25/2004 (6:43 pm)
A few months after submitting the resource and now the URL is gone. Bad style.
#28
hmmm.. give me a few and it will be back.. I didnt think I deleted it.. I was cleaning some pics out.. shouldnt have deleted it..
oops if I did.. it will be up shortly..
12/25/2004 (8:00 pm)
its gone?hmmm.. give me a few and it will be back.. I didnt think I deleted it.. I was cleaning some pics out.. shouldnt have deleted it..
oops if I did.. it will be up shortly..
#29
the new car has a chasis and a hull seperate, I am trying out a system where I use the chasis as the base and just add a hull to it..
:)
anyways its should help get a basic idea of vehicles...
12/25/2004 (8:31 pm)
Ok its up.. I changed it to the car, hovercraft, tank, biplane, new Toonscar, and some other little odds and ends.. they are all in various stages of completion.. but all the files are there for you to use as you wish...the new car has a chasis and a hull seperate, I am trying out a system where I use the chasis as the base and just add a hull to it..
:)
anyways its should help get a basic idea of vehicles...
#30
ummm guess I forgot the spawn shapes.. but until I get it up you can swap the shape out with whatever you wish to use.. mine was just a ball shape.. so until I get it up you can probably just go into the spawner cs file and change it to whatever you wish to use.. :)
if you want to even use the spawn code.. :)
12/25/2004 (8:33 pm)
oh noes..ummm guess I forgot the spawn shapes.. but until I get it up you can swap the shape out with whatever you wish to use.. mine was just a ball shape.. so until I get it up you can probably just go into the spawner cs file and change it to whatever you wish to use.. :)
if you want to even use the spawn code.. :)
#31
Going to try out the new additions a little later as well!
12/27/2004 (4:54 pm)
Tom, if you need a mirror for this resource, please let me know :)Going to try out the new additions a little later as well!
#32
02/12/2005 (10:20 am)
I was just wondering if someone could help me with this im really new at scripting i dont get this script i added the spawns in-game and saved. Then i opened it up again and there were no vehicles???? What did i do wrong?????
#33
if so just run into them. it will spawn a vehicle where the spawn is..
02/12/2005 (2:24 pm)
are the spawns there?if so just run into them. it will spawn a vehicle where the spawn is..
#34
02/12/2005 (7:49 pm)
it dident work but im getting help on another part of the forums so i dont really care but ty for trying.
#35
03/27/2005 (10:44 am)
No biplane, and some bad paths for explosiondebris.dts...
#36
03/27/2005 (4:55 pm)
Crashes Torque when trying to load server because of that Explosion Debris or whatever.
#37
03/27/2005 (5:35 pm)
Hovercraft doesn't let me in when the player collides with it. Shame, I'd have liked to try to test it out.
#38
1) If you die inside the vehicle, you dont respawn. Its like you are stuck to the vehicle, when the player dissapears. Pressing buttons dosent do anything.
I dont know much at all about scripting.
Im trying to get the player to dismount when he is dead any ideas im thinkin' around the onDisabled function in the player.cs script?
2) About using triggers any example code that i could look at to get them to spawn when you enter a trigger?
04/14/2005 (7:43 am)
Great resource, just got a few questions which i need a little help with:1) If you die inside the vehicle, you dont respawn. Its like you are stuck to the vehicle, when the player dissapears. Pressing buttons dosent do anything.
I dont know much at all about scripting.
Im trying to get the player to dismount when he is dead any ideas im thinkin' around the onDisabled function in the player.cs script?
2) About using triggers any example code that i could look at to get them to spawn when you enter a trigger?
#39
11/16/2005 (2:56 pm)
Yeah, the hovercraft does not work. I really would like to use it for my game some how!
#40
in hovervehicle.cs change all
to
then find
on line 558 and change it to
after that it still isn't pretty the hover vehicle lacks control and bounces.
03/26/2006 (7:18 pm)
to get the hover craft to work in 1.4 you must do a couple things.in hovervehicle.cs change all
Hover::
to
HoverVehicleData::
then find
dataBlock = %block;
on line 558 and change it to
dataBlock = %vehicle;
after that it still isn't pretty the hover vehicle lacks control and bounces.

Torque 3D Owner Tom Feni
function hoverSpawn::onCollision(%this,%obj,%col) { if (%col.getClassName() !$= "Player" || %col.isMounted() || %col.getState() $= "Dead") {return;} %obj.respawn(); %vehicle = new hoverVehicle() { dataBlock = hover; }; %vehicle.mountable = true; %vehicle.mountHide[0] = 1; %vehicle.setEnergyLevel(60); %vehicle.setTransform( %obj.getTransform() ); MissionCleanup.add(%vehicle); }Ok just tried it and it is very well done.. I will fix it for all the spawners.. :)
and add a flying spawner to it too.. :)