Where are the starter.fps footstep sounds called from ?
by Kent Young · in Torque Game Engine · 09/24/2006 (1:11 am) · 5 replies
Hi all. I am a newbie to the torque engine- but I have been able to understand quite a bit, however I started a game from scratch and I wanted to put footstep sounds in (like the demo- starter.fps). I have the book 3D Game Programming All in One and I understand how the script file they describe works. But I wanted to find out how the demo implements the footsteps! I have poured over all the script files but cannot find how the sound files are called. Then I saw a blurb in the book about DTS files supporting animation triggers! Is this what is happening here? I don't really need an explanation of how it is done... just where it is done! (which files to look in) Thanks in advance!
#2
below. And I understand how you can call DeathCrySound from the playDeathCry
method below, but I don't see anything for calling the footstep sounds.
Any ideas?
//----------------------------------------------------------------------------
// Player Audio Profiles
//----------------------------------------------------------------------------
datablock AudioProfile(DeathCrySound)
{
fileName = "~/data/sound/orc_death.ogg";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(FootLightSoftSound)
{
filename = "~/data/sound/footstep_soft.ogg";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(FootLightHardSound)
{
filename = "~/data/sound/footstep_hard.ogg";
description = AudioClose3d;
preload = true;
};
//-----------------------------------------------------------------------------
// Player methods
//-----------------------------------------------------------------------------
function Player::playDeathCry( %this )
{
%this.playAudio(0,DeathCrySound);
}
09/24/2006 (2:35 pm)
Thanks Joseph, I had already looked there and can see the Audio Profilesbelow. And I understand how you can call DeathCrySound from the playDeathCry
method below, but I don't see anything for calling the footstep sounds.
Any ideas?
//----------------------------------------------------------------------------
// Player Audio Profiles
//----------------------------------------------------------------------------
datablock AudioProfile(DeathCrySound)
{
fileName = "~/data/sound/orc_death.ogg";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(FootLightSoftSound)
{
filename = "~/data/sound/footstep_soft.ogg";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(FootLightHardSound)
{
filename = "~/data/sound/footstep_hard.ogg";
description = AudioClose3d;
preload = true;
};
//-----------------------------------------------------------------------------
// Player methods
//-----------------------------------------------------------------------------
function Player::playDeathCry( %this )
{
%this.playAudio(0,DeathCrySound);
}
#3
09/24/2006 (2:57 pm)
The footstep sounds are called by animation triggers within the model. Actually it is in the source code, but plays based off of triggers in the animation. A materials property file is used to tell the engine what footstep sound, listed in the player.cs file, to play within a specific mission.
#4
09/24/2006 (2:58 pm)
If it isn't in the scripts it will be in the C++ code. player.cc I assume but I don't know the source that well.
#5
09/24/2006 (3:00 pm)
void Player::playFootstepSound ( bool triggeredLeft, S32 sound )
Associate Joseph Euan