2 Sound Engine questions

DerAkademikerDerAkademiker Join Date: 2012-12-19 Member: 175540Members
edited January 2013 in Modding
So I have two questions on the Sound Engine:

1. There are audio effects added to the sounds (delay, reverb, maybe even filters), when they are set to 3d mode in Fmod. These effects seem to be dynamic - big rooms add a wet, small corridors add a dry audio effect. Where are these effects defined and how can I tweak/change/disable them?

2. I want to make two entities for some sounds, so I can play one sound for the Client only, and the other one for all players in 3d mode at certain events. Let's say I have two slightly differently equalized sounds for the pistol fire, one for 1st-person (pistol1), one for 3rd-person listeners (pistol2). How do I implement those two entities in the lua files?

Any ideas?

Comments

  • SpoffySpoffy Join Date: 2013-01-06 Member: 177871Members
    Stab in the dark, having not modded with NS2 before.

    Have you tried looking for the functions which send a sound to the client (Try the unofficial docs?), then transmitting the different sounds to each client in range manually?

    As I said, stab in the dark, hope it helps.
  • DerAkademikerDerAkademiker Join Date: 2012-12-19 Member: 175540Members
    edited January 2013
    I don't know if you did get my question right, because you are talking about range: I only want to decide <i>me</i> or <i>not me</i>.
    I have no programming knowledge, so even if I found the function, I'd have no idea how to write it down in the lua files. I thought there may be just a parameter or something, that sais 'This one only for the Client who fired'.
    This is what contains the path to the pistol sound in Marineweaponeffects.lua:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->kMarineWeaponEffects =
    {
        pistol_attack =
        {
            pistolAttackEffects =
            {
                {viewmodel_cinematic = "cinematics/marine/pistol/muzzle_flash.cinematic", attach_point = "fxnode_pistolmuzzle"},
                {weapon_cinematic = "cinematics/marine/pistol/muzzle_flash.cinematic", attach_point = "fxnode_pistolmuzzle"},
                // Sound effect
                {sound = "sound/NS2.fev/marine/pistol/fire"},
            },
        },
    }<!--c2--></div><!--ec2-->

    I thought I could just add a line like

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->{sound = "sound/NS2.fev/marine/pistol/fire[i]2[/i]" [i]WhateverTheParamMayBe[/i] = true}<!--c2--></div><!--ec2-->
    Or am I thinking wrong?
  • SpoffySpoffy Join Date: 2013-01-06 Member: 177871Members
    I couldn't say I'm afraid on that, as I don't know how the game processes that table, and I know little of NS2 modding specifically.

    Your best bet is trying to find something with two different sounds (depending on who's listening) and see how that does it, if there is anything like that.
  • DerAkademikerDerAkademiker Join Date: 2012-12-19 Member: 175540Members
    edited January 2013
    - so I found one part of the answer on my first question. I can change the reverb-mix of every sound inside Fmod. I still don't know where Spark tells Fmod when effects are added and what kinds of effects though. There's a DSPeffects.lua, but there only the near-death low-pass-filter seems to be defined.

    - I can find an event where two different sounds are triggered, it's the footsteps inside PlayerEffects.lua. There are normal footstep sounds and those for enemies. The parameter sais 'enemy = true', but that still isn't really what I'm searching for...I want to have 'Firstperson' vs. 'Thirdperson', I know that the CryEngine for example has those parameters inside xml-files. Spark should have those parameters as well, shouldn't it? Anybody?
  • SpoffySpoffy Join Date: 2013-01-06 Member: 177871Members
    edited January 2013
    I've done some digging for you based on what you turned up. It seems that sounds are triggered using events (See Player.lua, line 2305) which are registered in a master table. This table is handled by the EffectsManager.lua and 'TriggerEffect' function, though that's as far as I've gotten with my digging currently. I'll keep you posted.

    Update: Game Effects Manager, InternalTriggerSound is getting closer.

    Update2: Bingo, EffectsManager.lua, line 600. That handles all the sound output. Enjoy :)
  • DerAkademikerDerAkademiker Join Date: 2012-12-19 Member: 175540Members
    Awesome, thanks. Now I only have to understand all that code :D but maybe I'll do it.
Sign In or Register to comment.