Chopper

by ElAdamo

Get to da choppa!

Content
3 years ago
0.17 - 0.18
22
Transportation

b 1.1 Compatibility

3 years ago

I decided to play around with this mod and see if I could make it compatible with 1.1. I've had some success so far, but there may well be other issues. Here's what I changed.

The game version has changed, so I updated info.json line 10 to say "factorio_version": "1.1"

The "Turrets" technology was renamed to "Gun_Turret" in 1.1. I updated data.lua line 14 to say prerequisites = {"automobilism", "advanced-electronics-2", "gun-turret", "rocketry"},

The way Factorio handles the Mod GUI has changed. "mod_gui" is no longer a global variable and so can't be "required." Instead, I changed this to a local variable definition at class header. Called the new local variable "mod_gui" so that existing code calls to the legacy "required" variable will be able to call the local one, instead. I updated control.lua line 2 to say local mod_gui = require("mod-gui"). I updated gaugeGui.lua, adding a new line at the start of the file which says local mod_gui = require("mod-gui"). I also added an empty line before the reSetGaugeGui(p) method for basic code readability, which shifted all code in the file 2 lines down.

With these changes, the mod appears to load correctly, the Chopper spawns correctly and can be boarded, flown, landed and interacted with, the gauges appear to work correctly and I've seen no further errors. I need to stress that I have NOT dug very deeply into the code so my changes may be superficial or break things further down the line in silent ways. However, I believe the issues were mostly due to changed syntax, so changing the turret technology name and defining mod_gui as a local variable should retain legacy functionality in full. If there are other issues, I wouldn't know about them.

3 years ago

No, that's pretty much what's needed for Factorio 1.1. I commited pretty much the same thing a while ago here: https://github.com/wolfhowlmedia/factorio-helicopters/commit/da916a8a7cc2918305497b6d322d9231067360df (this is my fork of Helicopters)

3 years ago

Thank you :) I originally went with this mod as it's a somewhat stripped-down, "lighter" version of the original without autopilot and helipads and such, but I'll go with whichever one works at this point. Surprised I caught it all, though, as I'm broadly unfamiliar with Factorio's Lua code and mostly went with whatever errors the game tripped. Thanks for keeping it alive - the helicopter mod is a pretty nifty one.

2 years ago

Thanks for the updates. I am going to try to update all my mods now so I will take note of this.

2 years ago
(updated 2 years ago)

That would be excellent, thank you. This is my favourite version of the Helicopter mod because it comes without the additional complexity of automation which I generally don't want. The heli is my personal long-hauler. I'm still using it in 1.1 with the above changes :)

2 years ago

There is a multiplayer bug in this mod going back to last year that I still haven't figured out. So when I do update this it will likely only be considered stable for single player. Just keep that in mind.

2 years ago

Would that take the form of random disconnects and out-of-sync issues? I recall something like that from years ago. Very well - even if it's single-player-only, I'm still fine with it, as long as it works :) Out of curiosity - is that bug also present with the other "Helicopter" forks?

2 years ago

Yes, it causes a desync. It can sometimes be fixed with the "/fixchoppa" admin command, which will regenerate the helicopters. I plan to fix it but my job keeps me very busy. I'm not sure if it's present in the others because I haven't used them in so long. All of us use the same general framework but I've refactored it a lot.

2 years ago

Best of luck in getting it working, then. I really like this mod and would like to keep using it. If I can only use it in single player, then so be it. Obviously, it would better if it worked in multiplayer but you do what you can :) I'm pretty sure people would be happy to have it whenever you have time to get to it.

2 years ago

We use it for multiplayer so that's my end goal. Well actually my real end goal is to remove the scripting framework and recreate the chopper using the spidertron model. I think it will work -- I have plans. I'm working on my mods this week so I'll be sending out updates when I think they're ready.

New response