Home » MODDING HQ 1.13 » v1.13 Modding, Customising, Editing » v1.13 Modding, Customising, Editing » How to connect sounds with tiles?
Re: How to connect sounds with tiles?[message #358674 is a reply to message #357988] Wed, 18 December 2019 02:37 Go to previous messageGo to previous message
Kitty

 
Messages:473
Registered:October 2017
Location: Germany
silversurfer wrote on Thu, 29 August 2019 22:17
The code can be downloaded here.

You will find sound definitions in "Utils\Sound Control.h" enum "SoundDefines". You need Visual C++ to see the numbers of each enum.
For example "SOUNDS\Fridge Door Open.wav" in Sounds.xml is number 225 which equals "OPEN_DEFAULT_OPENABLE" in "Sound Control.h".

Function "PlayJA2Sample" in "Utils\Sound Control.cpp" gets called when a sound needs to be played. There are tons of places in the code that use this function. For example when a soldier uses a wirecutter the function gets called with the parameter "USE_WIRE_CUTTERS" which is 241. If you look at entry 241 in Sounds.xml you will find "SOUNDS\wirecutters.wav".

For opening containers you can take a look at function "GetStructureOpenSound" in "TileEngine\structure.cpp". From the looks of it the sound seems to depend on the material of the container.

You see that you can't simply add sounds for interactions without changing the code.
1. I'm able to add the entries I wish for in the right places now, at least I think so. For testing if this is true, I assume the changed files must be somehow put into the JA2exe.
I have the SVN files of the recent build, so my guess would be to put the changed files into my SVN files and allow them to overwrite. And then I'm lost. Is there a way to produce an exe this way?
Or is this complete nonsense?


2. In SoundControl.cpp I've also seen a function called "PlayJA2SampleFromFile" and description says that sound added this way mustn't be in the sound array.

I was thinking about using: PlayJA2SampleFromFile( Sample.MY_SOUND, SoundVolume.MIDVOLUME, sGridNo ) in connection with an new ActionItem and use this with a Lua-ID of InteractiveAction.
Using other ActionItems this way I've allready tested.

Do I assume correctly, that with this function I won't need to enter definitions in code (since description is saying no sound-array is needed) and the soundfile just has to be in Folder "Sounds" ?
Or is this just whishful thinking and I better give up on this allready?

[Updated on: Wed, 18 December 2019 02:43]




How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)

Report message to a moderator

Master Sergeant
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to edit merc bio?
Next Topic: Bobby Ray's Shipment Drop Zone
Goto Forum:
  


Current Time: Sun Dec 01 09:20:10 GMT+2 2024

Total time taken to generate the page: 0.00840 seconds