Game Development Community

ButtonOver and ButtonClick sounds not working

by Orion the Hunter · in Torque Game Builder · 07/19/2012 (2:41 pm) · 0 replies

EDIT: I completely redid my thread because I believe the problem wasn't well stated.

Hello,

I seem to be having problems with my buttonClick variable.

I added this to “AudioData.cs”

datablock AudioProfile( ClickButton )
{
    filename    = "./data/sfx/buttonClick.wav";
    description	= "SoundOnce";
    preload     = true;
};

datablock AudioProfile( HoverButton )
{
    filename    = "./data/sfx/buttonOver.wav";
    description	= "SoundOnce";
    preload     = true;
};

And in “Profiles.cs”

I defined the SoundButtonOver and SoundButtonDown variables in GuiDefualtProfile as
soundButtonDown = "ClickButton";
   soundButtonOver = "HoverButton";

But when I launch the game and try to put my cursor or click a button I hear no sound. Just silence (well, all except for the music of course).

The error from the console is:

Quote:Object 'ClickButton' is not a member of the 'AudioProfile' data block class
Object 'HoverButton' is not a member of the 'AudioProfile' data block class

But I do know that the files are valid, because if I write
Quote:==>playmusic( clickbutton );
==>playmusic( hoverbutton );
in the console, I hear the sounds.

Does anyone know why I’m getting this problem?

Thanks a lot!