IndeedPete 1038 Posted February 19, 2015 (edited) Good day! I know I might not get any decent answer here as there's probably no-one but me trying to do this. Anyway, I have observed a small quirk with sounds in different directories. The usual way you all know is to have a few soundfiles in your mission dir and define CfgSounds in your description.ext. Something like this: class CfgSounds { sounds[] = {radio_chatter1, radio_chatter2, radio_chatter3}; class radio_chatter1 { ambient = 9; name = "radio_chatter1"; [b]sound[] = {\snd\radio_chatter1.ogg, 0.5, 1.0};[/b] titles[] = {0, ""}; }; class radio_chatter2 { ambient = 79; name = "radio_chatter2"; [b]sound[] = {\snd\radio_chatter2.ogg, 0.5, 1.0};[/b] titles[] = {0, ""}; }; class radio_chatter3 { ambient = 70; name = "radio_chatter3"; [b]sound[] = {\snd\radio_chatter3.ogg, 0.5, 1.0};[/b] titles[] = {0, ""}; }; }; Works fine, sounds are being played correctly, we live happily ever after. Now we'll go a step further and want to have sounds available throughout several campaign missions but without creating an addon. And of course they should work in the editor as well (which kind of rules out a definiton in the campaign description.ext). So, we set up a shared sounds dir in the campaign root (so we don't have to copy the sound files from mission dir to mission dir and avoid redundancies) and define them (in a shared config file) as follows: class CfgSounds { sounds[] = {radio_chatter1, radio_chatter2, radio_chatter3}; class radio_chatter1 { ambient = 9; name = "radio_chatter1"; [b]sound[] = {\Campaigns\IP_CMP_MYCAMPAIGN\snd\radio_chatter1.ogg, 0.5, 1.0};[/b] titles[] = {0, ""}; }; class radio_chatter2 { ambient = 79; name = "radio_chatter2"; [b]sound[] = {\Campaigns\IP_CMP_MYCAMPAIGN\snd\radio_chatter2.ogg, 0.5, 1.0};[/b] titles[] = {0, ""}; }; class radio_chatter3 { ambient = 70; name = "radio_chatter3"; [b]sound[] = {\Campaigns\IP_CMP_MYCAMPAIGN\snd\radio_chatter3.ogg, 0.5, 1.0};[/b] titles[] = {0, ""}; }; }; As a result we can't hear **** in our mission, don't see any error message or pop-up and run to the forums, crying, to post a desperate call for help. :) Side notes: Doesn't matter if there's a "\" before "Campaigns" or not, sounds won't be played regardless. Queries on CfgSounds within the mission show that these sounds are defined and known to the game. For all of you guys who've never fiddled around with campaigns, here's a plot twist: What doesn't seem to work with sound files (.ogg btw) works flawlessly with any other file type: // Works execVM "Campaigns\IP_CMP_MYCAMPAIGN\myScript.sqf"; // Works as well #include "Campaigns\IP_CMP_MYCAMPAIGN\myScript.sqf"; // Works, pretty neat for shared config files #include "\Campaigns\IP_CMP_MERCS\missions\description.hpp" // Also working class CfgFunctions { class IP { class base { class alert { file = "Campaigns\IP_CMP_MYCAMPAIGN\fnc\base\alert.sqf"; }; }; }; }; // Works like a charm player setObjectTexture [0, "Campaigns\IP_CMP_MYCAMPAIGN\txt\clothingxyz.paa"]; // Ignore wall of text, .jpg included from shared campaign dir, works fine player createDiaryRecord ["Diary", ["Device Information", "What's often just referred to as 'The Device' is actually a very powerful mobile fusion generator based on the Portable-Fusion-Power-Architecture (PFP) invented by Nobel prize winner Dr. Adam Zweistein. Deep Space Engineering is the first organisation to actually develop a functioning prototype of the PFP. Originally intended for use in deep space travel it has become clear that the PFP might be a solution to the problem of dwindling resources on earth itself. Thus, many nations as well as organisations are interested in obtaining said prototype for their own interests.<br/><br/>The PFP prototype loaded on a special truck.<br/><img image='Campaigns\IP_CMP_MERCS\img\briefing\Briefing_MMain06_Device.jpg' width='330' height='227'/>"]]; Appreciating any ideas to solve this without creating an addon or reduntantly copy sound files from mission to mission! :) Edited February 19, 2015 by IndeedPete Share this post Link to post Share on other sites
Larrow 2828 Posted February 19, 2015 I have no idea IP as i have never set up a campaign, but is that CfgSounds setup a copy and paste from your actual config? as you have miss spelt campaign compared to your further references. \Campagns\ instead of \Campaigns\ Share this post Link to post Share on other sites
IndeedPete 1038 Posted February 19, 2015 Ah no, that is unfortunately not a copy-paste mistake. I've actually experienced this issue in two campaign projects by now and can rule out copy-paste errors. To create this example I quickly added the "\Campagns\IP_CMP_MYCAMPAIGN" to the actual config and then copy-pasted it. Will fix it in the OP to prevent further confusions.^^ Thanks for letting me know though. Share this post Link to post Share on other sites
Kydoimos 916 Posted February 19, 2015 (edited) Oh god, I'm just dreading this - I've got to do the same with Resist at some point - at present I'm duplicating files for each mission! :P Bump +1 solution for IndeedPete! So, it's working with images, just not sounds? Man, that's really, really odd. I'll have a look soon, see if I can figure anything out! Just out of interest, I wonder how BIS did it? There's some sounds in the campaign data PBOs which are in addition to the default sounds - I'll check it out and report back! ---------- Post added at 21:22 ---------- Previous post was at 20:35 ---------- Seems there's a cfgSounds.hpp file in the BIS campaign PBO - I'm not familiar with hpp files, but it looks like some sounds have been defined there. Not sure if that's any help at all? :) Edited February 19, 2015 by Kydoimos Share this post Link to post Share on other sites
IndeedPete 1038 Posted February 19, 2015 I wouldn't say it's impossible with sounds in general. Next thing on my list to try is to use the kbTell system to play sounds from the shared dir. As said, images, textures, script files - no problem. So finally packing Resist into one nice, clean PBO won't be much of a problem. On the contrary, it will probably shrink to a decent size without the redundant files. You can store your textures in the campaign dir and voice sounds in the mission dirs - only interesting part are sound files and music. If you want to pulish it in addon format as you did before IIRC you can just add your CfgSounds and CfgMusic to the config.cpp, mind the file paths though. And keep in mind that - if defined in config.cpp - your sounds and music will show up in the editor / be accessible for everyone running your campaign because it'll function like a regular addon. Without looking it up I'd say they defined additional sounds right in their config.bin/.cpp (located in missions_f_EPA.pbo for example), so as addon format. I'm talking about old-school campaign PBOs here. I'll probably do the same on release but until then I find it annoying to repack addons for every single change. It just saves some valuable dev time when I don't have to restart the game every few minutes. Plus I'm curious if other hobby devs stumbled across this one. My CfgFunctions is also defined mission-based instead of campaign-based - access to the campaign root from the editor makes it possible. Share this post Link to post Share on other sites
Kydoimos 916 Posted February 19, 2015 @IndeedPete - ah, that's really interesting! I'm bookmarking this thread - thanks for that! Hmm, wished I could be of more help on the issue at hand though - feel a bit bad, you're so incredibly helpful, just itching to return the favour! Let me know if I can throw any User Textures your way, or design you some textures, icons etc. :) I know what you mean about having to repack everything, every time you make a change - it's not a lot of fun! Share this post Link to post Share on other sites
IndeedPete 1038 Posted February 19, 2015 Ah, thanks, no problem, happy to help! I'll think of something, don't worry! On topic: Playing sounds (.ogg again) from the campaign dir via kbTell works just fine, weird. Here's a sentences.bikb: class Sentences { class go_away { ambient = 1; customText = "Go away."; text = ""; speech[] = {"\Campaigns\IP_CMP_ICE\dub\go_away.ogg"}; actor = "MrCrazyDude115"; variant = ""; variantText = ""; class Arguments {}; }; class go_away_or_i_will_hurt_you_you_got_that { ambient = 1; customText = "Go away or I will hurt you. You got that?"; text = ""; speech[] = {"\Campaigns\IP_CMP_ICE\dub\go_away_or_i_will_hurt_you_you_got_that.ogg"}; actor = "MrCrazyDude115"; variant = ""; variantText = ""; class Arguments {}; }; class i_dont_know_you { ambient = 1; customText = "I don't know you."; text = ""; speech[] = {"\Campaigns\IP_CMP_ICE\dub\i_dont_know_you.ogg"}; actor = "MrCrazyDude115"; variant = ""; variantText = ""; class Arguments {}; }; class just_go_away { ambient = 1; customText = "Just go away."; text = ""; speech[] = {"\Campaigns\IP_CMP_ICE\dub\just_go_away.ogg"}; actor = "MrCrazyDude115"; variant = ""; variantText = ""; class Arguments {}; }; class just_make_it_quick_alright { ambient = 1; customText = "Just make it quick, alright?"; text = ""; speech[] = {"\Campaigns\IP_CMP_ICE\dub\just_make_it_quick_alright.ogg"}; actor = "MrCrazyDude115"; variant = ""; variantText = ""; class Arguments {}; }; class just_make_it_quick_ive_got_better_things_to_do { ambient = 1; customText = "Just make it quick, I've got better things to do."; text = ""; speech[] = {"\Campaigns\IP_CMP_ICE\dub\just_make_it_quick_ive_got_better_things_to_do.ogg"}; actor = "MrCrazyDude115"; variant = ""; variantText = ""; class Arguments {}; }; class leave_me_alone { ambient = 1; customText = "Leave me alone."; text = ""; speech[] = {"\Campaigns\IP_CMP_ICE\dub\leave_me_alone.ogg"}; actor = "MrCrazyDude115"; variant = ""; variantText = ""; class Arguments {}; }; class what { ambient = 1; customText = "What?"; text = ""; speech[] = {"\Campaigns\IP_CMP_ICE\dub\what.ogg"}; actor = "MrCrazyDude115"; variant = ""; variantText = ""; class Arguments {}; }; class what_do_you_want { ambient = 1; customText = "What do you want?"; text = ""; speech[] = {"\Campaigns\IP_CMP_ICE\dub\what_do_you_want.ogg"}; actor = "MrCrazyDude115"; variant = ""; variantText = ""; class Arguments {}; }; class what_is_it { ambient = 1; customText = "What is it?"; text = ""; speech[] = {"\Campaigns\IP_CMP_ICE\dub\what_is_it.ogg"}; actor = "MrCrazyDude115"; variant = ""; variantText = ""; class Arguments {}; }; }; class Arguments{}; class Special{}; startWithVocal[] = {hour}; startWithConsonant[] = {europe, university}; Share this post Link to post Share on other sites