I don't think I need to explain this mod. It adds freaking helicopters to the game!
Name: Helicopters Description: Adds a fully animated attack helicopter to the game. Ideal for getting from A to B quickly, exploring the map, building islands and nuking biters from the sky. License: MIT Version: 0.2.16 Factorio Version: 0.16.x Category: Transportation Author: Kumpu Downloads:Mod portal Github:https://github.com/kumpuu/factorio-helicopters
Long description
Tired of walking or waiting for trains? This quality mod adds a helicopter to the game.
Comes with custom animations and sounds, a machine gun, a rocket launcher, heli pads and a remote control.
The energy consumption is very high, so rocket fuel is recommended for max flight time and speed.
To start the engine, press Shift+E. To stop and land, press Shift+Q. You can also change these controls in the settings.
You can increase the flight height by using the up and down arrows.
The remote control works by placing it in your armor grid, a small button will appear in the top left corner that opens the remote gui.
Adds a new research that you have to unlock before you can build it.
Ideal for getting from A to B quickly, exploring the map, building islands and nuking biters from the sky.
You might wonder why it's called "Helicopters", when it only adds one model of heli to the game. Well, guess what, you can build multiple ones. There you go, helicopters
It also allows me to add more models if I decide to, without having to change the name.
0.2.16: Added mute button to gauge gui. Updated russian translation (thanks to @Schmarotzer). Fixed that players could dispatch a heli (Shif+F) without remote equipment. Fixed graphical errors in 0.16.37 (thanks to @Carnivale).
0.2.15: Updated russion locals (thanks to @Schmarotzer). Added italian locals (thanks to @marxx). Deal damage to passengers in crashes and explosions (damage multiplier in settings). Added setting to prevent remote auto-landing when player inside. Heli selection gui now auto-selects last selected heli when opened. Fixed error when heli destroyed by high speed landing. Fixed error when changing runtime-global setting.
0.2.14: Added animated instrument pannel that shows fuel, speed, height and engine rpm. Configurable in settings. Added optional fuel alert, activate in settings. Removed obsolete "pushable" flags. Fixed that player gets trapped when exiting heli while Bob's Character classes is installed (thanks to @jarquafelmu).
0.2.13: Added russian translation (thanks to @IgorLutiy). Added Shift+F hotkey to send nearest heli to player. Added Shift+G hotkey to open remote gui. Added default zoom settings for heli and helipad guis. Fixed crash when heli destroyed while under remote control (thanks to @Rynvar). Reactivate all inserters when heli destroyed, set all newly built inserters to active to prevent zombies (thanks to @tekin).
0.2.12: Added german translation (thanks to @ST-DDT). Fixed error when mining heli pad that was built in 0.15.
0.2.11: Deactivate nearby inserters while flying (configurable in settings).
0.2.10: Optimized map marker refresh code. Marker sorting during refresh skipped past certain treshold to avoid having to rebuild gui. Fixed sort func callback bug in markerSelectionGui (thanks to @tanuki_san and @M1r_k0).
0.2.9: Added search field to map marker gui (enable auto focus in settings). Added tooltips to guis. Added release months to changelog (thanks to @SuicidalKid).
0.2.8: Fixed error when heli destroyed while having a driver (thanks to @LuziferSenpai).
0.2.7: Added changelog.txt. Fixed nil value and metatable bugs (thanks to @LuziferSenpai).
0.2.6: 0.16 compatibility. Changed landed collider to new custom collider that ejects trapped players and should work much nicer with inserters. Added belt immunity.
0.2.5: Compatibility update for "New Game+" mod.
0.2.5: Compatibility update for "New Game+" mod.
0.2.4: Decreased heli pad selection box size, to ensure that a landed helicopter is always selectable. Made heli recipe more expensive.
0.2.3: Added floodlight. Press Shift+L to activate at night.
0.2.2: remote control will cancel when targeted player enters heli. fixed bug with metatables.
0.2.1: fixed bug when loading save
0.2.0: Added remote control for helis. Added heli pads. Switched to state based model for helis which results in much cleaner code. General code refactoring. Changed default controls to Shift+E and Shift+Q for up/down (will note change if you had a previous version installed), due to an issue where you could not move up and down while placing ghosts.
0.0.6: Fixed issue with trains stopping. Increased turret rotation speed. Fixed that fuel level can go into negative when hovering. Partial fix for inserters accessing wrong entity.
0.0.5: Compatibility update for Vehicle Grid mod.
0.0.4: Small fix that prevents a glitch when mining a helicopter while not having enough inventory space.
0.0.3: Fixed loading error with AAI mod. Heli will consume fuel at all times when in air. Fixed excessive pollution.
0.0.2: Updated short description. Heli will land if you jump out of it.
Known Issues
Known Issues
Looks pretty weird on the map. This is because it consists of up to 7 entities at the same time, some of them spinning, which are required as workarounds due to the limitations of the modding system.
Landed collider and smoke may be slightly out of place.
No rear rotor and gun turret animation, to be honest you'll hardly notice it.
You can land on water. However you can't exit the helicopter. If you mine it while above water, you die instantly.
Belts will move the heli around even in air.
You may get stuck when exiting the helicopter before it is fully landed. Simply enter and exit the vehicle again to get freed.
No damage by nukes.
Inserters won't insert if built after the heli.
Inserters can take items while in flight.
1-frame micro stutters when flying over certain things. My guess is it's some kind of glitch in the collision system.
Probably some other minor things I forgot.
Phew, that's quite a list. All of this is due to limitations of the modding API, and/or the fact that I haven't discovered the necessary trick yet. If you know a fix to any of this, please let me know!
License
License
MIT License
Copyright (c) 2017 kumpuu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Re: [MOD 0.15] Helicopters
Posted: Thu Jul 06, 2017 11:08 pm
by Supercheese
Get to da choppah!
Nice mod, some intense coding shenanigans to get things to animate the way you want to!
Re: [MOD 0.15] Helicopters
Posted: Fri Jul 07, 2017 7:45 am
by kumpu
Supercheese wrote:Get to da choppah!
Nice mod, some intense coding shenanigans to get things to animate the way you want to!
Thanks and yeah, I had to get pretty creative in abusing entities...
Re: [MOD 0.15] Helicopters
Posted: Wed Jul 12, 2017 11:15 am
by chridder
Hi,
could it be that the default key binding (SHIFT+W and SHIFT+S) conflicts with vanilla settings?
My problem is, that in the past it was possible to hold down shift + w to place items in ghost mode while walking.
Since 0.15.xx it does not work anymore. Now it came to my mind, that with 0.15.xx I started a new game including your mod.
If it is the case, a different default key binding might be a good idea.
I will test (a different key binding) as soon as I am back in the game (hopefully today evening) and give an update.
Greetings,
Chridder
Re: [MOD 0.15] Helicopters
Posted: Wed Jul 12, 2017 3:16 pm
by kumpu
The key bindings are set to non-consume, which means they shouldn't block anything. But since we don't live in a perfect world were everything works as expected, its still possible they're causing this behaviour. Let me know what you find out! Also, maybe try a new map without the mod in the first place.
Re: [MOD 0.15] Helicopters
Posted: Wed Jul 12, 2017 8:53 pm
by chridder
ok, I just tested it again.
It is not caused by your mod.
I am also not sure right now, if this happens all the time, that I cannot walk and place items in ghost mode at the same time.
Right now, it works perfectly fine. And I have changed nothing in factorio since yesterday where it was not working (no mod changes, no update, etc)
Just now I think it has nothing to do with factorio at all ...
But thanks for quick response!
Re: [MOD 0.15] Helicopters
Posted: Sun Jul 16, 2017 5:43 am
by cpy
Is it multiplayer safe?
Re: [MOD 0.15] Helicopters
Posted: Sun Jul 16, 2017 3:30 pm
by kumpu
cpy wrote:Is it multiplayer safe?
Didn't test it personally, but I saw a video of some guys using it on a server with no problems. So I'd say yes.
Re: [MOD 0.15] Helicopters
Posted: Wed Jul 19, 2017 10:26 pm
by kumpu
As suggested by kyoshiharu (mod portal), this version includes a remote control equipment item that lets you control your helicopters. Once you place it in your armor grid, a button will appear in the left top corner where you can access the remote gui.
It's not yet finished but I'd like some feedback. I fixed every issue I could find, but this was a pretty complicated piece of work. So if someone is interested - please give it a try and let me know if you have any problems. I'm sure there are some left. If you do, make a post here and please don't forget to include information on how to reproduce it. If you have any suggestions, let me know
How to use:
Imo it's pretty self-explanatory. Things to mention are that left clicking the to-player button will let the heli follow you, while shift-clicking will send it to your CURRENT position. Right clicking the top of any window will close it.
remote.png (795.24 KiB) Viewed 20837 times
Re: [MOD 0.15] Helicopters
Posted: Thu Jul 20, 2017 7:17 am
by chridder
looks interesting... as soon as I have some time I will give it a try
Re: [MOD 0.15] Helicopters
Posted: Thu Jul 20, 2017 1:48 pm
by Termak
kumpu wrote:The key bindings are set to non-consume, which means they shouldn't block anything. But since we don't live in a perfect world were everything works as expected, its still possible they're causing this behaviour. Let me know what you find out! Also, maybe try a new map without the mod in the first place.
Having the same issue, got fixed by changing the keybindings though, might be caused due to the even distribution mod.
Another thing though, this eats a lot of ups, anyway to reduce it?
Re: [MOD 0.15] Helicopters
Posted: Thu Jul 20, 2017 1:57 pm
by kumpu
chridder wrote:looks interesting... as soon as I have some time I will give it a try
Thanks!
Termak wrote:
kumpu wrote:The key bindings are set to non-consume, which means they shouldn't block anything. But since we don't live in a perfect world were everything works as expected, its still possible they're causing this behaviour. Let me know what you find out! Also, maybe try a new map without the mod in the first place.
Having the same issue, got fixed by changing the keybindings though, might be caused due to the even distribution mod.
Another thing though, this eats a lot of ups, anyway to reduce it?
What are ups? Units per second? Updates per second?
Re: [MOD 0.15] Helicopters
Posted: Thu Jul 20, 2017 2:23 pm
by Termak
Nevermind the ups thing, i meant updates obviously, its not that bad.
About the mod, the current heli is a bit on the overpowered side compared to how easy its to get.
Propably should have some basic one for passenger use only at current tech level and higher research like with hitec and military bottles for the Apache.
Re: [MOD 0.15] Helicopters
Posted: Fri Jul 21, 2017 10:34 pm
by kumpu
Termak wrote:
About the mod, the current heli is a bit on the overpowered side compared to how easy its to get.
Propably should have some basic one for passenger use only at current tech level and higher research like with hitec and military bottles for the Apache.
Valid point, and I might do that in the future.
That is if I can find a good free model, because I suck at 3D modelling...
Re: [MOD 0.15] Helicopters
Posted: Sun Jul 23, 2017 11:31 am
by zumf
This is an amazing mod, Kumpu! It's incredible how superior this is to the other current flying vehicle mods.
I really hope you'll continue with this, and as others have suggested, make some variations (a more basic, slower, more lightly armed and armoured one, perhaps a cargo helicopter)
I read that you'd like some help producing the 3d models? I model in Blender, and think I can match the Factorio art-style - Just the materials and render settings I need to study. I'll have a play around and get back to you if I make anything decent!
Re: [MOD 0.15] Helicopters
Posted: Sun Jul 23, 2017 3:02 pm
by kumpu
zumf wrote:This is an amazing mod, Kumpu! It's incredible how superior this is to the other current flying vehicle mods.
I really hope you'll continue with this, and as others have suggested, make some variations (a more basic, slower, more lightly armed and armoured one, perhaps a cargo helicopter)
I read that you'd like some help producing the 3d models? I model in Blender, and think I can match the Factorio art-style - Just the materials and render settings I need to study. I'll have a play around and get back to you if I make anything decent!
Thank you very much!
If you could make a model that would be really awesome
Render settings I can do, but make sure to keep spinning parts as separate pieces. Also anything that is not aligned with the main z axis is very difficult to animate, since then you need to take the rotation of the body into account. For example the current models rear rotor - to get it animated you'd have to basically do 64 (body rotation frame count) different sets of animations and worry about draw order... Just not worth the effort imho.
But yeah let me know if you made anything, or if you have questions.
Re: [MOD 0.15] Helicopters
Posted: Sun Jul 23, 2017 5:29 pm
by Optera
I really like where this mod is going and I'd have replaced planes with it if not for some annoying effects.
When landing in WE orientation the fake entity remains in NS orientation creating an invisible wall just south of the Heli.
The heli collision box in this orientation seems to be too far south for the sprite.
When the entities overlap it confuses my Inventory Sensor making fully automated refueling bays impossible.
I could add an exception, but frankly I don't see what you even need that fake entity with collision box for.
2017-07-23-19-20-02-5349563.jpg (72.87 KiB) Viewed 20703 times
I'd make the Heli's collision box match it's sprite better by changing it's size to 2x4 and get rid of the fake entity or at least make it have a 0,0 collision and selection box.
2017-07-23-19-39-08-4154970.jpg (74.3 KiB) Viewed 20703 times
Re: [MOD 0.15] Helicopters
Posted: Sun Jul 23, 2017 6:21 pm
by kumpu
Optera wrote:
When landing in WE orientation the fake entity remains in NS orientation creating an invisible wall just south of the Heli.
Yup, that's a bug. Didn't consider that create_entity does not support orientation. Fixed it, thanks!
Optera wrote:
The heli collision box in this orientation seems to be too far south for the sprite.
Yeah they don't quite match, even with that fix. Same for selection box. Has to do with the center of rotation for the model, either that or I'm too stupid. I figured it was good enough so meh.
Optera wrote:When the entities overlap it confuses my Inventory Sensor making fully automated refueling bays impossible.
I could add an exception, but frankly I don't see what you even need that fake entity with collision box for.
That sounds a lot like the trouble I had/have with inserters you mentioned on the mod portal. I got so far as to make it work except if you build a new inserter, and then you can get around that by starting and landing again.
Why bother with a fake collision entity? Because I want collision, obviously. Sadly I couldn't find a way to toggle it for a given entity (which is kinda important when flying), that's why it has to be a separate entity. Ugly, but Wube is to blame for that
The entire mod is just a giant workaround to get what I want... So perfection is difficult to achieve, but if you or anyone knows how to improve on things.. Let me know and I'll include it in the next version.
Re: [MOD 0.15] Helicopters
Posted: Sun Jul 23, 2017 7:50 pm
by Optera
kumpu wrote:
Optera wrote:
The heli collision box in this orientation seems to be too far south for the sprite.
Yeah they don't quite match, even with that fix. Same for selection box. Has to do with the center of rotation for the model, either that or I'm too stupid. I figured it was good enough so meh.
It's one of those tiny details that takes a bit of tinkering, but goes a long way to make something feel polished.
kumpu wrote:
Optera wrote:When the entities overlap it confuses my Inventory Sensor making fully automated refueling bays impossible.
I could add an exception, but frankly I don't see what you even need that fake entity with collision box for.
That sounds a lot like the trouble I had/have with inserters you mentioned on the mod portal. I got so far as to make it work except if you build a new inserter, and then you can get around that by starting and landing again.
Why bother with a fake collision entity? Because I want collision, obviously. Sadly I couldn't find a way to toggle it for a given entity (which is kinda important when flying), that's why it has to be a separate entity. Ugly, but Wube is to blame for that
The entire mod is just a giant workaround to get what I want... So perfection is difficult to achieve, but if you or anyone knows how to improve on things.. Let me know and I'll include it in the next version.
I wouldn't be surprised if Inserter internally call LUAsurface.find_entity to get pickup and drop targets.
I think having inserters and find_entity properly reporting the real entity is more important than hitting your head at the proper distance, if at all. For example until testing just now I never noticed planes have no collision at all .
In any case the fake entity should always be at least 0.5, better 1.0, inside the real entity collision box so the real entity is found before the fake, or better yet the fake is not found at all with a range of 1 tile.
PS:
It's impressive how well you managed to work around the limitations of the API.
Re: [MOD 0.15] Helicopters
Posted: Tue Jul 25, 2017 3:11 am
by kumpu
Optera wrote:
kumpu wrote:
Optera wrote:
The heli collision box in this orientation seems to be too far south for the sprite.
Yeah they don't quite match, even with that fix. Same for selection box. Has to do with the center of rotation for the model, either that or I'm too stupid. I figured it was good enough so meh.
It's one of those tiny details that takes a bit of tinkering, but goes a long way to make something feel polished.
Agreed.
Optera wrote:
kumpu wrote:
Optera wrote:When the entities overlap it confuses my Inventory Sensor making fully automated refueling bays impossible.
I could add an exception, but frankly I don't see what you even need that fake entity with collision box for.
That sounds a lot like the trouble I had/have with inserters you mentioned on the mod portal. I got so far as to make it work except if you build a new inserter, and then you can get around that by starting and landing again.
Why bother with a fake collision entity? Because I want collision, obviously. Sadly I couldn't find a way to toggle it for a given entity (which is kinda important when flying), that's why it has to be a separate entity. Ugly, but Wube is to blame for that
The entire mod is just a giant workaround to get what I want... So perfection is difficult to achieve, but if you or anyone knows how to improve on things.. Let me know and I'll include it in the next version.
I wouldn't be surprised if Inserter internally call LUAsurface.find_entity to get pickup and drop targets.
I think having inserters and find_entity properly reporting the real entity is more important than hitting your head at the proper distance, if at all. For example until testing just now I never noticed planes have no collision at all .
In any case the fake entity should always be at least 0.5, better 1.0, inside the real entity collision box so the real entity is found before the fake, or better yet the fake is not found at all with a range of 1 tile.
PS:
It's impressive how well you managed to work around the limitations of the API.
Yeah I tried playing around with the collider size before, didn't do anything tho... I'll try it again some time, maybe I can get it to work. I also thought about mirroring the real inventory in the fake one, and when a change is detected it would sync them. That's complicated and prone to glitching tho, also not very efficient.
Another idea is to use an entity that doesn't have an inventory in the first place, so inserters won't even consider it. Of course then it can't be rotated but eh. Maybe do two version for NS/WE.
Also, thanks