sound: speed-/rpm-depending sound

Place to get help with not working mods / modding interface.
Post Reply
der Papst
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sun Mar 20, 2016 6:15 pm
Contact:

sound: speed-/rpm-depending sound

Post by der Papst »

I'm looking for a possibility to alter for example a vehicles working sound, based on its speed or engine's rpm.
Yesterday, I noticed the car already does, but I couldn't find anything in entities.lua which controls it.

BTW: Neither the wiki search nor google finds a documentation of those "suspicious" functions, only files where it is used without any comments:
stop_trigger/stop_trigger_speed (i guess it sets a minimum speed for break noise?)
sound_minimum_speed
match_speed_to_activity

Is it possible to (additional to altering it's pitch) swap the working_sound url?

der Papst
Burner Inserter
Burner Inserter
Posts: 15
Joined: Sun Mar 20, 2016 6:15 pm
Contact:

Re: sound: speed-/rpm-depending sound

Post by der Papst »

I tried the following code with different values for min_perceived_performance and performance_to_sound_speedup - the sound didn't change at all while accelerating.
My vehicle reaches only 35km/h, i thought performance_to_sound_speedup would be the multiplier for that...

Could pls anyone explain me how that works?

Code: Select all

    working_sound =
    {
      sound =
      {
        filename = "__mod__/audio/idle.ogg",
        volume = 0.6
      },
      match_speed_to_activity = true,
      activate_sound =
      {
        filename = "__mod__/audio/start.ogg",
        volume = 0.6
      },
      deactivate_sound =
      {
        filename = "__mod__/audio/stop.ogg",
        volume = 0.6
      },
    },
    min_perceived_performance = 0.25,
    performance_to_sound_speedup = 5,

Post Reply

Return to “Modding help”