Jump to content

Soundset Extractor


Macready

Recommended Posts

Hello -

 

I recently threw together a small WeiDU "mod" (read: utility) that will allow you to extract all string data from CRE files (both names, and the soundset array). It was written for Tutu but should work fine for BG2 as well.

 

To use it, download this self-extracting package, and extract it to your BG2 / Tutu game folder, just like any mod. Before running it, edit the TP2 file (Setup-Soundset.TP2), and replace the two placeholder CREs ("_GHOUL" and "_NOBL9") with the first two CREs in which you are interested, and then add any additional CREs after using the same formatting. There is a large comment in the file to help you hone in on the right spot, and to demonstrate proper syntax. Don't touch anything else. Then, save and run the WeiDU installer. The strings will appear in the output window, and in the SETUP_SOUNDSET.DEBUG file.

 

Use of this utility will not modify your game in any way (the "non-patches" are protected by BUT_ONLY_IF_IT_CHANGES, so no copying will actually occur). For any of you who spotted this in the BG1NPC forum, I've updated the script such that the IDS name is included with the soundset strings, and so that invalid strings (of which there are many in each CRE soundset -- unused slots) are ignored.

 

Have fun. :down:

Link to comment

Is there any chance that this tool might be made compatible with BG1? I tried the install on BG1/TOTSC, and got this error:

 

[dialog.tlk] loaded, 3446629 bytes

 

ERROR locating resource for 'get_ids_map'

Resource [sNDSLOT.IDS] not found in KEY file:

[./chitin.key]

Copying and patching 2 files ...

 

ERROR locating resource for 'COPY'

Resource [_ghoul.cre] not found in KEY file:

[./chitin.key]

Stopping installation because of error.

ERROR: [dialog.tlk] -> [macdummy.tlk] Patching Failed (COPY) (Failure("resource [_ghoul.cre] not found for 'COPY'"))

Stopping installation because of error.

 

ERROR Installing [soundset Extractor], rolling back to previous state

[soundset/backup/0/UNSETSTR.0] SET_STRING uninstall info not found

Will uninstall  0 files for [sETUP-SOUNDSET.TP2] component 0.

Uninstalled      0 files for [sETUP-SOUNDSET.TP2] component 0.

SETUP-UBBG1.TP2  0 26 Installed

ERROR: Failure("resource [_ghoul.cre] not found for 'COPY'")

PLEASE email the file SETUP-SOUNDSET.DEBUG to feedback@usoutpost31.com

Using Language [English]

[English] has 1 top-level TRA files

[soundset/english/setup.tra] parsed

[soundset/english/setup.tra] has 1 translation strings

 

Install Component [soundset Extractor]?

nstall, or [N]ot Install or [Q]uit?

 

If it's possible, it would save me a HUGE amount of time...

Link to comment

You need to check that the first line is set to your .cres, not the default. Using line 1 as ~IXVART.CRE~ instead of _ghouldude, who only shows up in Tutu, you get

 

Reading strings for IXVART.cre...

 

Name1: Xvart

 

Name2: Xvart

 

ERROR locating resource for 'get_ids_map'

Resource [sNDSLOT.IDS] not found in KEY file:

[./chitin.key]

 

Sound 9 (9), resref XVART03 : [XVART 03] Eeeeeeeeeeeeeeeeee!

 

I have used it successfully on BG1; you have to change out the ghoul.cre for the ones you need. I bet you could swap SNDSLOT.IDS for BG1's, but I am not sure, as I can't find the corresponding .IDS file (bein' a newbie and all :) ). Without the changes, I got good data, but alot of editing.

 

To make it easier, My modification of Macready's tp2:

 

  COPY_EXISTING	~P#WOLF01.cre~ ~override/macdummy.cre~
     	~P#WOLF02.cre~ ~override/macdummy.cre~
     	~P#WOLF03.cre~ ~override/macdummy.cre~
     	~P#WOLF04.cre~ ~override/macdummy.cre~

 

change:

          /* Print soundset ref */
         PATCH_PRINT ~SAY %idsName% AAA%soundString%AAA [%resName%]~
       END
     END

 

Then mass replace AAA with ~ and the COPY commands are formatted and organized by creature.

 

Of course, by the time I type this, Macready will have posted a new setup for you. He's just that damn good and fast!

 

EDIT: see, by the time I composed this answer, he found you on IRC and probably rebuilt the utility. Cool stuff! :)

Link to comment
          /* Print soundset ref */
         PATCH_PRINT ~SAY %idsName% AAA%soundString%AAA [%resName%]~
       END
     END

 

Then mass replace AAA with ~ and the COPY commands are formatted and organized by creature.

The following is valid, and will eliminate the need for search/replace:
PATCH_PRINT "SAY %idsName% ~%soundString%~ [%resName%]"

Link to comment

Which is the difference between BG1 and BG2 as BG1 uses different lengths while BG2 was standardized at 8 characters - and of course is why the BG1 data had extra nonprinting characters in the resref that messed up some of the references.

 

Wish I'd have run more stuff past you guys; thought I was already being a bother enough. Between you three, I could have shaved off two weeks of research and copy/paste/edit/test/fail/rinse/readIESDP/repeat into one evening of work. Well, at least I got to lern more about why stuff works and doesn't -- can't beat practical experience for that!

 

Note to self -- ASK before trying stuff you only sort-of understand! :)

Link to comment

BG1 and IWD1 use SOUNDOFF.IDS (so does IWD2 but it has a different method of implementing things), while BG2 uses SNDSLOT.IDS.

 

Since NI uses these files to determine how it defines line items when viewing CREs, I had to make a few adjustments to get the CREs to display properly. Here are the current, and so far accurate, contents of my BG1 and BG2 IDS files.

 

SOUNDOFF.IDS

0 INITIAL_MEETING
1 MORALE
2 HAPPY
3 UNHAPPY_ANNOYED
4 UNHAPPY_SERIOUS
5 UNHAPPY_BREAKING_POINT
6 LEADER
7 TIRED
8 BORED
9 BATTLE_CRY1
10 BATTLE_CRY2
11 BATTLE_CRY3
12 BATTLE_CRY4
13 BATTLE_CRY5
14 ATTACK1
15 ATTACK2
16 ATTACK3
17 ATTACK4
18 DAMAGE
19 DYING
20 HURT
21 AREA_FOREST
22 AREA_CITY
23 AREA_DUNGEON
24 AREA_DAY
25 AREA_NIGHT
26 SELECT_COMMON1
27 SELECT_COMMON2
28 SELECT_COMMON3
29 SELECT_COMMON4
30 SELECT_COMMON5
31 SELECT_COMMON6
32 SELECT_ACTION1
33 SELECT_ACTION2
34 SELECT_ACTION3
35 SELECT_RARE1
36 SELECT_RARE2
37 SELECT_RARE3
38 SELECT_RARE4
39 INTERACTION1
40 INTERACTION2
41 INTERACTION3
42 INTERACTION4
43 INTERACTION5
44 INSULT1
45 INSULT2
46 INSULT3
47 COMPLIMENT1
48 COMPLIMENT2
49 COMPLIMENT3
50 SPECIAL1
51 SPECIAL2
52 SPECIAL3
53 REACT_TO_DIE_GENERAL
54 REACT_TO_DIE_SPECIFIC
55 RESPONSE_TO_COMPLIMENT1
56 RESPONSE_TO_COMPLIMENT2
57 RESPONSE_TO_COMPLIMENT3
58 RESPONSE_TO_INSULT1
59 RESPONSE_TO_INSULT2
60 RESPONSE_TO_INSULT3
61 DIALOG_HOSTILE
62 DIALOG_DEFAULT
63 SELECT_RARE1
64 SELECT_RARE2
65 CRITICAL_HIT
66 CRITICAL_MISS
67 TARGET_IMMUNE
68 INVENTORY_FULL
69 EXISTANCE1
70 EXISTANCE2
71 EXISTANCE3
72 EXISTANCE4
73 EXISTANCE5
74 BIOGRAPHY

SNDSLOT.IDS

IDS V1.0
0 INITIAL_MEETING
1 MORALE
2 HAPPY
3 UNHAPPY_ANNOYED
4 UNHAPPY_SERIOUS
5 UNHAPPY_BREAKING_POINT
6 LEADER
7 TIRED
8 BORED
9 BATTLE_CRY1
10 BATTLE_CRY2
11 BATTLE_CRY3
12 BATTLE_CRY4
13 BATTLE_CRY5
14 ATTACK1
15 ATTACK2
16 ATTACK3
17 ATTACK4
18 DAMAGE
19 DYING
20 HURT
21 AREA_FOREST
22 AREA_CITY
23 AREA_DUNGEON
24 AREA_DAY
25 AREA_NIGHT
26 SELECT_COMMON1
27 SELECT_COMMON2
28 SELECT_COMMON3
29 SELECT_COMMON4
30 SELECT_COMMON5
31 SELECT_COMMON6
32 SELECT_ACTION1
33 SELECT_ACTION2
34 SELECT_ACTION3
35 SELECT_ACTION4
36 SELECT_ACTION5
37 SELECT_ACTION6
38 SELECT_ACTION7
39 INTERACTION1 // from here...
40 INTERACTION2
41 INTERACTION3
42 INTERACTION4
43 INTERACTION5
44 INSULT1
45 INSULT2
46 INSULT3
47 COMPLIMENT1
48 COMPLIMENT2
49 COMPLIMENT3
50 SPECIAL1
51 SPECIAL2
52 SPECIAL3
53 REACT_TO_DIE_GENERAL
54 REACT_TO_DIE_SPECIFIC
55 RESPONSE_TO_COMPLIMENT1
56 RESPONSE_TO_COMPLIMENT2
57 RESPONSE_TO_COMPLIMENT3
58 RESPONSE_TO_INSULT1
59 RESPONSE_TO_INSULT2
60 RESPONSE_TO_INSULT3
61 DIALOG_HOSTILE
62 DIALOG_DEFAULT // ...to here are unused in BG2 CREs.
63 SELECT_RARE1
64 SELECT_RARE2
65 CRITICAL_HIT
66 CRITICAL_MISS
67 TARGET_IMMUNE
68 INVENTORY_FULL
69 PICKED_POCKET
70 HIDDEN_IN_SHADOWS
71 SPELL_DISRUPTED
72 SET_A_TRAP
73 UNUSED
74 BIOGRAPHY

Link to comment

Hello -

 

Update complete. The problem related to resnames shorter than eight characters is fixed; the download link in the first post of the thread points to the updated package.

 

If anyone ever needs to use the utility with BG1, when you are editing the TP2, simply do a global find/replace in order to change sndslot to soundoff.

Link to comment

Thanks, Macready -- I will get it out and run it through its paces, as I need to go back and redo a section of Tutu .cre references.

 

Smoketest, devSin, and anyone else--- just to make sure I understand;

 

In my Tutu (BG2/TOB, et al) the folder <script compiler> contains both SOUNDOFF.IDS and SNDSLOT.IDS.

 

In my BG1 install, no <script compiler> folder exists and <override> contains no .IDS files (it must be in a .bif somewhere, because NI finds it fine).

 

To make use of the data you have posted, I have opened BG1 in NI, found SOUNDOFF.IDS, and extracted it to the BG1 override directory. I then copy the data you have into that file, and BG1/NI/etc. has the data vailable for looking at .cre sounds.

 

To make it available in the Tutu directory, do I need to modify both files and put them into the Tutu override? From practical experience, Tutu uses most of the BG1 IDS entries corrctly, and will allow sounds from BG2 to be used as well -- but does not reference BG2 specific IDS entries (i.e., a Tutu string fixer with Imoen having an entry for HIDDEN_IN_SHADOWS results in no sound or string display when she hides in shadows, even though that works fine in BG2).

Link to comment

And one follow up question, if I may...

 

Using the IDS changes, I have the following non-fatal errors in a fixer:

 

[action list near line 136, column 989 of PARSE WARNING at line 177 column 110-110
Near Text: )
[SetPlayerSound] argument [INSULT] not found in [SNDSLOT.IDS]

[DIALOG_DEFAULT]
[EXISTANCE5] 
[INSULT]
[INTERACTION1]

 

 

I can confirm that on the last install, the entries work correctly in-game in Tutu; the fixer correctly mismapped Imoen and Montaron on the stringfixer even down to the biography (EXISTANCE5) without these errors. This time, the errors cropped up. Does Tutu use these files differently/modify them somehow? Most of all, will a person with a standard Tutu IDS setup get these errors?

 

My workaround could be to just remap onto BG2 equivalents, but since Tutu doesn't seem to allow H_I_S and similar, I may end up with useless "fixes" that do not show up ingame.

Link to comment
In my Tutu (BG2/TOB, et al) the  folder <script compiler> contains both  SOUNDOFF.IDS and SNDSLOT.IDS.

That's because it's a combination of BG1 and BG2 data files.

In my BG1 install, no <script compiler> folder exists and  <override> contains no .IDS files (it must be in a .bif somewhere, because NI finds it fine).

Yes, by default the IDS files are inside DEFAULT.BIF. In addition to extracting them to the override folder, you can simply view the file and save it. That'll do the same thing.

To make it available in the Tutu directory, do I need to modify both files and put them into the Tutu override? From practical experience, Tutu uses most of the BG1 IDS entries corrctly, and will allow sounds from BG2 to be used as well -- but does not reference BG2 specific IDS entries (i.e., a Tutu string fixer with Imoen having an entry for HIDDEN_IN_SHADOWS results in no sound or string display when she hides in shadows, even though that works fine in BG2).

NI will look for SNDSLOT.IDS first and use it if it exists. Otherwise it'll check for SOUNDOFF.IDS. If neither are present, it shows unknowns. Since Tutu is running under the BG2 version of the engine, it'll use BG2's data files unless the EXE is modified to look elsewhere.

Link to comment

OK, Smoketest, here's one for your "stupid newbie" stories list...

 

WeiDU didn't like the INTERACTION1 and DIALOG_DEFAULT IDS entries because I left the comments // intact :) . IDS files are not D files... duh.

 

I know that I can remap Bioware's entry INSULT to INSULT1, and it should work.

 

Unfortunately, no such luck for EXISTANCE5, which exists in BG1, and appeared to map ok into BG2 as-is. Could BG1's 73 EXISTANCE5 be mapped to BG2's 73 UNUSED by renaming it? Alternatively, if a Tutu character has an entry in EXISTANCE5, is that automatically mapped over into BIOGRAPHY?

 

And, since I am asking tons of stupid questions, ConTEXT's highlighters do not recognize DIALOG_HOSTILE, BIOGRAPHY and UNHAPPY_BREAKING_POINT (although if you shorten it to BIO, Biography seems to be accepted). Is this a hint that these entries may not be used by the BG2 engine?

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...