SoundButtonOver not working
by Adam Griffiths · in Torque Game Builder · 06/05/2008 (7:16 am) · 5 replies
Hello All,
I'm having severe problems trying to get a sound to play when the mouse is highlighted over a button. I've read up on the soundButtonOver field within the GuiCtrl but it isn't working properly.
I've tried to follow tutorials but no luck.
My set up is as follows:
Created an Audio Description for the sound called "selectButton"
Created a Gui Profile called AudibleButtonProfile and set soundButtonOver = "selectButton";
I've then created my button and given it the AudibleButtonProfile.
When I run the game, the button is highlighted as I can see by the change in state of the button however the sound is not played.
I then tried to use an echo statement to find out the button status and it just came up with a blank:
==>echo(isObject(controls));
1
==>echo(controls.soundButtonOver);
==>echo(controls.position);
410 270
So i know the button is there, it is highlighted, its in the correct position, yet it isn't playing. I've also tried the soundButtonDown, using another file that I know definitely works, setting the soundButtonOver field within the button and not within a profile, and none of these make any difference.
I really am at my wits end with this and really hope someone can help me!
I'm having severe problems trying to get a sound to play when the mouse is highlighted over a button. I've read up on the soundButtonOver field within the GuiCtrl but it isn't working properly.
I've tried to follow tutorials but no luck.
My set up is as follows:
Created an Audio Description for the sound called "selectButton"
Created a Gui Profile called AudibleButtonProfile and set soundButtonOver = "selectButton";
I've then created my button and given it the AudibleButtonProfile.
When I run the game, the button is highlighted as I can see by the change in state of the button however the sound is not played.
I then tried to use an echo statement to find out the button status and it just came up with a blank:
==>echo(isObject(controls));
1
==>echo(controls.soundButtonOver);
==>echo(controls.position);
410 270
So i know the button is there, it is highlighted, its in the correct position, yet it isn't playing. I've also tried the soundButtonDown, using another file that I know definitely works, setting the soundButtonOver field within the button and not within a profile, and none of these make any difference.
I really am at my wits end with this and really hope someone can help me!
#2
06/05/2008 (12:55 pm)
Can you type into the console "alxPlay(selectButton)"?
#3
Put your audio files and all gui audio profiles in the common/gamescripts/audio.cs file. Make sure to use the Descriptions already set up there.
Also a note. Updating the project with new versions of TGB will often delete files in the common directory, so back it up before you do an update!!
EDIT: Put your audio files in common/data/audio/ Sorry. :-)
06/05/2008 (1:37 pm)
OK, a few months ago I spent hours fighting this one, here is what I came up with. Put your audio files and all gui audio profiles in the common/gamescripts/audio.cs file. Make sure to use the Descriptions already set up there.
Also a note. Updating the project with new versions of TGB will often delete files in the common directory, so back it up before you do an update!!
EDIT: Put your audio files in common/data/audio/ Sorry. :-)
#4
All worked perfectly first time so very many thanks to you for sorting me out with that!
*** EDIT ***
Lol, that joy was short lived! Did as above and all worked perfectly when running the game from TGB. However, when I built the game and ran it, the sound again wasn't there. On checking the object again I found the button didn't have any data for soundButtonOver.
Did you build your game and it work okay?
06/06/2008 (2:09 am)
Many many thanks to you Greg, followed what you said and yeah put the select button sound in the common/data/audio folder. Used the audio description that was already inside the common/gamescripts/audio.cs and stuck the audio profile for the sound in there too.All worked perfectly first time so very many thanks to you for sorting me out with that!
*** EDIT ***
Lol, that joy was short lived! Did as above and all worked perfectly when running the game from TGB. However, when I built the game and ran it, the sound again wasn't there. On checking the object again I found the button didn't have any data for soundButtonOver.
Did you build your game and it work okay?
#5
You might want to check your common folder and see if it all got deleted. When I upgraded from 1.6 to 1.7, a lot of directories in common were deleted and I had to redo the button sounds. Fortunately I have a subversion system I can pull from.
If this is not the case, you might want to try a Debug build and see if there are any directory or openAL errors listed. You may be linked to a bad openAL library?
06/06/2008 (12:43 pm)
Yes, I am working on a built version right now with XCode in Mac. One note on my method, I do not build directly into the game project folder, I build in a separate folder and copy over the TGB game application into my project directory. You might want to check your common folder and see if it all got deleted. When I upgraded from 1.6 to 1.7, a lot of directories in common were deleted and I had to redo the button sounds. Fortunately I have a subversion system I can pull from.
If this is not the case, you might want to try a Debug build and see if there are any directory or openAL errors listed. You may be linked to a bad openAL library?
Torque Owner Charles "monkeyboy" Gibson