Jump to content

Custom sounds! I did it!


Kennedy

Recommended Posts

I managed to add custom sounds to a scenerio I made. To do so open the scenerio's .CMG file with Resedit and add the SND resource you want for your scenerio into it. Next select the SND and choose "get info" from the "resource" pull down menu, and change the ID number to 20000+X where X is the number you want to assign the sound. I suggest having X be 174 or greater as anything less then that is allready taken. After that you can then play your custom sound with the play_sound(X) where X is the value you chose earlier. So if your sound resource has an ID of 20187, then you would type play_sound(187) to play it.

Link to comment
Share on other sites

Quote:
Originally written by Imban:
This is unsupported, for the record.
Yeah, I did experience a slight bug where the automap in the bottom left corner of the screen ceased to function after playing the sound, but I prssed the 'A' key to turn it back on and it went back to normal.
Link to comment
Share on other sites

Quote:
Originally written by Frobozz:
What you should do is write a program that puts adds the custom sounds when ran and when ran again removes them. Them we wouldn't have to go in and fiddle with the thing by hand which is kinda slow.
If there's enough interest, I could write one.
Link to comment
Share on other sites

Quote:
Originally written by Frobozz:
What you should do is write a program that puts adds the custom sounds when ran and when ran again removes them. Them we wouldn't have to go in and fiddle with the thing by hand which is kinda slow.
If there's enough interest, I could write one.
Link to comment
Share on other sites

Quote:
Originally written by ef:
I'd be grateful and happy, if such a program existed.
I would also be if I stopped double-posting. (sigh)

Let me review... This program would switch out data files in the Blades of Avernum Data folder and then start BoA. When BoA quits, the files would go back to their original positions.

Hmm... I could also make it entirely self-contained. That is, it also stores the scenario and puts it in the folder when it starts. So you can't run it if the data files aren't correct. Sound good?

Edit: Actually, the only files we need to switch are sounds, art and character graphics. All the rest can be modified per scenario, right?

I can also have it temporality remove other scenarios from the scenario folder, so you can't run them with messed up art and sounds. I could also let this add more then one scenario, in case you wanted to make a series with the same data files.

Edit 2: I need to know how the Windows version of BoA stores its files. I can't do anything without that... I also need someone to actually compile this program for Windows (REALbasic again).
Link to comment
Share on other sites

Quote:
Originally written by Eldiran:
That sounds freakin' awesome. I'd pay slightly more than 12 cents for that. Of course, then it would be out of my budget range...
That's why I'm planning for it to be free. There's no reason to pay anything for it.

Of course, that requires that I actually can finish it. And for me to finish it, I need people to respond to what I said eariler (about what data format the Windows version of BoA uses).
Link to comment
Share on other sites

Before you start working on this program, make sure it is actually necessary. For the mac, the custom sounds go in the same file as the graphics: the resource file. We obviously don't know the Windows format yet, but we can extrapolate from what we know of the graphics format from the BoA Editor Docs. The graphics have the format G[number].bmp, so I assume the sounds will be S[number].dat, or some other extension. Therefore it might be possible to include your own sounds in the scenario folder, using a number scheme similar to the mac numbers described above by Kennedy.

Link to comment
Share on other sites

Easily accessible sound files would be a new feature for Windows users. So far, they've always been stored within the .exe. It is possible to add sound files to the .exe, not just replace them.

 

get_sdf, pc_heard_sound and play_sound are the calls used in the Geneforge scripts, and as the Geneforge scripts look much like Avernumscript I assume it is the same in BoA?

Link to comment
Share on other sites

I don't know how it will be in BoA, but if the previous game structure is habitually kept, the .exe will contain a folder named '100'. Inside that folder are subfolders, numbered 1 - whatever, each holding one soundfile and the resource language number '1033'. That is completely different from what you describe as the Mac structure.

 

The pc_heard_sound seems to do the same as play_sound, as far as I can see.

Link to comment
Share on other sites

Sorry, I'm not used to do this kind of thing in english. I'll try again. Yes, the same directory.

 

resource language: I borrowed that word from the program I used to open the sound files, as I've absolutely no idea what the correct english expression might be. All subfolders in the directory are identified by their numbers (1 - whatever). When you open a subfolder you see an icon, followed by the number '1033'; cursor files, icon files, sound files, they look alike - same icon, same number; a numerical key shared by all the files in that directory.

Link to comment
Share on other sites

So the directory structure looks like:

 

BoA.exe (what's the name, any idea)?

100 [directory]

--1 [directory]

----1033.bmp [the graphic #1]

----1033.dat [the sound #1]

--2 [directory]

----1033.bmp [the graphic #2]

----1033.dat [the sound #2]

--3 [directory]

----Similar to 1 and 2

--And so on...

 

Or am I understanding it wrong?

Link to comment
Share on other sites

Geneforge2.exe for example looks like this:

 

Geneforge2.exe (the .exe is the directory)

+ Icon

+ Dialog

+ String Table

+ Icon Group

+ 100

 

Now you open some folders:

 

Geneforge2.exe

- Icon

----1

-----* 1033

+ Dialog

- String Table

----19

-----* 1033

---+20 (etc)

+ Icon Group

- 100

---+1

----2

-----* 1033

---+3 (etc)

 

and so on

 

A custom sound file that comes with the scenario should work when you add the appropriate subfolder numbers to the '100'-folder, each subfolder then containing the '* 1033' key. You cannot play the sounds without that key, I tried it.

 

What I am looking for is a program that adds these new subfolders to the .exe when the scenario is started and deletes them when the player leaves the scenario. Is something like this possible?

Link to comment
Share on other sites

Quote:
What I am looking for is a program that adds these new subfolders to the .exe when the scenario is started and deletes them when the player leaves the scenario. Is something like this possible?
Well the Reshack program can do the adding and removing sound part so it must be possible to do that, you just got to learn how it does it then you can make your program change the sound files when you open and close the senario
(I think im confusing myself :p )
Link to comment
Share on other sites

The reshack program has shown me how to do that, and not only change, but add sound files. But that is just for me individually.

 

If scenarios could come with custom sound files and play them as naturally as they show custom graphics (and without the player having to adjust the settings), that would be great.

 

Imagine cutscenes, where motion and sound are perfectly timed and matched.

Link to comment
Share on other sites

It's alright. The Resource Hunter shows you either the tree structure, like this:

sound1.gif

or alternatively the icon/cursor/wav files etc, like for instance:

100-1

100-2 etc.

 

It's a better program than the Reshack, but not free, I downloaded a trialversion.

So I have to find out what this '1003' refers to *sigh*.

 

edit: did find out. The socalled resource language, refered to by number 1003 is simply the language used, english in this case. Oh dear.

 

I don't think it is important, if the wav files are shown in subfolders or not, as refering to them by their numbers works.

Link to comment
Share on other sites

That varies a bit from game to game. In Geneforge 2 this is the .exe:

Geneforge2.exe (the .exe is the directory)

+ Icon

+ Dialog

+ String Table

+ Icon Group

+ 100 (wav files)

 

Then there's the data folder, containing graphics, .dat files, scripts and save files.

 

I'm on a PC, so I don't know the BoA particulars.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...