Wheeled Vehicle Triggered Sounds
by Rex · in Torque Game Engine · 12/15/2003 (6:48 am) · 7 replies
I'm dropping the default buggy as a vehicle and getting Sounds together to trigger appropriately. The script I'm using seems to be a glom of the Scout and Buggy scripts. I'm noticing the references to the AudioProfile datablocks near the bottom of the script...is there a reference to what Sounds are availble when triggered in the buggy? I mean, I've gotten EngineSound, SquealSound, Soft/Hard Impact ones working and understand when they're triggered, but the WheelImpact eludes me, and I'm wondering about the Thrust and others...? When and what do these do? Thanks all motor heads..:)
About the author
Rex does all his 3D graphics through BrokeAssGames and is currently working on DSQTweaker, Ecstasy Motion, and other interesting projects yet to be revealed. Just ask him about anything DTS/DSQ related, he's happy to help.
#2
12/15/2003 (3:59 pm)
Hmm....interesting. Thanks Canon. Something must be amiss...I'm not noticing it triggering...perhaps assigning another more distinctive sound to check better...took me a bit to figure where squeal occurs...Does SkidSound occur when the brake SpaceBar is pressed?
#3
That being said, the jetSound is not functioning in the example script because there is no key assigned to enable the "Thrust" feature of a vehicle. You need to map a key to that and enable thrusting (turbo, basically) in your vehicle's script to make that whole thing work.
Other than that, I haven't personally extended the audio system too much beyond making the examples all work... haven't played much with VehicleExplosion either, come to think of it.
As I'm thinking about the WheelImpactSound, you might need to add in some code to enable "onCollision" handling for the wheels themselves, since the wheels seem to be somewhat separate from the vehicle with the newer codebase (since ver. 1.1 or so, they changed the way wheels worked, I think). However, I'm not sure if this is right.. just a thought since I havn't yet played with this.
HTH. :-)
12/16/2003 (9:20 am)
There are many sounds available in the wheeledVehicle class that aren't being used by the scripts included (if I remember right). Even some that are in the scripts are not "turned on" for use, so you have to go through wheeledVehicle.cc/.h and find out what's available from there first.That being said, the jetSound is not functioning in the example script because there is no key assigned to enable the "Thrust" feature of a vehicle. You need to map a key to that and enable thrusting (turbo, basically) in your vehicle's script to make that whole thing work.
Other than that, I haven't personally extended the audio system too much beyond making the examples all work... haven't played much with VehicleExplosion either, come to think of it.
As I'm thinking about the WheelImpactSound, you might need to add in some code to enable "onCollision" handling for the wheels themselves, since the wheels seem to be somewhat separate from the vehicle with the newer codebase (since ver. 1.1 or so, they changed the way wheels worked, I think). However, I'm not sure if this is right.. just a thought since I havn't yet played with this.
HTH. :-)
#4
The best way I found when first playing with this was to take a single sound file, like a "beep" or "buzz" that is loud-ish and obvious, and just turn on one sound at a time. When you start the game and run around a bit, you will know what event that's triggering the sound, because it's the only sound in the game! Maybe this is a bit brutish to do, but it sure worked well for my needs to get a feel for how the system worked instead of reading through code.
12/16/2003 (9:26 am)
Another note... the absolute best way to learn about all these sounds and exactly when they're being triggered (IMO) is to put in extremely obvious sounds and apply them to an event. At first I used the included "testing.wav" file, but it looped too long and hurt my head. The best way I found when first playing with this was to take a single sound file, like a "beep" or "buzz" that is loud-ish and obvious, and just turn on one sound at a time. When you start the game and run around a bit, you will know what event that's triggering the sound, because it's the only sound in the game! Maybe this is a bit brutish to do, but it sure worked well for my needs to get a feel for how the system worked instead of reading through code.
#5
12/17/2003 (7:26 am)
Many Thanks Paul, your method is not lost on me...;), and you answered another unvocalized question I had...namely that I needed to look inside the source code,(.cc/.h filetypes), I'm just learning scripting and have no idea how to reach those files,...I'm merely a contract artist working on a project for next year...I assume they're within the SDK for compiling into the engine??;) and why this information isn't pubiclly posted.
#6
12/17/2003 (8:52 am)
If you're working much with sound, you'll need the source code (ie, an SDK license) or the support of a coder to figure what corresponds to what. If it's not vanilla Torque you'll need to talk to the person who made the changes.
#7
12/20/2003 (7:41 am)
Thanks Ben, I've taken the slower test by numbers route...I have noticed a few areas where I can change some values to get the impact sounds happening with 'softer' impacts...I can get the HardImpact under some control, but nothing I do seems to get the SoftImpact triggering at all, ? how soft is Soft, hehe...when I got too soft, it starts to inflict damage...I mean it should be considered a HardImpact running full steam into a non-moving barrel, no? hehe
Associate Canon
The WheelImpactSound is triggered when a wheel of your buggy impacts an obstacle.
Christophe
www.frogames.com