OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Blanco on 13 Aug 2004, 17:48:44
-
In all the dialogs I'v seen, people use the BIS click sounds :
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.
-
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...
-
I've found a solution.First define the sound in the description.ext as usual. Then remove the default click sound of the button :
soundClick[] = {"", 0.2, 1};
then put some code in action in the control options of that button :
action = "playsound ""button""";
The string "button" needs double qoutes!
Simple as that.
-
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... ::)