sound

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Elmor
Posts: 152
Joined: May 5th, 2010, 8:19 am

sound

Post by Elmor »

Hello everybody. Here is my problem.
I can`t make usermade sounds work in my era
it`s in .ogg, but still there is no sound

what can be the problem, I just don`t know where to start
User avatar
doofus-01
Art Director
Posts: 4134
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: sound

Post by doofus-01 »

Elmor wrote:what can be the problem, I just don`t know where to start
It's difficult for anyone to know what's wrong, as things currently stand. A good place to start is by posting your WML.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
User avatar
Azeal
Posts: 97
Joined: July 24th, 2012, 8:19 am

Re: sound

Post by Azeal »

the most likely problem is probably your file path. Your _main file should have the directory in it like this {~add-ons/my_era/sound/}. Otherwise the folder it is in should be included when you call the music with wml.
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: sound

Post by 8680 »

Azeal wrote:Your _main file should have the directory in it like this {~add-ons/my_era/sound/}. Otherwise the folder it is in should be included when you call the music with wml.
No it shouldn’t. Only .cfg files and directories containing them should be included. Including anything else does nothing but waste your and Wesnoth’s time.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: sound

Post by zookeeper »

8680 wrote:
Azeal wrote:Your _main file should have the directory in it like this {~add-ons/my_era/sound/}. Otherwise the folder it is in should be included when you call the music with wml.
No it shouldn’t. Only .cfg files and directories containing them should be included. Including anything else does nothing but waste your and Wesnoth’s time.
Yeah, 8680 is right. Including your sound, music, images or maps directories does absolutely nothing. Yet for some reason a lot of people seem to do it. :roll:
Elmor
Posts: 152
Joined: May 5th, 2010, 8:19 am

Re: sound

Post by Elmor »

So, I must add some .cfg to _main that shows my sounds?
my _main now contains only era.cfg and units, how can I use my sounds?
User avatar
Pentarctagon
Project Manager
Posts: 5567
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: sound

Post by Pentarctagon »

Do you have [binary_path] in the _main.cfg?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
Elmor
Posts: 152
Joined: May 5th, 2010, 8:19 am

Re: sound

Post by Elmor »

sure, I have

it contains era.cfg and units
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: sound

Post by zookeeper »

Just post your WML.
Elmor
Posts: 152
Joined: May 5th, 2010, 8:19 am

Re: sound

Post by Elmor »

Code: Select all

[binary_path]
    path="data/add-ons/Wesnoth_era"
[/binary_path]
{~add-ons/Wesnoth_era/wera.cfg}
{~add-ons/Wesnoth_era/abilities.cfg}
[+units]
    {~add-ons/Wesnoth_era/units/}
[/units]
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: sound

Post by zookeeper »

Nothing wrong with that, meaning that you must be referencing the sounds wrong. Or placed them in somewhere else than Wesnoth_era/sounds/.
Elmor
Posts: 152
Joined: May 5th, 2010, 8:19 am

Re: sound

Post by Elmor »

where than? in era folder?
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: sound

Post by Crendgrim »

Let's say you have a sound file called my_sound.ogg. You would place it inside the directory Wesnoth_era/sounds/. Now, with a correct binary path (and yours is correct), Wesnoth will now look in that directory for sound files. So, if you want to use the sound somewhere, you just use it by its name, my_sound.ogg

This is also said in the WML reference, by the way: InterfaceActionsWML#[sound]
UMC Story Images — Story images for your campaign!
Elmor
Posts: 152
Joined: May 5th, 2010, 8:19 am

Re: sound

Post by Elmor »

I did EXACTLY as you said
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: sound

Post by zookeeper »

Well, you're still doing something wrong. No one can know what it is without seeing what you have.
Post Reply