[MOD 0.12.x, 0.13.x] Honk!

Topics and discussion about specific mods
GotLag
Filter Inserter
Filter Inserter
Posts: 532
Joined: Sat May 03, 2014 3:32 pm
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by GotLag »

Optera wrote:Please add a variable for volume control to control.lua file or add a config.lua for that.
It's in data.lua
User avatar
FlyHigh
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Sun Jul 27, 2014 12:14 am
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by FlyHigh »

Well, i'm getting an error "no loader found for ''custom-input" on 0.12

Image
>>> Maxwell R. Black <<<

Image


* * *
GotLag
Filter Inserter
Filter Inserter
Posts: 532
Joined: Sat May 03, 2014 3:32 pm
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by GotLag »

That's because you downloaded the 0.13 version.
Valck
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Sep 11, 2016 11:45 am
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by Valck »

Just a quick and dirty hack: https://mods.factorio.com/mods/Valck/Honck
Feel free to fold any changes into your mod.


This adds car and tank horns (don't expect a battleship fog horn on the tank, it's the same as the car horn, as I'm told tanks have rather wimpy sounding horns if they have any at all).

I lifted the restriction on train horns being operable in manual mode only. I also changed the config to mute automatic honking, the reasoning being that if you have moderately large stations, train horns are constantly going off, and it becomes almost impossible to tell which train is honking, making it more annoying than useful.
The idea was to use it in multiplayer, so I think players should be able to honk when they want, even as passengers on an automatic train.
Gwolfski
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Sep 25, 2016 8:12 pm
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by Gwolfski »

GotLag wrote:-snip-

(there's no way to determine the forward-facing locomotive on a train when it starts to move, as the speed is still 0 and the front_movers and back_movers arrays are not relative to direction of travel).
You could maybe try to honk when it is at like 1 speed?
Salty Wagyu
Inserter
Inserter
Posts: 24
Joined: Thu Sep 21, 2017 10:37 am
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by Salty Wagyu »

Doesn't seem to toggle manual/auto for me. What happens is I press J and green "Automatic mode" text appears, press J again and the same message shows. It doesn't switch to manual. Same effect of "Manual mode" text spamming after I adjust the auto/manual button myself and hit J several times. Using Bob's mods if that's relevant, but the locomotive is vanilla
Attachments
Untitled.jpg
Untitled.jpg (86.15 KiB) Viewed 5596 times
GotLag
Filter Inserter
Filter Inserter
Posts: 532
Joined: Sat May 03, 2014 3:32 pm
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by GotLag »

Do Bob's mods add any train controls? I haven't seen that "Manual Mode" text before. If Bob's added manual toggle that's also bound to J, pressing it would trigger both mods to toggle, thus cancelling each other out, but that's just a guess.
dgw
Fast Inserter
Fast Inserter
Posts: 197
Joined: Tue Apr 12, 2016 7:06 pm
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by dgw »

I'm pretty sure that "Manual Mode" text is from PickerExtended. Elegant way to solve this from ChurchOrganist (with help from Nexela the Prolific) in the Deltic Honk fork of this mod. (I want train honks, but probably not the Deltic one, so I hope this fix gets released for this mod version.)

It happens because Picker also binds J to toggle manual/automatic mode on trains, so the two mods cancel each other out.
Ironhair
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Tue Apr 12, 2016 5:39 am
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by Ironhair »

is it possible for it to honk if the player is within 1 chunk of it, instead of the station?
User avatar
invisus
Filter Inserter
Filter Inserter
Posts: 284
Joined: Fri Sep 21, 2018 5:33 pm
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by invisus »

Hah, what a great mod. Thank you GotLag.

Seems like a rather silly thing, just a "honk." But it's amazing the richness is brings into the game!

I would love to see this in vanilla, and am looking forward to... whatever "Better sounds" means.
GotLag
Filter Inserter
Filter Inserter
Posts: 532
Joined: Sat May 03, 2014 3:32 pm
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by GotLag »

Thanks, and I know what you mean - I made the mod as a joke response to a throwaway line in the Factorio IRC channel, and now I can't play without it.

Railyards feel so empty and lifeless without the gentle honking of migrating trains :)
User avatar
invisus
Filter Inserter
Filter Inserter
Posts: 284
Joined: Fri Sep 21, 2018 5:33 pm
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by invisus »

GotLag wrote: Tue Mar 05, 2019 5:34 am Railyards feel so empty and lifeless without the gentle honking of migrating trains :)
Haha yes! I was embarrassingly excited when I saw the update to v3.0.0 today. Couldn't wait to get home and wander around my rail yard.
So glad we can configure the distance now! Thank you!

I've been wishing that trains sitting idle at signals/stations, in stackers or waiting for a load/unload even,would emit an unrhythmic "tsht" sounds of the air brakes. (Or whatever it is that's making that noise!)

Something like:
https://www.youtube.com/watch?v=Yjn-3hUyDjY
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.12.x, 0.13.x] Honk!

Post by Optera »

When driving a much faster player train behind a slow ore train my train constantly triggers HONK_ON_START.

The following change will make trains only do the starting honk when they where fully stopped and not breaking for a signal.

Code: Select all

local stop_states = {
  [defines.train_state.no_schedule] = true,
  [defines.train_state.no_path] = true,
  [defines.train_state.wait_signal] = true,
  [defines.train_state.wait_station] = true,
  [defines.train_state.manual_control] = true,
}

script.on_event(defines.events.on_train_changed_state, function(event)
  if HONK_ON_START and event.train.state == defines.train_state.on_the_path and stop_states[event.old_state] then
    -- Entering travelling state, after being stopped
    findLocoToHonk(HONK_ON_START, event.train, event.tick)
  elseif HONK_FOR_STATION and event.train.state == defines.train_state.arrive_station then
    -- Beginning to brake before arriving at station
    findLocoToHonk(HONK_FOR_STATION, event.train, event.tick)
  elseif HONK_FOR_SIGNAL and event.train.state == defines.train_state.arrive_signal then
    -- Beginning to brake for signal
    findLocoToHonk(HONK_FOR_SIGNAL, event.train, event.tick)
  elseif HONK_FOR_LOST and event.train.state == defines.train_state.path_lost then
    -- Train is lost, begin mournful honking
    findLocoToHonk(HONK_FOR_LOST, event.train, event.tick)
  end
end)
Edit:
Another nice feature would be to confirm changed automatic mode with either a honk or flying text.
Here's the flying text version:

Code: Select all

-- Toggle manual/automatic control
script.on_event("toggle-train-control", function(event)
  local player = game.players[event.player_index]
  if player.vehicle and player.vehicle.type == "locomotive" then    
    if player.vehicle.train.manual_mode then
      player.vehicle.train.manual_mode = false
      player.surface.create_entity{name="flying-text", position=player.position, text="manual"}
    else    
      player.vehicle.train.manual_mode = true
      player.surface.create_entity{name="flying-text", position=player.position, text="automatic"}
    end
  end
end)
Post Reply

Return to “Mods”