Game Development Community

dev|Pro Game Development Curriculum

Car with weapon mounts

by Harold "LabRat" Brown · 04/29/2002 (11:48 am) · 38 comments

This demonstrates a couple things.

1. Mount points for a wheeled vehicle, including weapons
2. Script for mounting and firing 2 weapons on a vehicle
3. Proper Collision Mesh usage for a wheeled vehicle (ie. wheel hub nodes inside the collision box)

This is an advanced tutorial and as such it only includes the models and script files. There is no step by step.


Installation
------------
Copy the deathcar folder to your torque \example folder then start the game with the command line of:

torquedemo.exe -mod racing -mod deathcar

If you have any questions please post them in the garagegames forum

Download
Page «Previous 1 2
#1
04/29/2002 (12:38 pm)
Cool stuff Lab! I have to wait a few days before I can try it out, but that car looks pretty cool from the screenshot!
#2
05/11/2002 (9:18 am)
I followed your instructions but your demo does not appear to show up in the list, I still have the default test games.

Any ideas?

All the best.

-Ian
#3
05/11/2002 (7:07 pm)
Same here I tried it lastnight, but I chouldnt get it working.
#4
05/13/2002 (11:45 pm)
What version of Torque did you try with? Can you run the racing mod by itself?

torquedemo.exe -mod racing

If you can't run the racing mod you need to get the HEAD version from CVS.
#5
05/14/2002 (6:28 pm)
Harold,

Thanks for the reply.

I was using 1.1.1. I downloaded the head branch from the cvs tree and installed it. Now however none of the demos seem to work they all essentially hang while loading objects. The console reports that I need to resave the terrain file for the Waterworld example for example.

Any ideas?

All the best.
#6
05/19/2002 (4:56 pm)
Harold.
I got the demo to work. I needed to recompile the torquedemo.exe.
Works very nicely.
All the best.
#7
08/02/2002 (5:11 pm)
Great work!!
#8
11/10/2002 (1:09 pm)
Its sweet. How do you mount weapons on the car itself?
#9
01/31/2003 (3:49 pm)
Your website is currently unavailable. Is there another site I can get the download from?
#10
04/03/2003 (3:47 pm)
It appears this website has been 'temporarily' unavailable for the last couple of months, and it still is.
#11
04/09/2003 (12:21 pm)
#12
04/09/2003 (12:23 pm)
#13
04/09/2003 (12:23 pm)
Weha :)
the download is up again!
Im really greateful about that, because its the damn only resource about vehicles with a mounted weapon.

I think ill come up with soem problems, but well see ;)

regards Lenn
#14
04/09/2003 (8:04 pm)
I've been extremely busy in RL for the past several months. I took time out from my RL work to redo some of my webserver so the site could be put back up.
#15
04/11/2003 (5:15 am)
here is what i did:
1. I did a vehicle as described in this tutorial:
http://tork.zenkel.com/tutorials/vehicles/wheeled.htm

2. added a mount1 and mount2 to this vehicle.

3. put the script code from this "Car with weapon mounts" tutorial into the fps example and changed it so the weapons are mounted on mount1 and 2 instead of 0 and 1 (in this tutorial, the racing mod is used, so i think no mount0 for the player is needed, so weapons are in mount0 and mount1).

Here is the problem:
I get the weapons mounted, i can enter the vehicle, but i cant shoot.
The driver is mounted in mount0 and the two weapons in mount1 and mount2.

The curious about it is that if i mount one of the weapons in mount0 (where the driver mounts), i can shoot with this weapon when im mounted. The other weapon still doesnt work. The weapon must be somehow equipped to the player, or something?!?

console error:

fps/server/scripts/inventory.cs (136): Unable to find object: '' attempting to call function 'getName'
fps/server/scripts/inventory.cs (136): Unable to find object: '' attempting to call function 'getName'
keyboard0 input device unacquired.
keyboard0 input device acquired.
fps/server/scripts/player.cs (711): Unknown command setObjectActiveImage.
Object LocalClientConnection(1388) GameConnection -> NetConnection -> SimGroup -> SimSet -> SimObject


I dont know how to fix this error.
The only thing i can think about is that the example fps inventory system tries to equip the mounted vehicle weapons to the player and crashs.

Is the problem the inventory system do the scipts in this "Car with weapon mounts" tutorial dont work when a player mounts the vehicle?
Maybe i made mistakes in porting the code to the fps example?

well im completely stuck :) and pretty new to torque, so im thankful for any help.

regards Lenn
#16
04/20/2003 (5:55 pm)
The default first weapon node in this example is Mount0, to fix this you need to change the following lines:

%obj.setImageTrigger(0, false);
            %obj.setImageTrigger(1, false);

to

%obj.setImageTrigger(1, false);
            %obj.setImageTrigger(2, false);

Basically add 1 to the "node number" in every setImageTrigger call.
#17
04/23/2003 (12:51 pm)
Thx LabRat,

i did that and in addition changed this:

%obj.setImageAmmo(0,1);
%obj.setImageAmmo(1,1);

to:

%obj.setImageAmmo(1,1);
%obj.setImageAmmo(2,1);


Elseways i only could shoot one time.
Now all i wanted is working, but i still get exactly the same errors about the inventory.cs(136), the player.cs(711) and the GameConnection. But i havn't looked at the scripted inventory system at all, up to now *g

Again, thx Mr.Brown ;)

regards Lenn
#18
05/07/2003 (1:31 pm)
Hi guys

I enlarged the wheels of the default buggy, but thez sink into the ground, i changed the collide helper dummy but i doesnt work.

Does anybody know how to set up the collides for wheels correctly?
Do they have to be included into the collide mesh of the main vehicle?

Thx, Lenn
#19
01/10/2004 (5:31 pm)
the download page is not available again. I noticed that this has happened before on this thread? Can someone pls put it back up or vector me to a mirror?

-Regards,
Dave
#20
01/14/2004 (11:51 am)
is there any mirror of the zip file since the above mentioned url doesn't work!?!
Page «Previous 1 2