New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Enhancement] Add periodic sound emitter #103
Comments
How are you updating the config file? The entry is a Forge config string list where each entry has to be on a separate line. Example:
This following not work and cause the config file to reset:
|
Oh. My error was that I put the list items in front of the borders. let me try again and see if my current config will operate. |
Well, now the list items don'y get removed, but the config I added doesn't seem to be working. Here is my setup: { The ones without the dsurround part are for a file in the config file for your mod. Even when I put the sounds into your mod file and tried using the string "sound":"dsurround:rumble1" it didn't work. Also, I have a few other things I need to know how to code. For example, I have sounds for tekkit classic that have the drip sounds, cave rumble, lake birds, tree wind, height wind, underwater loop, getting lit on fire by lava, and fire, with popping embers. |
But first I need to know where to put the files. |
Real quick, one thing that old matmos did that I want to do with the cave rumbles, is how it continuously loops, but plays the random sound out of the three rumble sounds I have. |
Several things:
|
Alright, I'm getting to work on that. It's helpful to learn to code, considering I'm eventually going to develop 3 mods. |
So here is what I have done:
Yet, the sounds still don't work. |
Don't modify the sounds.json in the Dynamic Surroundings JAR. Make a new sounds.json that is inside your resource pack. This sounds.json will define the sounds are contained in your resource pack. Based on your information above I am going to assume that your resource pack ID is "oldmatmos". If that is the case then your "entries" list in the Json would look like:
(The "biomeName" value is case sensitive so you would have to spell it exactly or expand the value to a regex expression that ignores case.) |
How do I give the resource pack an id? Is that it's name in the pack.mcmeta? |
That contains the description. Inside the pack you have an "assets" folder. Under that you created another folder. The name of that folder is the ID. A lot of examples you see on the internet relate to replacing the Minecraft resources, so the folder layout is "assets/minecraft". You can have your own, such as "assets/oldmatmos". Then, the "id" of the pack would be "oldmatmos" and you would refer to assets in that folder using "oldmatmos". Here are the assets for Dynamic Surroundings. In that folder you can see "dsurround" (the ID of the Dynamic Surroundings mod is dsurround), and "minecraft" (for the particle textures that replace the Vanilla ones). |
Now I have this for my config:
And this for my sounds.json:
And here is the contents of my Resource pack files, and their order:
I left out the minecraft folder, because it had some random texture changes. But nevertheless, it isn't working still. I have the pack activated in the game, and I checked your config if my config was still there, and it is. What is going wrong? |
The biomeName is case sensitive. Make it "Underground". Also, can you play one of your sounds using the /playsound command? |
I played your owl sound just fine, but my sounds didn't play. In fact, I got this spammed on my log:
So, it seems like the code is somewhat working, but it either can't find the sounds, or something is wrong with the sounds. |
Is the pack available somewhere so I can download and check things out? |
I'll try to upload it on my Google Drive: https://drive.google.com/open?id=0B5cQMrY_ixOfLTBlWUM1VV9DYVU |
Need to make it public so I can get it. |
If that doesn't work, give me your email, and I will give it to you from there. |
That worked. It's going to be a bit before I can dig into it. I should have something tomorrow. |
That's fine. I'm kind of satisfied seeing that my code seems to operate like it should. It's good to learn. |
Ok - just noticed the issue. Currently your structure is like this:
It needs to be like this:
Essentially move the folders "ambient" and "interact" into a folder called "sounds" and you should be good. I did this and was able to play your sounds using /playsound. |
Yay! It works now! But there is a problem: It doesn't play random sounds, but instead it seems to chose a random sound and play it over and over again with pauses in between. It needs to play in a loop, with the three sounds played at different times to give more depth instead of a heartbeat-like rumble. |
caverumble? it will repeat, but a single sound will be randomly selected for the repeat. It will not change until the sound is resubmitted down into the sound engine. I will take a look at the code to see if it can be tweaked to do something you are looking for. |
Try adding a repeat delay of 1 to the sound record:
This will cause the repeat logic in Dynamic Surroundings to kick in. It should cause another sound to generate. The delay of 1 tick should be minimal. Note that because it is random it is possible for it to repeat the sound again on the next attempt (33% chance since there are 3 sounds to select from). |
I will make a clip so you can hear what I am aiming for, because I suck at explaining. |
Other thing to do is double check each of the ogg files to make sure that it makes sense to loop. If there are "blank" spots in the recording, either beginning or end there will be gaps on the play loop. |
https://youtu.be/_cJ98RV3nKo?t=1m Skip to one minute in, because I turn up the sounds there. It sounds to me like it plays a sound, and one second after, plays another of the three sounds or an empty sound, keeping it almost constant. |
Also, I want the smoke from cooling lava back. |
If this is what your config looks like:
then "caverumble" will be continuous. It will keep playing. If you want it to only occur periodically, then you need to add a "spot":true to it:
As for cooling lava I am not sure what you are referring to. You mean the smoke particles that come up when lava turns to obsidian? I don't do anything related to that. |
Forge10.13.4.1614-1.7.10 I can't remember if walking on rails made a metal sound, but it doesn't seem to do this anymore. |
Just tried the rail walk thing and I get the sound. What you can do is turn on debug logging using the dsurround.cfg file. In the launcher output window you will see a trace of the sounds that are played with footsteps. This is what I see:
|
Ignore that part, we have a bug to fix first. |
Can you duplicate this exception at will? Reason is I would like you turn debug on and give me the log. This is all in Minecraft code so it is unclear as to how Dynamic Surroundings is involved. My hope is that the debug trace will give me more context. EDIT: Also, were you wandering around normally when this happened, or did something special happen? Special like logging in, changing dimensions, etc. |
I was in a Mine-shaft when it first happened, and each consecutive crash after that was near a Mine-shaft. The third time I crashed (just now), it was the rock tumbling noise you have that played right when the game crashed. Below the sound system counter, it displayed 3-4 items (it flashed by before the crash). Two were When it crashes again, I will press Also, the rails are fine, I just had other sounds on my computer that flushed out some game noises. |
After a bit of inspection, I noticed that after it displays for a few ticks, it flashes to |
You sure it is
EDIT: I am sure it is EDIT2: Also, what are the numbers after "SoundSystem" in the debug display? Should look like "xx/yy", where "xx" is the current number of queued sounds in the Minecraft sound system, and "yy" is the max number of channels configured. "xx" should vary quite a bit based on whats going on in game; "yy" is fixed and will not change. |
Posted a BETA to CurseForge that has the PERIODIC sound option. I also made some changes internally based on what I can glean from the call stack you provided. At the moment this looks to be a Minecraft derp, but I did alter some of the control flow and behavior to be more defensive and avoid the condition. Give a try and let me know if it helps. |
I have been messing with other things lately, such as villager styled fortification, and some other building projects. I haven't been able to get into a cave and see if it crashes. On the other hand, is there a limit to sounds I can block? After the update, it seems any more sounds to the list of blocked sounds I add, they won't get blocked. |
No - there isn't a limit. Take a look at your dsurround.cfg file. All the sounds you block should be listed. |
They are listed. What I'm saying is that the sounds I added into the .cfg On Sat, Mar 5, 2016 at 4:58 PM, OreCruncher notifications@github.com
|
Hmmm...even after a client restart? |
Yep. Twice. On Sat, Mar 5, 2016 at 5:44 PM, OreCruncher notifications@github.com
|
Check the client log to see if an error is being reported. |
New issue while being underground near water (that is pouring in from the bottom of a birch forest lake):
|
It's the same exception as reported above, though in this particular case it is the latest version of Dynamic Surroundings with the volume hook. Any other exceptions reported during startup? Wondering if there is anything related to blocked sound initialization. Could be something like a Json exception. |
I did find something:
|
Anything above that? EDIT: Also, can you post your oldmatmos.json file? |
Also, I have a test binary that has addition trace and exception catching in an attempt to figure out this NPE. So far this is the only report of it occuring so it may be some combination of things on your system. If you could install this version and let me know the results. It should not crash, but if there is an issue a line with the token "getNormalizedVolume" would be in the client log with some additional information. |
@DrakoAlcarus I was wondering if you had a chance to use the test JAR in an attempt to identify the issue. My plan is to finish up bug fixing and what not before I release. Thanks! |
Here is oldmatmos:
And no, nothing above it. And now the sounds don't even play since installing your test.jar. |
All the sudden, the sounds are playing. Odd... Now I have to wait till' it crashes. |
Crash log:
I split to original up and put the important parts together. |
Remove the comma after the } for the last sound entry. As for the latest call stack I would have expected to see Dynamic Surroundings in it because I hook getNormalizedVolume() (the function func_148606_a in the trace). |
Testing it now... |
Removing the comma did no jutice:
also, I need to set the height in which the sounds play at y of 48 and below, and when leaving the boundary, I don't want the sound to cut off. Instead, it should finish that current sound it was playing with a fade away. |
The comma in the json would have nothing to do with the null pointer. It would, however, could have caused the log trace you posted further up and could have caused the blocked sounds to not work properly.
The NPE though it strange because the latest BETAs should have a different trace because the mod injects code into the method. As for the Y of 48 are you referring to the Y value for transitioning from Underground to normal Overworld "surface" biomes? |
Well, I ended up installing matmos for the second time... it was everything I wanted. Strong cave rumble, lava sounds, lots of birds, water drips, and some other sounds that stay true to tekkit classic |
Update with PERIODIC sound type posted to CurseForge. Matmos behavior still being weighed. |
In the 1.7 version I am using, the game keeps clearing the config file of blocked sounds and the config file I made to try to add sounds. It's getting extremely annoying and I even updated the mod today.
Also, the page you linked me doesn't tell me where to add sounds, but I can't find a way to add or run the sounds anyway because of the persistent issue above.
The text was updated successfully, but these errors were encountered: