aliens

Author Topic: I'm getting an error "Sound X in BATTLE2.CAT not found"  (Read 1315 times)

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
I'm getting an error "Sound X in BATTLE2.CAT not found"
« on: August 17, 2023, 01:18:45 am »
I'm currently running OpenXcom Extended 7.9.6 (v2023-05-21)

I've been learning how to add sounds to the game using extraSounds: and everything seemed to be working fine but then suddenly all new sounds stopped playing.

When I check the openxcom.log it listed these errors:
Code: [Select]
[16-08-2023_16-02-28] [ERROR] Sound 1069 in BATTLE2.CAT not found
[16-08-2023_16-02-32] [ERROR] Sound 1068 in BATTLE2.CAT not found
[16-08-2023_16-02-36] [ERROR] Sound 1071 in BATTLE2.CAT not found

What is strange is that even the sounds that did play before aren't working, so I'm not sure where to look for the error.

Here is the mod that produced the above error messages.
Sound_Test_V3.zip

Aside from from the sound files themselves this code makes up the rest of the mod:
Code: [Select]
extraSounds:
  - type: BATTLE.CAT
    files:
# [=] Item - Test Object One [=]
      68: Resources/Sound/OBJECT_ONE_Activate.flac
# [=] Item - Test Object Two [=]
      69: Resources/Sound/OBJECT_TWO_Activate.wav
      70: Resources/Sound/OBJECT_TWO_Deactivate.wav
# [=] Item - Test Object Three [=]
      71: Resources/Sound/OBJECT_THREE_Activated.flac

Code: [Select]
items:

# [=] Item - Test Object One [=]
  - type: STR_DOT_TEST_OBJECT_ONE
    primeSound: 68
    size: 0.1
    costBuy: 150
    costSell: 120
    weight: 3
    bigSprite: 20
    floorSprite: 19
    handSprite: 120
    power: 60
    damageType: 9
    battleType: 4
    armor: 110
    blastRadius: 5
    hitAnimation: 8

# [=] Item - Test Object Two [=]
  - type: STR_DOT_TEST_OBJECT_TWO
    primeSound: 69
    unprimeSound: 70
    size: 0.1
    costBuy: 150
    costSell: 120
    weight: 3
    bigSprite: 20
    floorSprite: 19
    handSprite: 120
    power: 60
    damageType: 9
    battleType: 4
    armor: 110
    blastRadius: 5
    hitAnimation: 8

# [=] Item - Test Object Three [=]
  - type: STR_DOT_TEST_OBJECT_THREE
    primeSound: 71
    size: 0.1
    costBuy: 500
    costSell: 400
    weight: 3
    bigSprite: 21
    floorSprite: 21
    handSprite: 120
    power: 70
    damageType: 3
    battleType: 5
    armor: 90
    blastRadius: 5
    hitAnimation: 8
« Last Edit: August 17, 2023, 04:38:43 am by The Martian »

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: I'm getting an error "Sound X in BATTLE2.CAT not found"
« Reply #1 on: August 18, 2023, 09:48:50 pm »
I have the solution!!!

In TFTD along with BATTLE.CAT there is a second file called BATTLE2.CAT that handles the underwater sounds.

So extraSounds: needs to be setup more like this:

Code: [Select]
extraSounds:
  - type: BATTLE.CAT
    files:
# [=] Item - Test Object One [=]
      68: Resources/Sound/OBJECT_ONE_Activate.flac
# [=] Item - Test Object Two [=]
      69: Resources/Sound/OBJECT_TWO_Activate.wav
      70: Resources/Sound/OBJECT_TWO_Deactivate.wav
# [=] Item - Test Object Three [=]
      71: Resources/Sound/OBJECT_THREE_Activated.flac


  - type: BATTLE2.CAT
    files:
# [=] Item - Test Object One [=]
      68: Resources/Sound/OBJECT_ONE_Activate.flac
# [=] Item - Test Object Two [=]
      69: Resources/Sound/OBJECT_TWO_Activate.wav
      70: Resources/Sound/OBJECT_TWO_Deactivate.wav
# [=] Item - Test Object Three [=]
      71: Resources/Sound/OBJECT_THREE_Activated.flac


Alternatively you can place the following code in the vars.rul file:
Code: [Select]
disableUnderwaterSounds: trueAnd then all the times the game would call for BATTLE2.CAT (Underwater sounds) will instead redirect to its BATTLE.CAT equivalent.


Here is a working version of the example mod:
Sound_Test_V4.zip