Weapon help
by Rojalee · in Torque Game Engine · 03/17/2007 (4:01 pm) · 8 replies
First off, let me say I that I know there are previous posts on this issue, but I cant find them, I searched under weapon, weapon.cs, weapon help, weapon pack help and weapon tutorial.
Now here is my question. (sort of)
I have made a weapon, and I have put a bounding box on it (for collision purposes).
I have exported it in DTS format with the texture.
I have put it in the game as a shape, and it looks wonderful.
Now how can I add it as the Players weapon?
right now all I want to do is have it there. I will work on the animations, etc later.
Just now all I want to do is have it show up as the players weapon.
Thanks in advance.
Robert
Now here is my question. (sort of)
I have made a weapon, and I have put a bounding box on it (for collision purposes).
I have exported it in DTS format with the texture.
I have put it in the game as a shape, and it looks wonderful.
Now how can I add it as the Players weapon?
right now all I want to do is have it there. I will work on the animations, etc later.
Just now all I want to do is have it show up as the players weapon.
Thanks in advance.
Robert
About the author
#2
03/18/2007 (4:14 am)
Why would I need to add nodes to it?
#3
The key to weapons is an object called a StaticShapeImageData. This datablock defines how your weapon behaves. Once you've written the datablock for your weapon, you can mount the image to your player using the mountImage method. The player then holds your weapon and can fire it.
--Amr
03/18/2007 (5:42 am)
You need to add a node to tell Torque where you want your player to hold your weapon (called mountPoint) and another node to tell it where to spawn the weapon's projectile (called muzzlePoint).The key to weapons is an object called a StaticShapeImageData. This datablock defines how your weapon behaves. Once you've written the datablock for your weapon, you can mount the image to your player using the mountImage method. The player then holds your weapon and can fire it.
--Amr
#4
I can't seem to find it anymore though, it doesn't seem to exist anymore.
03/18/2007 (8:09 am)
Hmm, there was a really good reasource for adding weapons that you could pick up and swich to.I can't seem to find it anymore though, it doesn't seem to exist anymore.
#5
Here it is:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5907
Hope that helps!
03/18/2007 (8:11 am)
Ok, I just checked my bookmarks and I had it bookmarked!Here it is:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5907
Hope that helps!
#6
03/18/2007 (8:18 am)
Quote:Why would I need to add nodes to it?Nodes are how Torque knows what to do with a weapon (and specifically, where to do it). For example, the mountPoint node tells Torque where the player should hold onto the weapon. muzzlePoint is where the bullet will be emitted. Et cetera.
#7
03/18/2007 (9:02 am)
Where you adding them two nodes go ahead and add the ejectpoint. Put this node where the shell eject from the gun.
#8
And for projectile weapons, 3 nodes. mountPoint, muzzlePoint, ejectPoint ?
That tut link is for Cycling Weapons....I just want to add them to the player as the default weapon.
(trying to learn one thing at a time)
03/19/2007 (4:23 am)
So for a melee weapon, I only need the mountPoint node?And for projectile weapons, 3 nodes. mountPoint, muzzlePoint, ejectPoint ?
That tut link is for Cycling Weapons....I just want to add them to the player as the default weapon.
(trying to learn one thing at a time)
Torque Owner Daniel Buckmaster
T3D Steering Committee
In the block ofcode under that, find
Change the part in quotation marks to the file directory of wherever you've stored your .dts file.
Then scroll down a little, and do the same in the next reference to shapeFile you find, in the code block named
This should replace the default crossbow in starter.fps with your model.