Game Development Community

Can't change sounds from default GUI button

by Frank Bignone · in Torque Game Engine · 11/02/2001 (8:43 am) · 7 replies

Hy,

I would like to set different sounds for different buttons, but i'm stick with the default one. I can change the default but I cannot change it per button.

I'm doing something like that :
new GuiButtonCtrl() {
      profile = "GuiButtonProfile";
      horizSizing = "right";
      vertSizing = "top";
      position = "29 434";
      extent = "110 20";
      minExtent = "8 8";
      visible = "1";
      command = "quit();";
      helpTag = "0";
      text = "Quit";
      soundButtonOver = "ShutdownSound";
}

ShutdownSound is defined, but it does not play at all.

About the author

Real programmers don't waste time recompiling; they patch the binary files... ... Real programmers don't waste time patching binary files; they patch memory.


#1
11/02/2001 (9:22 am)
Sounds still work in progress Frank, so maybe some of the sound functions still need work. What youve done looks right to me, but Ive not had any chance to look over the sound code yet.

Phil.
#2
11/02/2001 (9:50 am)
In fact, I do not hink it's related with the sound. It seems I cannot override parameters set by the profile. For example, I tried to change the font size and it did not apply.

Any hints ?

It should be a very stupid things, but I'm quite tired.
#3
11/02/2001 (10:14 am)
Correct, currently sound can only be defined in the profiles and cannot be overridden in the object instantiation . The solution is to create a custom profile for your button that references the desired sound.

--Rick
#4
11/02/2001 (11:29 am)
Ok I have put it in the profile and now it works.
BTW, I have an internal error (crash) on some on my .wav, although other .wav file are correctly working.

Is there a typical .WAV format to follow ?

here is a link to the wav file which causes me an internal error perso.wanadoo.fr/hysteria/DoP/download/shutdowninprocess.wav

I use it when user clicks on the Quit button
#5
11/02/2001 (12:14 pm)
I just fixed a bug in the audio/audioBuffer.cc. If you are using CVS you can easily update just that file to the latest by selecting it and clicking update. Make sure to clear the sticky flag or it will get the previous tagged get.

Let me know if it solves your problem or if you have problems getting the file.

--Rick

PS We will be tagging Release_1_1_1 in CVS later today which will include the audio fix and many other updtes.
#6
11/02/2001 (1:15 pm)
Great !!!
Your fix is fine and solves my problem. All my sounds play perfectly.

Thanks
#7
11/02/2001 (1:21 pm)
anytime, keep in touch.
--Rick