How to do a Missile Launcher?
by Charlie Sibbach · in Torque Game Engine · 12/11/2008 (8:50 pm) · 4 replies
Hey gang,
So this one is a bit different from most of my posts, at least in that it doesn't question esoteric networking trivia :) I'm simply wondering about how to implement a missile launcher in Torque? More generically, any weapon that has a limited amount of ammo which is dispensed with as you fire the weapon?
I'm pretty sure this is easy, but I can't think of the answer right now.
On a semi-related note, what's the best documentation for the ShapeBaseImage state machine system?
Thanks for any help!
So this one is a bit different from most of my posts, at least in that it doesn't question esoteric networking trivia :) I'm simply wondering about how to implement a missile launcher in Torque? More generically, any weapon that has a limited amount of ammo which is dispensed with as you fire the weapon?
I'm pretty sure this is easy, but I can't think of the answer right now.
On a semi-related note, what's the best documentation for the ShapeBaseImage state machine system?
Thanks for any help!
#2
For documentation of the state system check out the section for ShapeBaseImageData about a third to half of the way down on that page.
edit: note that some of the weapons I mentioned don't seem to be easily found anymore - I got tired of searching or I would have left you some links.
12/11/2008 (9:42 pm)
The crossbow is a good example of the weapon state machine in action. If I'm following your idea correctly you can link the different states to animation threads for your weapons. You can find some free models on here for a couple of different rocket launcher, a couple of machine guns, a mini-gun, a laser, and a grenade launcher. The mini-gun and grenade launcher would be a good example of how to animate you weapon to different states.For documentation of the state system check out the section for ShapeBaseImageData about a third to half of the way down on that page.
edit: note that some of the weapons I mentioned don't seem to be easily found anymore - I got tired of searching or I would have left you some links.
#3
If you want to have some visual gauge of how many missiles the player has left, you might try mounting individual missiles on the player, and unmounting them when the player fires.
12/12/2008 (7:29 am)
I wouldn't reccomend animating ammunition... nor putting ammo into the state system. Unless you really want to. Ammunition for the default crossbow is handled by a simple scripted inventory system. Look into the inventory command in Crossbow::onFire to see how that's used.If you want to have some visual gauge of how many missiles the player has left, you might try mounting individual missiles on the player, and unmounting them when the player fires.
Torque Owner Charlie Sibbach
Is this the easiest way to do it? Are there easier ways? Thanks!