Jump to content
The Dark Mod Forums

How do I remove an inherited entity property?


Nort
 Share

Recommended Posts

I've run into a sound issue while assembling a little dresser prefab.

There's a great sound for closing a drawer (an "atdm:mover_door_sliding" entity), but it's the sound of a drawer BEING closed, and should therefor be played during "snd_move", and not "snd_close" (at the beginning of the translation, and not once it has finished). If I have no custom "snd_close" property, this value defaults back to a clunky default sound, and if I instead have a "snd_close" and give it either the value "nosound", "0" or "-", the closing sound cuts out, since now the sound of "nosound" is playing instead.

Is there some way to uninherit an inherited property (like for example the "snd_close" property)?

 

Link to comment
Share on other sites

Edit: I wrote a lot trying to speculate about what your root problem was. I think I've boiled it down to the solution that's just written at the bottom in Edit3, if you want to cut to the chase. 

---

Replacing a spawnarg does the same thing as changing the inheritance.

Okay, to literally answer your question, you could make a duplicate of the class entity from which it's inheriting "snd_closed", and then delete or replace that "snd_closed" with "nosound", "0", or "-", then have the inheritance call that modified duplicate version. But then it's just going to cut off again after snd_move ends like you just said you don't want. So that doesn't really solve your problem. So don't do that.

It appears that the problem isn't snd_closed per se. It's that you don't have a transition sound from snd_move to silence.

What I think you should do is use a sound editor like Audacity, take the end of the snd_move file, and then make a new & clean cut off sound at the end, like a quick fade off or play with the manipulations until it sounds like a drawer stopping would actually sound. Be sure to crop it so your fade off sound seamlessly fits the end of the snd_move. Then package your new sound in the sound folder for your mission and make a new sound shader for it, and then fill "snd_close" with the address to that sound. Read the wiki page on custom sounds for the details.

Edit: Unless I don't understand your situation.

------

Edit2: It sounds like a timing issue, like snd_close is happening (and cutting off snd_move) before you want it to. In fact, you don't want snd_close at all. Is that right?

Okay, here's the issue.

The way the system is designed is to allow for closing sounds of any arbitrary length. So it plays snd_move as long as its moving, sometimes long, sometimes short, then snd_close plays at the moment it's finished. So you'd want to always break up your sound into two parts, one for the "still moving part" that can play on repeat for any length of time, and one for the bang of the closed part that plays only at the end it, that would fit just as well if snd_move only played 1/2 way through or if it played 3 times. So then you always get a seamless move and close sequence for any arbitrary duration from half a second to 5 seconds or whatever. Would that fix your issue?

It kind of looks like you want a combined move & closed part in one sound file. But the system is not really designed for that. It's designed to play while_moving -> snd_move, at_end -> snd_closed in sequence, so you make your sounds fit that template. If you want to change that template itself, so it only plays snd_move to its end every time no matter what, now (I think) you're talking sourcecode changes, which is not something you can just fix for your FM. (But I'm not 100% sure about that. There may be a way to do that, but I don't know about it.)

------

Edit3: Oh, well if it's that last part that you want, then there's another really simple thing you can do, which is completely cut out the snd_move and snd_close altogether, use "nosound" for both, but when somebody frobs the drawer, have it like a button that calls a speaker attached to the drawer that just plays your close sound as a one-shot independent sound.

It will get rid of your cut-off problem. But the catch is, you'll need to set up a script or trigger system so it only plays every other time (when closing, not when opening; unless you want it when it's opening too, in which case just trigger it every time).

  • Thanks 1

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Inheritance is controlled from above.

If you need something that isn't defined directly in your own entity, you need to keep moving up the tree until you find the entity that has the attribute you wanna change and clone that one with alternate values. Of course you will also need to repeat this process for all the intermediaries so that the new entity hierarchy is preserved. Though, with the PK4 override system you can just use the modified entity at the top of the tree with the same name. (not as clean but a little more convenient)

Alternately, grab all the attributes you want from all entities in the tree and just add them all to one entity.

  • Thanks 1

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Posted (edited)
6 hours ago, demagogue said:

The way the system is designed is to allow for closing sounds of any arbitrary length. So it plays snd_move as long as its moving, sometimes long, sometimes short, then snd_close plays at the moment it's finished. So you'd want to always break up your sound into two parts, one for the "still moving part" that can play on repeat for any length of time, and one for the bang of the closed part that plays only at the end it

This is a bit funny, because the sound I'm refering to, is your stock "frob_drawer_close" sounds ("frob_drawer_close01.ogg" and "frob_drawer_close02.ogg"). It's possible that the dev team has already split them up into proper move and closed sounds, in a post-2020 update, but otherwise, consider doing that.

 

"It sounds like a timing issue, like snd_close is happening (and cutting off snd_move) before you want it to. In fact, you don't want snd_close at all. Is that right?"

To clarify: Yes.

Your Edit 3 solution will also likely work very well as a makeshit solution.

Thank you both.

 

Edited by Nort
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.

 Share

  • Recent Status Updates

    • Nort

      I want to be a fish, but I'm not a fish. My mom wants to be a fish too, and so she's killing herself eating plankton and sh***ng blood, and tells me to stop nagging her about taking her medication. I spent several hours today, just lying in bed, having anxiety over just existing, and not being a fish. You fish, you don't know how lucky you are. You can eat all the plankton you want. I tried eating plankton again yesterday, and I just got sick. I hate being a shark.
      · 0 replies
    • Nort

      I just gave myself vertigo. A pleasant kind of vertigo, like the world has been lifted off my shoulders. I'll explain:
      Yesterday I saw to my dismay, that I had made my entire map two - two - units too short on every level - that every set01 piece was sticking 2 units into the ceiling. That's basically 402 brushes that needs to be realigned (minus the ground floor brushes).
      I knew enough about selections to do all of that in a very tense five minutes, and it compiled without leaks. (Thank you so much, Dark Radiant devs, for making an editor with such care for precision that you can align hundreds of brushes perfectly at once (which is not something I can say for Valve's Hammer editor, which has some serious issues on that front, which actually made me just quit it in disgust).) However, the result is that the entire level has now been stretched a barely noticable 2 units, and it will take some getting used to psychologically.
      · 0 replies
    • Nort

      My workflow is basically running from a chain of disasters, eventually trying to seek shelter in former disasters. It's not ideal - it's just my life.
      When I abandoned my first map, it was out of a typical mental breakdown, and so I returned to find a skybox void where the kitchen door should have been (due to a misplaced visportal) and two overlapping brushes Z-fighting on the kitchen floor.
      I've now cleaned up the last bit of mess, by cleanly separating every floor into its own layer. Now I can finally work on each floor in peace.
      ...not that I really needed to. Once you get skilled enough, the orthographic messes, well, I'll let this video speak for itself:
       
      · 1 reply
    • Nort

      Beams, beams, beams...
      Support beams, and cross beams, and then beams to fixate the support beams to the cross beams. The more beams you have in a map, the better. There's walls, floors and ceilings, but the rest of the map is pretty much just beams. Beams makes a thief happy.
      · 0 replies
    • jaxa

      Embracer Group is Buying Square Enix Montréal, Eidos, and Crystal Dynamics for “Only” 300 Million USD: https://wccftech.com/embracer-group-square-enix-montreal-eidos-crystal-dynamics/
      · 1 reply
×
×
  • Create New...