Jump to content
The Dark Mod Forums

EFX preset spawnarg for Location entities?


Frost_Salamander

Recommended Posts

Currently if you are implementing EFX in your map, you need to maintain an .efx file: https://wiki.thedarkmod.com/index.php?title=Setting_Reverb_Data_of_Rooms_(EAX)

If you are using presets only, all this is is simply a 1:1 mapping of location entities to an EFX preset.  Doing this in a file is kind of tedious and error-prone, as you have to check each location entity in your map, and then check the file to make sure you got the location entity name correct, or didn't leave one out, etc.

Would it be a worthwhile feature request to be able to just set the EFX preset with a spawnarg on the location entity itself?  Something like:

"efx_preset"    "WOODEN_SMALLROOM"

Also, the location entity has other zone-related information, like ambient sound, ambient light, etc.  It would just make sense to have the EFX here as well.

This would only make sense for the presets, since you just need the preset name.  If you wanted to do anything more complicated, the file could still be used.  If both are used for the preset, one could take precedence over the other (the spawnarg pehaps).

I don't think anything would need to change in DR either, as it's just a new spawnarg on the entity.

 

 

  • Like 2
Link to comment
Share on other sites

On a related note, I would like to be able to change a room's EAX settings on the fly. Currently it's possible to change a room's ambient light and sound by using a script to swap out one atdm:location for another, though you do need to leave through an atdm:locationseparator and come back. However, the EAX settings do not update.

  • Like 2

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

8 hours ago, thebigh said:

Currently it's possible to change a room's ambient light and sound by using a script to swap out one atdm:location for another

I needed this functionality as well, but I found that simply updating the ambient spawnargs on the location entity (via a script) worked fine, although like you said you had to leave and come back into the room.

Anyways, getting slightly off topic :-).

 @stgatilov does the original ask make sense? I'm never sure if we should wait and hope for the dev team to see these, or just add a feature request to the bugtracker....

  • Like 1
Link to comment
Share on other sites

46 minutes ago, stgatilov said:

Yes, I think it is possible to specify efx preset in location entity.

Probably worth it to implement cross-fading of EFX settings simultaneously.
 

Thank you - feature request here: https://bugs.thedarkmod.com/view.php?id=6273

  • Like 1
Link to comment
Share on other sites

That'd be a great idea.

To dynamically change EFX, we have to know that it's a dynamic feature and not one permanently set during dmap or spawn time.

  • Like 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

On 3/19/2023 at 12:55 AM, Frost_Salamander said:

I found that simply updating the ambient spawnargs on the location entity (via a script) worked fine, although like you said you had to leave and come back into the room.

True. However, if the EFX settings are read from a file I think you'd need to pull the switcheroo script trick because those are determined by the name of the atdm:location entity. I suspect that changing its name spawnarg during play would be asking for all sorts of trouble.

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

15 hours ago, thebigh said:

True. However, if the EFX settings are read from a file I think you'd need to pull the switcheroo script trick because those are determined by the name of the atdm:location entity. I suspect that changing its name spawnarg during play would be asking for all sorts of trouble.

Well you don't need to change the name of the entity, only the ambient/ambient_light spawnargs on it.  That's what I did anyways.

I did actually try the 'switcheroo' trick first, but kept getting errors about multiple entities with the same name even though I was removing the old one first.  No idea why.  Then I tried the spawnarg thing and that worked so I left it at that.

Link to comment
Share on other sites

If you're not using a preset, a custom EFX setting read from the file looks something like this:

eaxreverb "loc_streets_alcove_1" {
    density                    0.576
    diffusion                  0.633
    gain                       0.3162
    gainhf                     0.7655
    gainlf                     0.769
    decay_time                 1.79
    decay_hfratio              0.6267
    decay_lfratio              0.4433
    reflections_gain           0.4281
    reflections_delay          0.0167
    reflections_pan            0 0 0
    late_reverb_gain           0.9058
    late_reverb_delay          0.0133
    late_reverb_pan            0 0 0
    echo_time                  0.218
    echo_depth                 0.1
    modulation_time            0.25
    modulation_depth           0
    air_absorption_gainhf      0.9905
    hfreference                10364
    lfreference                192.2
    room_rolloff_factor        0
    decayhf_limit              1
}

where loc_streets_alcove_1 is the name of the atdm:location entity for that location. If you wanted to change such an EFX during play you would need another entry in the file, then refer to it by either changing the name of the location entity (BAD!) or exchanging one for another.

  • 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

  • 2 weeks later...
On 3/19/2023 at 12:55 AM, Frost_Salamander said:

I found that simply updating the ambient spawnargs on the location entity (via a script) worked fine

How did you get this to work? I cannot get the sound to update by scripting this sort of thing:

$location_room1.setSpawnArg( "ambient", "snd_somenewsound" );

if location_room1 is a location_info entity and snd_somenewsound has been defined in the atdm:location_settings entity. It just goes back to playing the original sound when I go back into room1.

  • 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

5 hours ago, thebigh said:

How did you get this to work? I cannot get the sound to update by scripting this sort of thing:

$location_room1.setSpawnArg( "ambient", "snd_somenewsound" );

if location_room1 is a location_info entity and snd_somenewsound has been defined in the atdm:location_settings entity. It just goes back to playing the original sound when I go back into room1.

I used setKey() instead of setSpawnArg(). Not sure what the difference is but it worked.

  • Like 2
Link to comment
Share on other sites

I think setSpawnArg is intended for setting spawnargs on entities that you're going to spawn. You can use it on sys followed by sys.spawn()

  • Like 1
Link to comment
Share on other sites

Yep, that did the trick. Thanks!

  • 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

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

    • 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
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...