Game Development Community

Making a thrown weapon, this the best / only way?

by Steve Howson · in Torque Game Engine · 09/09/2005 (9:33 pm) · 5 replies

Hi all!
Have been reading some posts on this.

I want to make a weapon, similar to a hand grenade that is thrown.. not launched.
I've read some posts that say to use the same model for the weapon and projectile and then create a "throw" animation and bind it to the fire command.

Is that the only way to do it, or does someone know of a better way... other than editing the source code I mean. Just got Torque so I'm not at the source editing stage just yet. :)

Thanks for any info!
Steve

#1
09/11/2005 (10:37 pm)
Anyone?
#2
09/12/2005 (2:39 am)
Spawn a new Item?

Have you tried searching the resources for grenade implementations?
#3
09/12/2005 (6:20 am)
There is a throw system in place in inventory.cs and item.cs but it does not use an animation, just pops out like the Tribes2 way. You could make an animation, but it will not work if your running without source changes i think, the run animation will override it.

From inventory.cs
function ShapeBase::throw(%this,%data,%amount)
{
// Throw objects from inventory. The onThrow method is
// responsible for decrementing the inventory.
#4
09/12/2005 (6:30 am)
Yes, I aggree the best way for this is the item. I have done this before for a handgrenade. THe nice things is the physics for the item, it will bounce off the walls etc. One thing though, I still dont beleive items have rotation, so you may want to add that. Not as good as a rigid shape, but good enough in my oppinion.
#5
09/16/2005 (10:15 am)
Well I tried the original posts I found (using same graphics for weapon and projectile).
I made the projectile ballistic and messed with the settings until I got a "realistic" arc for the trown object.

Seems to be working well so far.
I'm trying to avoid source changes at this point as I'm trying to learn Torque Script.

Thanks all for the help!
Steve