Jump to content

Photo
- - - - -

Addon based cfgSounds, what's the prerequisite?


  • Please log in to reply
6 replies to this topic
Thread Starter
CarlGustaffa
CarlGustaffa

    Captain

  • Members
  • 6397 posts

  • Joined: 13-March 2007

Posted 15 April 2012 - 11:04 #1

Hi

Trying to make my first addon from scratch, which uses a script to create some triggers that play sounds. However, the first entry of setSoundEffect have to play a dummy sound in order to not get an error message.

When doing it for missions, I simply put this in Description.ext:
class CfgSounds {
	sounds[] = {};
	class BiB_VRS_NoSound {name = "BiB_VRS_NoSound";sound[] = {"", 0, 1};titles[] = {};}; //Dummy sound needed for setSoundEffect command, due to stupid bug in engine.
};
But in addon I'm getting "sound BiB_VRS_NoSound not found".The other sounds (CfgSFX based) shows up in editor trigger list as expected, but the NoSound definition doesn't show up anywhere. I think I'm missing some kind of addon prerequisite. The addon (scripts and sound trigger movement) works, except for that annoying error message, which I'm trying to get rid of.

The quick question is: How do you create an addon that defines CfgSounds? Example needed, I'm a total noob wrt addon making :)
Regards
Carl Gustaffa - left this game due becoming Steam Exclusive :(

Thread Starter
CarlGustaffa
CarlGustaffa

    Captain

  • Members
  • 6397 posts

  • Joined: 13-March 2007

Posted 25 April 2012 - 10:04 #2

Ehh, nobody knows this?
Regards
Carl Gustaffa - left this game due becoming Steam Exclusive :(

Sealife
Sealife

    Banned

  • 1362 posts

  • Joined: 26-August 2011

Posted 25 April 2012 - 17:13 #3

remember it goes outside the confines of any cfgvehicles if you have it in your .cpp

otherwise i think this will work.
class CfgSounds {
	class BiB_VRS_NoSound  {
		sound[] = {"", 0, 1, 0};
		titles[] = {};
	};	
};


Thread Starter
CarlGustaffa
CarlGustaffa

    Captain

  • Members
  • 6397 posts

  • Joined: 13-March 2007

Posted 25 April 2012 - 22:04 #4

Got it working, thanks. I'm pointing to actual files with nothing in them though, in case it matters. What do you mean by
"remember it goes outside the confines of any cfgvehicles if you have it in your .cpp"?
Does it replace anything without "required addon" and dependencies set? If so, what am I missing? I'm not getting the error messages anymore, but I'm also not seeing the sound name. So I added name = "something" and they showed up in the list. But now (maybe also before) I'm getting messages like:
String STR_DN_biggameclose not found
String STR_DN_biggamedistant not found
String STR_DN_FACTORY01 not found
String STR_DN_FACTORY2 not found
... (and all the other vanilla factory sounds, some of which are placed automatically by the addon)...
whenever I make use of the trigger effect list in the editor. the first two (biggame) puzzles me, as they're not used as island sounds for Takistan (only Chernarus/Utes), although I suspect the error is mine. But the factories? I haven't touched anything there. Does what I do affect them somehow? Haven't checked yet if they show up also without my addon in use though.

Thanks for the assistance, at least got rid of thousands of lines of error spamming :)
Regards
Carl Gustaffa - left this game due becoming Steam Exclusive :(

Sealife
Sealife

    Banned

  • 1362 posts

  • Joined: 26-August 2011

Posted 26 April 2012 - 06:20 #5

Are these missing strings from your sounds or vanilla

It usually bad inheritance that causes these things or bad override of class.

Thread Starter
CarlGustaffa
CarlGustaffa

    Captain

  • Members
  • 6397 posts

  • Joined: 13-March 2007

Posted 27 April 2012 - 18:30 #6

The biggame ones are my own sounds (looking into that right now), but the factory ones are default.
Regards
Carl Gustaffa - left this game due becoming Steam Exclusive :(

feint
feint

    Gunnery Sergeant

  • Members
  • 561 posts

  • Joined: 09-September 2008

Posted 28 April 2012 - 02:52 #7

I don't know if this will help you or not, but for my Raven mod, this is how I'm using sounds:

Basically, I have at least two files:
  • config.cpp which defines classnames, volume, etc for sounds
  • whatever.sqf file that calls the sounds by their classnames
I've had best results using "say" as I can control the volume in the config (not the real volume, but how far the sound "spreads" out from the source)

config.cpp:

class CfgSounds
{
        // List of sounds (to appear in triggers)
        /* NOTE - I HAVE DISABLED THIS LINE AS IT WAS DISABLING THE SOUNDS FROM PLAYING FOR SOME REASON */
        // sounds[] = {propBuzz,antiTamper,watchBeep_alarm,propBuzz2,prop_startup,addTime};
        
        // Definition for each sound
        class propBuzz
        {
                name = "propBuzz"; // Name for mission editor
                sound[] = {\raven\sounds\propBuzz.ogg, db-25, 1.0};
                titles[] = {0, ""};
        };
        
        class antiTamper
        {
                name = "antiTamper"; // Name for mission editor
                sound[] = {\raven\sounds\antiTamper.ogg, db-15, 1.0}; // db-15 spreads a little farther than db-25 as it was hard to hear over the engine noise
                titles[] = {0, ""};
        };
        
        class watchBeep_alarm
        {
                name = "watchBeep_alarm"; // Name for mission editor
                sound[] = {\raven\sounds\watchBeep_alarm.ogg, db-25, 1.0};
                titles[] = {0, ""};
        };
        class propBuzz2
        {
                name = "propBuzz2"; // Name for mission editor
                sound[] = {\raven\sounds\propBuzz2.ogg, db-25, 1.0};
                titles[] = {0, ""};
        };
        class prop_startup
        {
                name = "prop_startup"; // Name for mission editor
                sound[] = {\raven\sounds\prop_startup.ogg, db-25, 1.0};
                titles[] = {0, ""};
        };
         class addTime
        {
                name = "addTime"; // Name for mission editor
                sound[] = {\raven\sounds\addTime.ogg, db-25, 1.0};
                titles[] = {0, ""};
    };
        
};

Here's a script that plays the engine sound for the Raven while it is in flight:

mavSoundOn.sqf:

private ["_microAirVehicle"];
_microAirVehicle = _this;


while {mavSoundOn == 1} do
{
        _microAirVehicle say ["propBuzz2",1]; // I AM CALLING THE CLASSNAME OF THE SOUND DIRECTLY - NOT A STRING
        sleep 0.9980; // WAS 0.9984
};


Posted Image