Jump to content
The Dark Mod Forums

The Stubborn Looping Speaker


Odaydayz

Recommended Posts

Hello,
I'm new here.

I started designing a map with the, "Dark Radiant" 2.14.0 64x and test it with, "The Dark Mod" 2.09 64x. I wanted to add a simple sound that plays when the player enters the map once. Unfortunately, there's this weird issue with the speaker that plays the sound that I added. I went through, "The Dark Mod Wiki" but with no luck what so ever. Speaking of the issue, I simply added a speaker with the sound, "hum01" with s_global 1, s_looping 0, and s_volume -5. The speaker kept looping ingame. I tried dmapping, tried not including the s_looping to the speaker's entity, and tried removing the s_global but the speaker kept looping. I know that scripting will make things much easier for me but I'm new to Python. Can anyone help if I missed something, used the wrong version of something, or its an actual bug in something?
(The entity is a normal speaker inside an already made room added by right-mouse clicking on the orthographic view and choosing the, "Create speaker..." option.)

Thank you,
Odaydayz

  • Like 1
Link to comment
Share on other sites

4 minutes ago, JackFarmer said:

Maybe you have duplicated the speaker by accident before removing the property in question?

1. Select the speaker in question

2. Press "H" to hide it

3. If there is a duplicated speaker, it should be visible now (with a different entity name, of course)

 

No, I checked it out and there is only that one speaker as the map is still on its early stages.

Link to comment
Share on other sites

13 minutes ago, Odaydayz said:

No, I checked it out and there is only that one speaker as the map is still on its early stages.

Then try:

1. Remove the speaker

2. Create a new speaker with the sound shader


If this all does not help, please do an upload of the map as txt file to the forums. File sizes must not exceed 500 kb.

 

Link to comment
Share on other sites

In the respective sound shader I see the following code:

hum01
{
	editor_displayFolder	ambient/ambience

	description "Made by Dario D"

	looping
	no_efx
	sound/ambient/ambience/dd_amb_hum_1.ogg
}

Maybe this is an old method because it seems that looping forces the looping, so it can't be set in DR.

If I comment it like this:

hum01
{
	editor_displayFolder	ambient/ambience

	description "Made by Dario D"

//	looping
	no_efx
	sound/ambient/ambience/dd_amb_hum_1.ogg
}

Then I can set the spawnarg correctly in DR.

Best is to copy this sound shader to your mission folder and then change it, I think.

Edited by datiswous
  • Thanks 1
Link to comment
Share on other sites

Yeah, I just wonder how you could set the s_looping spawnarg to 1 as default, which then could be overridden by the mapper.

Edit:

If I add the line "s_looping" "0" to the entityDef speaker it defaults to zero in DR.

Maybe you could make two entitydefs, one defaults to looping, the other not, then add inherit entitydef speaker to those. Then remove looping from sound shaders.

 

Edited by datiswous
Link to comment
Share on other sites

5 hours ago, datiswous said:

In the respective sound shader I see the following code:

hum01
{
	editor_displayFolder	ambient/ambience

	description "Made by Dario D"

	looping
	no_efx
	sound/ambient/ambience/dd_amb_hum_1.ogg
}

Maybe this is an old method because it seems that looping forces the looping, so it can't be set in DR.

If I comment it like this:

hum01
{
	editor_displayFolder	ambient/ambience

	description "Made by Dario D"

//	looping
	no_efx
	sound/ambient/ambience/dd_amb_hum_1.ogg
}

Then I can set the spawnarg correctly in DR.

Best is to copy this sound shader to your mission folder and then change it, I think.


Thank you very much @datiswous & @JackFarmer. Making, "looping" a //comment in the shader's definition fixed the problem but digging the folder for it was not a pleasant experience.

For anyone who encountered the same issue,
"hum01"'s definition is located in, tdm_sound_ambient_decls01.pk4\sound\tdm_ambient_ambience02.sndshd

  • Like 1
Link to comment
Share on other sites

57 minutes ago, Odaydayz said:

Thank you very much @datiswous & @JackFarmer. Making, "looping" a //comment in the shader's definition fixed the problem but digging the folder for it was not a pleasant experience.

For anyone who encountered the same issue,
"hum01"'s definition is located in, tdm_sound_ambient_decls01.pk4\sound\tdm_ambient_ambience02.sndshd

You should not override core files though..

So you make a folder sound in the root of your tdm installation. In it you create a sndshd file, for example no_looping.sndshd . In the file you put on top the shader name, for example:

hum1_noloop
{
	editor_displayFolder	ambient/ambience

	description "Made by Dario D"

//	looping
	no_efx
	sound/ambient/ambience/dd_amb_hum_1.ogg
}

Under that block you can make another shader with a new shader name, so you can list them all in one file.

Under editor_displayfolder you can optionally add a different folder. This is where you find it in DR.

For example all_noloop:

noloop.jpg.5b955dff322677b47d74df41e86a39cf.jpg

Edited by datiswous
  • Thanks 1
Link to comment
Share on other sites

And welcome to the site. Hope you like it here.

  • Like 1

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                                                                                  A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Link to comment
Share on other sites

It seems like a bug that explicitly setting s_looping 0 does not override the looping keyword in the sound shader. The sound shader keywords should be defaults that can always be overridden on a per-speaker basis.

  • Like 1
Link to comment
Share on other sites

40 minutes ago, OrbWeaver said:

It seems like a bug that explicitly setting s_looping 0 does not override the looping keyword in the sound shader. The sound shader keywords should be defaults that can always be overridden on a per-speaker basis.

Ah ok good to know. I was just thinking, wouldn't it be more useful to put such settings in def files instead, so they show up in DR as defaults?

 

Link to comment
Share on other sites

DEF files only govern the behaviour of entities that you insert with Right Click -> Create Entity.

When you do Right Click -> Create Speaker you create a generic "speaker" entity with a configurable sound shader. There are no DEF files involved at this point, other than the DEF for the "speaker" entity itself which does not specify a particular sound shader.

In order to use entityDef properties as defaults for sound shaders, you would need to create a specific entityDef for each and every sound shader (e.g. "speaker_hum01", "speaker_hum02", "speaker_ambientdogbark" or whatever). This seems like a lot of work for very little gain, and would clutter the entity tree considerably.

Link to comment
Share on other sites

15 hours ago, datiswous said:

You should not override core files though..

So you make a folder sound in the root of your tdm installation. In it you create a sndshd file, for example no_looping.sndshd . In the file you put on top the shader name, for example:

hum1_noloop
{
	editor_displayFolder	ambient/ambience

	description "Made by Dario D"

//	looping
	no_efx
	sound/ambient/ambience/dd_amb_hum_1.ogg
}

Under that block you can make another shader with a new shader name, so you can list them all in one file.

Under editor_displayfolder you can optionally add a different folder. This is where you find it in DR.

For example all_noloop:

noloop.jpg.5b955dff322677b47d74df41e86a39cf.jpg

I ended up making a map specific folder with its own edited .ogg and .sndshd because there is no fade out for hum01 which makes it sound very weird without its loop. I appreciate the follow up @datiswous but I think I can handle the rest of it from here. Unless, something new comes up. In that case, I know where to look and ask.

====================
 

10 hours ago, thebigh said:

And welcome to the site. Hope you like it here.

Since we all know what, "Thief" is and we agree to see more of it, this site is another family to me @thebigh.

  • Like 1
Link to comment
Share on other sites

3 hours ago, OrbWeaver said:

In order to use entityDef properties as defaults for sound shaders, you would need to create a specific entityDef for each and every sound shader (e.g. "speaker_hum01", "speaker_hum02", "speaker_ambientdogbark" or whatever). This seems like a lot of work for very little gain,

You only need a def file for a certain type of speaker and set default values, which then show up as default spawnargs in DR. Then for every sound shader you can change those. The above example is the entityDef atdm:speaker_ambient_music . If I use that and add s_looping to that entitydef file, it shows up as a default in every sound shader you add to that specific speaker. I mean off course you might need a couple of those defs, but not for every shader. Most sound shaders have the same stuff applied and the rest you can omit or add it not-active.

 

Link to comment
Share on other sites

14 hours ago, OrbWeaver said:

It seems like a bug that explicitly setting s_looping 0 does not override the looping keyword in the sound shader. The sound shader keywords should be defaults that can always be overridden on a per-speaker basis.

I won't say this is a bug.

The source code understandibly stores booleans both for material looping and for entity looping. If you have two true/false values, you cannot know which of them was actually specified or not, so "s_looping 0" and no s_looping are simply the same.

In fact, the values are not even booleans, they are bitflags.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 0 replies
    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 7 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
×
×
  • Create New...