Page 1 of 2

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

Posted: Wed Mar 16, 2016 4:34 am
by GotLag
Type: Mod
Name: Honk
Description: Trains now have horns!
License: No rights reserved
Version: 0.2.1
Release: 2016-03-17
Tested-With-Factorio-Version: 0.12.26
Category: Helper
Download: Mod Portal
Honk_2.1.1.zip
Factorio 0.13
(82.79 KiB) Downloaded 696 times
Honk_0.2.1.zip
Factorio 0.12
(82.08 KiB) Downloaded 318 times
Website: n/a

License
License
Description
Example video
When braking for a signal or station, trains emit one long horn sound.
Upon starting to move, trains emit two short horn blasts in quick succession.

Version History
Version history
Known Issues
The sound originates from the location of the lead locomotive at the time it's triggered. This means that for the long horn blast, the sound location does not move with the train.

Acknowledgements
Thanks to Supercheese for the method used to play sounds, taken from the Red Alerts mod.

Re: [MOD 0.12.x] Honk! v0.2.0

Posted: Wed Mar 16, 2016 7:35 pm
by waduk
Haha,..this is really great.
Yeah, it's a bit sad the sound were not following train, especially noticeable on the long horn.
Sound work best if we're riding the train.

But this is a great start.
10/10 must have mod (along with smart train by choumiko)

Give it a shout to YuokiTani, he really love train.

Please also post it on reddit, many other user the other day is wondering if someone can make this, and you did !


Edit :
Oh, you already posted on reddit. Didn't notice since it was a reply, not self post.

Re: [MOD 0.12.x] Honk! v0.2.1

Posted: Thu Mar 17, 2016 9:18 am
by Alexs
thx! great idea!

Re: [MOD 0.12.x] Honk! v0.2.1

Posted: Thu Mar 17, 2016 12:05 pm
by Arch666Angel
Love for trains = 10/10

Re: [MOD 0.12.x] Honk! v0.2.1

Posted: Mon Mar 21, 2016 2:28 pm
by Qon
I would like if trains instead used that long horn singlan if the player is close to a railpiece that the train will use within a few seconds. So you don't get run over...

Re: [MOD 0.12.x] Honk! v0.2.1

Posted: Mon Mar 28, 2016 12:43 pm
by BlakeMW
And trains definitely need a "victory horn" for when they run you over.

Re: [MOD 0.12.x] Honk! v0.2.1

Posted: Wed Mar 30, 2016 10:58 am
by GotLag
I like that idea, I'll see if I can find an appropriate sound :lol:

Re: [MOD 0.12.x] Honk! v0.2.1

Posted: Thu Mar 31, 2016 11:18 am
by Qon
BlakeMW wrote:And trains definitely need a "victory horn" for when they run you over.
Or run over a biter :>
GotLag wrote:I like that idea, I'll see if I can find an appropriate sound :lol:
Which idea? Mine or BlakeMW's?

Re: [MOD 0.12.x] Honk! v0.2.1

Posted: Thu Mar 31, 2016 11:21 am
by GotLag
Victory horn. I don't think the train should honk until after it's run you over, as that would impede its primary function (which is running you over).

Re: [MOD 0.12.x] Honk! v0.2.1

Posted: Sun Apr 03, 2016 1:03 pm
by Qon
GotLag wrote:Victory horn. I don't think the train should honk until after it's run you over, as that would impede its primary function (which is running you over).
LOL :D
Sure that would be funny. It must be something that really sounds both like "victory" and "haha, got you!" for maximum effect.

Re: [MOD 0.12.x] Honk! v0.2.1

Posted: Sun Apr 03, 2016 2:26 pm
by Roktaal
Qon wrote:
GotLag wrote:Victory horn. I don't think the train should honk until after it's run you over, as that would impede its primary function (which is running you over).
LOL :D
Sure that would be funny. It must be something that really sounds both like "victory" and "haha, got you!" for maximum effect.
Headshot! :D

Re: [MOD 0.12.x] Honk! v0.2.1

Posted: Mon Apr 04, 2016 7:37 am
by JasonC
This is so awesome, thanks for making this one. It really ought to be standard with the game.

Also for some reason YouTube decided that your video is related to a video titled "Why Avocados Shouldn't Exist". I didn't watch it, sounds way too controversial.

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

Posted: Wed Jun 29, 2016 2:01 pm
by GotLag
Updated to 0.13

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

Posted: Sat Jul 09, 2016 6:38 am
by nerdkusi
Thanks for this mod its great I love it! There is one issue tho, if a train follows another on a rail it emmits the honk every 0.5 second or so, resulting in mashed noise.
Maybe you could add a minimum delay between two honks? A two to five seconds would probably do. :D

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

Posted: Sat Jul 09, 2016 6:45 am
by GotLag
The honks are emitted when trains enter three of the possible states: on_the_path, arrive_station, and arrive_signal. So if your trains are constantly honking it means they're very often switching between braking for a signal, and back to full speed ahead. I didn't catch that in testing, as I used a simple test track which wasn't congested.

I'll look into adding a cooldown today.

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

Posted: Mon Jul 11, 2016 2:21 pm
by GotLag
Added an experimental cooldown. It should now only allow 3 honks per rolling 1.5-second window.

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

Posted: Wed Jul 13, 2016 11:48 am
by GotLag
Updated to 2.1.0:
Image

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

Posted: Thu Jul 14, 2016 1:34 pm
by Mattyrogue
I have to say, I love this mod, it adds so much life to my factories actually hearing trains arriving and leaving the station from a distance.

I do have a small suggestion though; why not make this a generalized vehicle mod and give cars and tanks their own horn too? (Triggered by the same button as trains are manually)

Also maybe a tickbox in the train's menu for whether or not you want this train to honk.

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

Posted: Sat Jul 16, 2016 5:00 am
by GotLag
More honking = more better

Updated the 0.13 mod to have per-locomotive cooldown, and fixed a bug whereby only one end of the train would honk, which was particularly noticeable on long trains. Now the forward-moving end honks on braking, and both ends honk on starting (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).

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

Posted: Sat Jul 16, 2016 5:35 am
by Optera
Please add a variable for volume control to control.lua file or add a config.lua for that.