Make vehicle shoot
by AIDan · in Torque Game Engine · 09/10/2001 (6:20 am) · 3 replies
Hi
There are some tutorials how to make your player shoot, but how to make a vehicle shoot??
greetings
Daniel
There are some tutorials how to make your player shoot, but how to make a vehicle shoot??
greetings
Daniel
About the author
#2
Basically a vehicle needs a mountpoint to place a weaponImage. If it doesn't have one you can fake it with an offset from the boxCenter when you mount the weapon(s) in the vehicle's onAdd() callback. The vehicle may also need an onTrigger() callback in order to process the mouse trigger commands - depends on how complicated your weapon setup is for vehicles. Vehicle weapons are setup the same as player weapons requiring ammo, state system and onFire() events, etc.
And finally here is a simple example designed for use in Torque 3D, though will work in TGE/TGEa with minor modification: AssaultBuggy
09/08/2010 (4:45 pm)
A 9 year thread revival there... but I know the answer: Basically a vehicle needs a mountpoint to place a weaponImage. If it doesn't have one you can fake it with an offset from the boxCenter when you mount the weapon(s) in the vehicle's onAdd() callback. The vehicle may also need an onTrigger() callback in order to process the mouse trigger commands - depends on how complicated your weapon setup is for vehicles. Vehicle weapons are setup the same as player weapons requiring ammo, state system and onFire() events, etc.
And finally here is a simple example designed for use in Torque 3D, though will work in TGE/TGEa with minor modification: AssaultBuggy
#3
As Michael said, you can mount weapon images to Vehicles the same way you mount them to Players. However, the Player class (in TGE at least) doesn't seem to pass triggers on to controlled objects. So if you're controlling a Player mounted in a vehicle, you won't be able to fire the weapons, but you will be able to fire your own. If you're controlling the Vehicle itself, you'll be able to fire.
09/08/2010 (11:09 pm)
Best necro ever!As Michael said, you can mount weapon images to Vehicles the same way you mount them to Players. However, the Player class (in TGE at least) doesn't seem to pass triggers on to controlled objects. So if you're controlling a Player mounted in a vehicle, you won't be able to fire the weapons, but you will be able to fire your own. If you're controlling the Vehicle itself, you'll be able to fire.
Jon David Cook