Home   Help Search Login Register  

Author Topic: custom sounds for dialog buttons??  (Read 498 times)

0 Members and 1 Guest are viewing this topic.

Offline Blanco

  • Former Staff
  • ****
custom sounds for dialog buttons??
« on: 13 Aug 2004, 17:48:44 »
In all the dialogs I'v seen, people use the BIS click sounds :


Code: [Select]
class RscButton
{
       type = CT_BUTTON;
       idc = -1;
       style = ST_CENTER;
       colorText[] = {0, 0, 0, 1};
       sizeEx = 0.025;
       font = FontHTML;
       soundPush[] = { , 0.2, 1};
       soundClick[] = {"ui\ui_ok", 0.2, 1};
       soundEscape[] = {"ui\ui_cc", 0.2, 1};

The ui_ok file is the click sound, but I have made my own clicksound for a numeric keypad in a dialog I'm working on.
It's named button.ogg and it's correctly defined in the description.ext.
But I can't replace it with the UI_ok sound.
I tried :

soundClick[] = {"sound\button.ogg", 0.2, 1};

or

soundClick[] = {"\sound\button.ogg", 0.2, 1};

or

soundClick[] = {"button.ogg", 0.2, 1};

or

soundClick[] = {"\button.ogg", 0.2, 1};

Is it possible to use a custom sounds for a button in a dialog?

Thx in advance.


« Last Edit: 13 Aug 2004, 17:51:09 by Blanco »
Search or search or search before you ask.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:custom sounds for dialog buttons??
« Reply #1 on: 13 Aug 2004, 19:04:48 »
Try converting the .ogg to .wss or .wav...
BIS use .wss...

And lose the decsription.ext definition for the sound as the sound is 'called' by it's filename, not with the classname, so you don't need the definition...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Blanco

  • Former Staff
  • ****
Re:custom sounds for dialog buttons??
« Reply #2 on: 16 Aug 2004, 16:21:44 »
I've found a solution.First define the sound in the description.ext as usual. Then remove the default click sound of the button :

Code: [Select]
soundClick[] = {"", 0.2, 1};

then put some code in action in  the control options of that button :

Code: [Select]
action = "playsound ""button""";

The string "button" needs double qoutes!
Simple as that.

Search or search or search before you ask.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:custom sounds for dialog buttons??
« Reply #3 on: 16 Aug 2004, 17:00:21 »
I was going to suggest that very thing at first...

But I thought it would be way cooler (eh??) to have the sound actually be played by the soundClick[] ;D

But wth... That works, and that's the main goal... ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.