Mouse aiming for vehicle mounted weapons...
by Paladin · in Torque Game Engine · 01/07/2004 (8:19 am) · 9 replies
First off, let me apologize for starting a new thread concerning a topic that has already been covered in a few other threads. I only do this because no one appears to be monitoring the older threads anymore.
I'm basically looking for the best way to implement aiming system for my game. I want to drive a vehicle using the WASD keys and aim and fire using the mouse. The mouse will move around a cross-hair for targeting, which in turn, will cause a gun mounted on my vehicle to move and aim at where the mouse is currently targeting.
Below, you'll find an example of what I would like to do.
www.codesampler.com/images/aiming_example.jpg
After searching the forums, it seemed that the closet thing around was the "Turret & AITurret classes" resource by, Paul Dana, but I can't seem to get this one to work in the new CVS head. Also, I'm not sure if this resource does exactly what I want or not.
If anyone could help me out with actual code, I'll work into a new tutorial for my website and give you credit for it.
www.codesampler.com/torque.htm
Thanks in advance.
I'm basically looking for the best way to implement aiming system for my game. I want to drive a vehicle using the WASD keys and aim and fire using the mouse. The mouse will move around a cross-hair for targeting, which in turn, will cause a gun mounted on my vehicle to move and aim at where the mouse is currently targeting.
Below, you'll find an example of what I would like to do.
www.codesampler.com/images/aiming_example.jpg
After searching the forums, it seemed that the closet thing around was the "Turret & AITurret classes" resource by, Paul Dana, but I can't seem to get this one to work in the new CVS head. Also, I'm not sure if this resource does exactly what I want or not.
If anyone could help me out with actual code, I'll work into a new tutorial for my website and give you credit for it.
www.codesampler.com/torque.htm
Thanks in advance.
#2
what's the problem with it?
Just post your errors here...
01/10/2004 (7:49 am)
Paul's turrets are your best bet I guess...what's the problem with it?
Just post your errors here...
#3
I am using Paul's turrets in Release 1_2_0, but it took some tweaking and Paul's help. Posting errors and I am sure "we" could get it working.
01/10/2004 (8:10 am)
Paladin, I am using Paul's turrets in Release 1_2_0, but it took some tweaking and Paul's help. Posting errors and I am sure "we" could get it working.
#4
As for my problem with the "Turret & AITurret classes" resource, all I get after implementing the changes is the following errors in my console.
The resource is slightly out of date and I had to hack around a few things to get it to compile, but other than that I'm not sure what these messages mean.
01/10/2004 (6:50 pm)
Sorry Jeff, that screen-shot is not from my game. It's from a demo for a PC game called "Humvee Assault". The game really sucks, but I like the way their controls are laid out and I would like to do something similar in my own game.As for my problem with the "Turret & AITurret classes" resource, all I get after implementing the changes is the following errors in my console.
Loading compiled script starter.turret/server/scripts/turret.cs. Loading compiled script starter.turret/server/scripts/aiTurret.cs. Loading compiled script starter.turret/server/scripts/genericTurret.cs. starter.turret/server/scripts/genericTurret.cs (0): Unable to instantiate non-conobject class TurretData. Loading compiled script starter.turret/server/scripts/genericAITurret.cs. starter.turret/server/scripts/genericAITurret.cs (0): Unable to instantiate non-conobject class AITurretData.
The resource is slightly out of date and I had to hack around a few things to get it to compile, but other than that I'm not sure what these messages mean.
#5
01/10/2004 (7:18 pm)
Did you do a clean rebuild?
#6
01/11/2004 (1:08 am)
Usually those messages mean that you didnt include the files at all for compilation or you didnt do a clean rebuild... I think you also get this message if your path to the dts shape is wrong (but then there should be previous errors of not being able to load the shape or something...) - but its worth to check your dts paths in those scripts...
#7
01/13/2004 (7:01 am)
I've double-checked all of these possibilities and rebuilt everything, but the problem persists. Also, another individual is reporting the same problem on the original thread now, so we're either both screwing it up or something is actually wrong with the resource.
#8
If anyone has any ideas try this thread.
Thanks again.
01/13/2004 (7:09 am)
Erm, we've fixed the problem now. Had forgotten to include the completely new files in the VC project *hangs head in shame*. Unfortunately the resource wasn't what we wanted - Looking for a static viewpoint and aim the gun with the cursor (no animation required).If anyone has any ideas try this thread.
Thanks again.
#9
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4116
03/17/2007 (6:52 am)
For those who come after me, to make life a little easier:www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4116
Torque Owner Jeff Leigh
YucaTech Studios