[boskid][1.1.2] Power Switch does not play sound effects

This subforum contains all the issues which we already resolved.
Post Reply
Mooeing-747
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri May 22, 2020 6:56 pm
Contact:

[boskid][1.1.2] Power Switch does not play sound effects

Post by Mooeing-747 »

Despite having working_sound defined in its prototype (the actual definition in base/prototypes/entity/circuit-network.lua), the power switch does not play sounds. I confirmed this by building a power switch, standing right next to it, and toggling it on and off, both manually and with the circuit network, as well as with the switch electrically loaded and not. I used the debug option that lists the recent sound plays to confirm that the sounds aren't played.

Furthermore, it seems like the switch has never played sounds, based on this thread. But the prototype and these release notes make it seem like it should?

For easy reference, here's the definition:

Code: Select all

    working_sound =
    {
      sound =
      {
        filename = "__core__/sound/silence-1sec.ogg",
        volume = 0
      },
      activate_sound =
      {
        {
          filename = "__base__/sound/power-switch-activate-1.ogg",
          volume = 0.4
        },
        {
          filename = "__base__/sound/power-switch-activate-2.ogg",
          volume = 0.4
        },
        {
          filename = "__base__/sound/power-switch-activate-3.ogg",
          volume = 0.4
        }
      },
      deactivate_sound =
      {
        filename = "__core__/sound/silence-1sec.ogg",
        volume = 0
      },
      audible_distance_modifier = 0.4,
      --max_sounds_per_type = 3
    },
I did confirm that the sound files exist, so it seems like this was intended to play sounds but the internal support was never added to the game.
Known as moogan in game.

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2253
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][1.1.2] Power Switch does not play sound effects

Post by boskid »

Thanks for the report. Issue is now fixed for 1.1.3.

For the working_sound to play its activate_sound, activity rate function has to be given and because it was missing, entity was always considered as working - you could check that by setting working_sound.sound into something other than silence-1sec. I fixed it by adding activity rate function, which is based on the On-Off state so it will properly play activate_sound, working sound and deactivate_sound. I was considering it to play based on electric network energy flowing (when sparks are rendered) but decided not to because of existing sound that is defined for activating power switch.

Post Reply

Return to “Resolved Problems and Bugs”