Jump to content
The Dark Mod Forums

How do I remove an inherited entity property?


Nort

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).

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.

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

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.

  • Recent Status Updates

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
×
×
  • Create New...