Home » MODDING HQ 1.13 » v1.13 Modding, Customising, Editing » v1.13 Modding, Customising, Editing » How to connect sounds with tiles?
How to connect sounds with tiles?[message #357967]
|
Mon, 26 August 2019 04:43
|
|
Kitty |
![](http://thepit.ja-galaxy-forum.com/images/avatars/Waldo.jpg) ![](/images/ranks/master_sergeant.png) |
Messages:492
Registered:October 2017 Location: Germany |
|
|
I'd like to add a new openable object and give it an also new sound for opening.
I found quite a lot regarding weapon-sounds, but couldn't find anything about sounds connected with tiles. What I mean are sound like opening a crate, opening a fridge, etc.
- How does the game know, that a openable tile is a fridge and not a crate? (Being openable is "told" by jsd, but being fridge or crate apparently not)
- How does sounds.xml work? Is it "just" a list where existing sound must be filled in? Or is there more about it? Wasn't able to find information about it, any hint?
In jsd's i found animated tiles (like the rocks with floating water arround), but the openable objects are just generic/openable, no hint to anything sound-related found there.
So I assume that the definition for e.g. a fridge being a fridge and therefore play the sound for opening a fridge is stored somewhere else.
I could find the sound for opening fridge in sounds-folder and an entry in sounds.xml, but couldn't find the place where those get connected with the on-map-action of opening the fridge.
And since just putting a wav/ogg in sounds-folder and making an entry in sounds.xml won't do, I ended up in deadend.
Is this doable at all in externalized or is this hardcoded?
Thx.
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
|
|
|
|
|
|
Re: How to connect sounds with tiles?[message #357975 is a reply to message #357973]
|
Tue, 27 August 2019 16:11 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
townltu |
![](/images/ranks/master_sergeant.png) |
Messages:384
Registered:December 2017 Location: here |
|
|
Looking at the \sounds folder of an r8517 install, and comparing the 1.05 exe to the 8517 exe,
there seem to have been new tile specific sound files added to the sounds folder, like soda machine, water tap, etc
(which are btw at a wasteful high quality of 32bit & 44.1kHz o: )
and also those files names as plain txt strings appear in the 8517 exe but not in the 1.05 exe,
which indicates to me that coding is required, but it also indicates that this is basically doable.
Perhaps it is possible to add additional "blank" options to the code,
for tile specific sounds, which modders can use for their terrain tiles?
There may also be some unused sound specific entries in the exe,
and the worst workaround to replace a sound triggering original element with a new sti,jsd and wav file.
Report message to a moderator
|
Master Sergeant
|
|
|
Re: How to connect sounds with tiles?[message #357985 is a reply to message #357973]
|
Thu, 29 August 2019 19:04 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
Kitty |
![](http://thepit.ja-galaxy-forum.com/images/avatars/Waldo.jpg) ![](/images/ranks/master_sergeant.png) |
Messages:492
Registered:October 2017 Location: Germany |
|
|
@ Hawkeye:
You mean the SteadySectorAmbientSound by sevenFM? That's a totally cool thing and I realy, realy like it. But as far as I understand, this is a feature only available with his Improved-exe and therefore only for 7609-releases. I'll do a little dance, if this ever will be recent releases
There are no nescessary entries for this in recent ini either. Simply adding hasn't worked, I tried
But as I remember, those new sounds had to be added in the ambienz-folder (fire) and the rest (sector sounds) in new folder "ssa". But since ambient-folder is available in standard-releases this might be working, although I don't think hearing fire was connected to tiles. I looked into montrock.sti for campfire, but couldn't see any aux-entries there.
Hm, adding sounds per aux would be cool. I sure hope you're right. To be honest, I haven't understood the whole aux-thing in jsd's complete. So far, I've found only two examples where tiles use aux-dat for animation (the floating water arround the rocks and in balime-tileset some monitors (g-decor1). All the openable doors and crates have entries in aux, but the flag for animation isn't set (just wall-orientation, nothing else set) . For all other flags (e.g. interactive) I haven't found an example at all so far. I thought maybe things like wirefences are interactive, but no flag being set there either. I guess the cutting-sound comes from the flag "wirefence" (in structure-data, not aux-data) It's rather confusing for me.
While experimenting with a new openable object, I wasn't able to connect it to "slidingdoor"-flag, even when I gave it animated frames simular to slidingdoors (used the same amount of pictures and same entries in aux). I got an error saying something about animated-tiles.cpp (cpp: Is this C++?), but it was no door, so..
But "generic,openable" (in structure-data) resulted in giving me the crate-opening sound, which is second-best, but better then no sound. I might be mistaken, but I think choosing different materials also results in different sounds sometimes, but have to do this again to verify.
I also realised that there are no different sounds for crates and fridges (as I mentioned in first post), but in sounds-folder there are two different wav. Don't know, maybe I'm just to deaf to hear the difference, too much walkman back in the days (they told me, sigh).
@ silversurfer and townItu:
Hardcoded, I kinda thought so, sigh. And since I lack the coding skills, it can't be helped.
But is there a place where I can download the code and will visualStudioCode do to open it? I'm totally aware, that I'm not capable of doing any coding, but maybe I can get glimpses of information, like what are the triggers in hardcode that result in sound a or sound b (or which lua-fact numbers I better not use, had some strange experiences therefore while adding new pc's for AR-maps, I ended up starting at number 500 in array). Or is this hopeless for someone without knowledge in C++ and one wouldn't be able to understand a thing?
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
|
|
|
|
|
Re: How to connect sounds with tiles?[message #357990 is a reply to message #357988]
|
Sat, 31 August 2019 01:45 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
Kitty |
![](http://thepit.ja-galaxy-forum.com/images/avatars/Waldo.jpg) ![](/images/ranks/master_sergeant.png) |
Messages:492
Registered:October 2017 Location: Germany |
|
|
@ silversurfer
Cool, thanks for the link and the explanations.
I'll see if I can make some use out of this informations. I allready thought that material is somehow connected to the sound, but it sure is better just to read which material is resulting in which sound then experimenting to find it out, saved me some time and uncertainty.
PlayJA2Sample may come in handy for some actionItems I thought about on different occations, hm. I sure tend to do too many things at once ...
I yet have to look into it more detailed, but it sure will help me understanding what's happening a little more. Which probably won't help me to hear the sound of the sliding-door on my object, but will ease my mind
@ readers as unexperienced as me
Anybody else who might be puzzled about numbers in sound.xml: The sound "Ricochet01" is sound-Nr. = 0, but since it is in line 2 (if opening with notepad++) wirecutters-sound is line 243 but sound 241. Which probably isn't anybody elses problem, but just in case...
In VisualStudioCode, hovering mouse over entry will show the right numbers.
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
|
|
|
|
Re: How to connect sounds with tiles?[message #358674 is a reply to message #357988]
|
Wed, 18 December 2019 02:37 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
Kitty |
![](http://thepit.ja-galaxy-forum.com/images/avatars/Waldo.jpg) ![](/images/ranks/master_sergeant.png) |
Messages:492
Registered:October 2017 Location: Germany |
|
|
silversurfer wrote on Thu, 29 August 2019 22:17The 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
|
|
|
|
|
|
Re: How to connect sounds with tiles?[message #358685 is a reply to message #358678]
|
Fri, 20 December 2019 05:39 ![Go to previous message Go to previous message](/theme/Bear_Classic_Brown/images/up.png)
|
|
Kitty |
![](http://thepit.ja-galaxy-forum.com/images/avatars/Waldo.jpg) ![](/images/ranks/master_sergeant.png) |
Messages:492
Registered:October 2017 Location: Germany |
|
|
@ silversurfer:
Ok, I guess my best bet for trying to place a trigger will be ExplosionControl.lua then, at least it's worth a shot.
At least KlaxxonSound is triggered there, but that's called by array-number (214). I will give it a try.
About my question "Is there a way to produce an exe this way?" I answer myself and say that's probably called "compiling".
I followed some instruction videos and was able to implement MinGW in Visual Studio Code and my system. All the examples
the videos provided I could do. But according to the Compiling-Instructions by haydent I found in "General Development Talk",
there should be a "Projects"-Tab in Visual Studio, but my version doesn't show this tab at all. The most recent files in SVN
that I think are related to "Project" (xyz.sln) contain "2017" in the file-name, which may hints to VisualStudioExpress2017,
but this guide dates back to 2012.
Is VisualStudioExpress2017 a promissing tool for trying out the instructions and are those instructions up-to-date enough?
[Updated on: Fri, 20 December 2019 05:39]
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
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Feb 18 02:08:54 GMT+2 2025
Total time taken to generate the page: 0.01258 seconds
|