Jump to content
Sign in to follow this  
autigergrad

Play3D sound....what am I doing wrong??

Recommended Posts

So I've been racking my brain trying to figure out what I'm doing wrong in order to get something I imported into the game to play in 3D.

I'm fine with having my custom music, sounds work in 2D (ie always on the player location) yet when I name an object (speaker1 for example) then put on the trigger (speaker1 say3D "sound"). Nothing happens. If I set a stock in game sound as the say 3D sound then it works perfectly.

So why are my custom sounds music working perfectly in 2d space but only stock sounds/music working for me in 3d space.

Any advice would be appreciated.

Share this post


Link to post
Share on other sites

Did you define your sound in CfgMusic or CfgSounds?

Share this post


Link to post
Share on other sites
Did you define your sound in CfgMusic or CfgSounds?

I did. I actually tried it with both setups as well...first as setting my sound as Music...then I tried it as Sound to see if I would have anymore luck.

Again...they work perfectly when I have them play as a standard 2D sound...but nothing happens when I set them up for 3d. But I know my 3d commands are correct because if I test it with a stock sound from the game...the 3d sound works perfectly.

It's driving me nuts as I would love to add some custom news on the radio, etc. in my missions.

Share this post


Link to post
Share on other sites

If I'm not mistaken it's a pathing issue for custom 3d sounds... see KK's blog:

http://killzonekid.com/arma-scripting-tutorials-mission-root/

In most cases Arma 3 would let you get away with relative path to your assets like “sounds\mysound.wss†for example, which would mean mission root folder -> sounds folder -> mysound file. However some commands such as drawIcon3D or playSound3D will not understand relative mission path, although these commands will work fine if you have your assets stored in an AddOn.

Share this post


Link to post
Share on other sites

Ok, so your having trouble getting sounds in arma. :391:

Here is what you need to do to get a sound working:

Step 1. Open the ArmA 3 editor, then give the mission a name of your choice and save. (shortcut key is Left Ctrl + S)

Step 2. To start off (lets say you have an .mp3 or .wav, and wish to export it into an .ogg) Download and install Audacity:

Link: http://audacityteam.org/

Step 3. Audacity is a software editing program, it also has a built in .ogg exporter. So open your sound with the program.

Step 4. Once the sound has been loaded. In Audacity, browse to File\Export. Then save it as a ".ogg" listed in the options below the dialog in "C:\Users\YourProfileName\Documents\Arma 3 - Other Profiles (Or Arma 3)\YourName\missions". (make sure the file you saved is in missions, not mpmissions. Just to be safe)

Step 5. Browse to the location you saved (obviously the mission folder you saved) and create a "description.ext". (Open it with Notepad. If you have Notepad++, use it.)

Step 6. Put this in your description.ext and edit the names "EditMe":

class CfgSounds
{
sounds[] = {EditMe}; //this is where your "class EditMe" goes! (class does not go into it, though)


class EditMe
{
	name = "EditMe"; // Display Name for editor
	sound[] = {EditMe.ogg, db + 0, 1.0}; //Location of sound, bear in mind it will only find locations WITHIN the mission!
	titles[]={}; //Do not use unless you know what you are doing!
};
};

Step 7. Create an "init.sqf" using notepad, and paste the following: (Again, edit the "EditMe")

player say3D "EditMe"; //classname of your sound, remember the "class EditMe"? Again, do not put "class" in!

Step 8. Preview.

There you have it! If you would like to know more on how to use the CfgSounds or CfgMusic, take a look at:

https://community.bistudio.com/wiki/Description.ext

If you would like to know more about the "say3D" command, take a look at:

https://community.bistudio.com/wiki/say3D

Check out their additional information as well, heaps of good links to other codes ;)

Kind Regards,

Rawner135

Share this post


Link to post
Share on other sites

It didn't work with my custom sounds. It worked with the "stock" vanilla sounds available perfectly. I see my custom sounds in the drop down menu under effects so I know that they are logged correctly. Still won't play though.

Share this post


Link to post
Share on other sites

Here's what I've done to get custom sounds working just a few days ago. FYI, I've got a generator that has a few failed attempts to start up before kicking over successfully, and sounds to go with it. I also have a sound play when it gets turned off.

In your init.sqf put this:

init.sqf

[color="#FF8040"][color="#006400"][i]///////[/i][/color]
[color="#006400"][i]//Mission root pathname stuff.[/i][/color]
[color="#006400"][i]///////[/i][/color]

MISSION_ROOT [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]call[/b][/color] [color="#8B3E2F"][b]{[/b][/color]
   [color="#191970"][b]private[/b][/color] [color="#7A7A7A"]"_arr"[/color][color="#8B3E2F"][b];[/b][/color]
   [color="#1874CD"]_arr[/color] [color="#8B3E2F"][b]=[/b][/color] [color="#191970"][b]toArray[/b][/color] [color="#1874CD"]__FILE__[/color][color="#8B3E2F"][b];[/b][/color]
   [color="#1874CD"]_arr[/color] [color="#191970"][b]resize[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]count[/b][/color] [color="#1874CD"]_arr[/color] [color="#8B3E2F"][b]-[/b][/color] [color="#FF0000"]8[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color]
   [color="#191970"][b]toString[/b][/color] [color="#1874CD"]_arr[/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

Then, in your description.ext define the sounds. I know you said you've done this already, but here's what I have:

description.ext

[color="#FF8040"]class CfgSounds
[color="#8B3E2F"][b]{[/b][/color]
sounds[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
class generator1Fail
[color="#8B3E2F"][b]{[/b][/color]
	[color="#006400"][i]// how the sound is referred to in the editor (e.g. trigger effects)[/i][/color]
	[color="#191970"][b]name[/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"generator1Fail"[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#006400"][i]// filename, volume, pitch[/i][/color]
	sound[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#7A7A7A"]"sounds\generator1Fail.ogg"[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
	[color="#006400"][i]// subtitle delay in seconds, subtitle text [/i][/color]
	titles[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
class generator2Fail
[color="#8B3E2F"][b]{[/b][/color]
	[color="#006400"][i]// how the sound is referred to in the editor (e.g. trigger effects)[/i][/color]
	[color="#191970"][b]name[/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"generator2Fail"[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#006400"][i]// filename, volume, pitch[/i][/color]
	sound[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#7A7A7A"]"sounds\generator2Fail.ogg"[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
	[color="#006400"][i]// subtitle delay in seconds, subtitle text [/i][/color]
	titles[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
class generator3Fail
[color="#8B3E2F"][b]{[/b][/color]
	[color="#006400"][i]// how the sound is referred to in the editor (e.g. trigger effects)[/i][/color]
	[color="#191970"][b]name[/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"generator3Fail"[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#006400"][i]// filename, volume, pitch[/i][/color]
	sound[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#7A7A7A"]"sounds\generator3Fail.ogg"[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
	[color="#006400"][i]// subtitle delay in seconds, subtitle text [/i][/color]
	titles[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
class generator4Start
[color="#8B3E2F"][b]{[/b][/color]
	[color="#006400"][i]// how the sound is referred to in the editor (e.g. trigger effects)[/i][/color]
	[color="#191970"][b]name[/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"generator4Start"[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#006400"][i]// filename, volume, pitch[/i][/color]
	sound[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#7A7A7A"]"sounds\generator4Start.ogg"[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
	[color="#006400"][i]// subtitle delay in seconds, subtitle text [/i][/color]
	titles[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
class generator5Running
[color="#8B3E2F"][b]{[/b][/color]
	[color="#006400"][i]// how the sound is referred to in the editor (e.g. trigger effects)[/i][/color]
	[color="#191970"][b]name[/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"generator5Running"[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#006400"][i]// filename, volume, pitch[/i][/color]
	sound[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#7A7A7A"]"sounds\generator5Running.ogg"[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
	[color="#006400"][i]// subtitle delay in seconds, subtitle text [/i][/color]
	titles[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
class generator6Stopping
[color="#8B3E2F"][b]{[/b][/color]
	[color="#006400"][i]// how the sound is referred to in the editor (e.g. trigger effects)[/i][/color]
	[color="#191970"][b]name[/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#7A7A7A"]"generator6Stopping"[/color][color="#8B3E2F"][b];[/b][/color]
	[color="#006400"][i]// filename, volume, pitch[/i][/color]
	sound[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#7A7A7A"]"sounds\generator6Stopping.ogg"[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]1[/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
	[color="#006400"][i]// subtitle delay in seconds, subtitle text [/i][/color]
	titles[color="#8B3E2F"][b][[/b][/color][color="#8B3E2F"][b]][/b][/color] [color="#8B3E2F"][b]=[/b][/color] [color="#8B3E2F"][b]{[/b][/color][color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color]
[color="#8B3E2F"][b]}[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

Then finally, the code to play the sound:

[color="#FF8040"][color="#191970"][b]playSound3D[/b][/color] [color="#8B3E2F"][b][[/b][/color]MISSION_ROOT [color="#8B3E2F"][b]+[/b][/color] [color="#7A7A7A"]"sounds\generator1Fail.ogg"[/color][color="#8B3E2F"][b],[/b][/color]generator[color="#8B3E2F"][b],[/b][/color][color="#000000"]true[/color][color="#8B3E2F"][b],[/b][/color][color="#191970"][b]getPosASL[/b][/color] generator[color="#8B3E2F"][b],[/b][/color] [color="#FF0000"]2[/color][color="#8B3E2F"][b]][/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Made with KK's SQF to BBCode Converter

The file "sounds\generator1Fail.ogg" just has to point to where you've got the sounds saved in the mission directory. KK's blog has a write up on it that is linked from the playSound3D page and is at ArmA Scripting Tutorials: Mission Root.

Share this post


Link to post
Share on other sites

try this

put the two lines on top of your script.

then use the third line to call the sound

 _sound1 = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
_sdplay1 = _sound1 + "sounds\yoursound.ogg";// your path goes here

playSound3D [_sdplay1, player, true, getPos player, 10, 1, 20];// insteed of say3D "yoursound"; 

with this you not need to define your sound in CfgMusic or CfgSounds

i hope this help you....

Share this post


Link to post
Share on other sites

Just a hijacking question, you said the stock game sounds play fine for you, is there a way to just straight up use the vanilla sounds like the ones in "RadioProtocolENG" with say3D or playSound3D, or would you have to extract them and put them in your sound folder and list them in cfgSounds?

Share this post


Link to post
Share on other sites

@ Banky, it's possible to straight up play those sounds, you can either look up their classnames in the config viewer, or place a trigger with the sound you want, and then look the classname up in the mission.sqm

Share this post


Link to post
Share on other sites
@ Banky, it's possible to straight up play those sounds, you can either look up their classnames in the config viewer, or place a trigger with the sound you want, and then look the classname up in the mission.sqm

Thanks. That works with all the stuff already in the games own cfgSounds, but what about the stuff in the config viewer in configfile >> "RadioProtocolENG" >> "Words"? Is there a special way to call those sounds? They play if you use setNameSound " " on a unit and give it a command, so I'm hoping there's a way to call them otherwise.

There's a lot of good stuff in there that I would love to use in my missions.

Edited by Banky

Share this post


Link to post
Share on other sites

No clue about those radio protocols, if setNameSound works, and doesn't break anything, then well, guess that's how you call them.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×