HelicopterRevival


Adds two fully animated helicopters to the game. Ideal for getting from A to B quickly, exploring the map, building islands and nuking biters from the sky. Originally forked from Kumpu with fixes for Factorio 0.18.2+, but adding some enhancements of my own as well. NOW also includes API for other mod authors to register their own helicopters!

Content
a month ago
0.18 - 2.0
102K
Transportation Combat

g Factorio 2.1 Migration Proposal (Prerelease)

12 days ago
(updated 12 days ago)

Hello,

i tried a migration to 2.1.
https://github.com/perahoky/factorio-helicopters-migrate2-1/commit/f6c2306ea467c941b16d7277acf91ad546c905a7
You can use it as kickoff or redo it.
I used AI support and my brain.

since this modd is still actively supported, i wont create a migration-mod.
I could create a PR if you like.

Who wants to use the prerelease-update (be aware of version number!), just download from github.
https://github.com/perahoky/factorio-helicopters-migrate2-1/releases

breaking changes i am aware off:

  • Done: Removed VehiclePrototype::braking_power, friction. Use braking_force, friction_force instead.
  • Done: entity.active renamed to "disabled_by_script"
  • Braking Force settings is now a double. No migration was implemented. AI wanted to parse it, but i removed that. The values were wrong anyway. probably that has to be improved, bu i am not sure about the best approach. For my uses its good enough ....

Issues:
- /logic/heliBase.lua::1015
i had crashes with "burner.currently_burning.name.fuel_value" but the crash dissappeared and i cant reproduce it anymore. and i cant find a matching braking change. and no obvious reason.
- braking values were changed. its similar but not exactly same as before. somehow old 1kw is not 1000w in new property.
- settings are not migrated. not sure if thats neccessary. probably another better approach?

Cu
Pera

12 days ago
(updated 12 days ago)

Thanks, but most of the stuff you've mentioned it's already fixed in my repository, namely in factorio-2.1 branch. So it's pretty much ready-to go, but awaiting for a second look from my partner-in-crime.

Repo changes are here, if you're interested: https://github.com/wolfhowlmedia/factorio-helicopters/commit/c118110a6c4559db7d64198edf6e530800509cb8

To answer your other issues:
- I really don't understand the crash on burner_value... Any way you can elaborate on it? 'Cause from what I saw in the documentation, there was no changes from the previous versions of Factorio; Energy usage is still a string / energy value
- I think (or at least from what I saw in some other mod) is that you need to divide braking force by 60.
- Settings for braking-force and friction-force are actually written anew. I figured it's better that way since the old parameter was a string and the new one is double / number.

And thanks for pointing out about the "entity.active"... I completely missed that...

2.1 compatibility should be out in a few days, no matter how you slice it c:

Thanks again!

Edit: Just a heads-up! Don't put .bat files into your package... It'll be rejected by Factorio mod portal. and I can't blame them about it, given it might be an actual security risk. Reference to my previous encounter of this: https://github.com/wolfhowlmedia/factorio-helicopters/commit/153e9642357100d6c2d10fb4eebd7c6e4aa1505d

Edit2: Also, I said this before, but I'm not going to accept AI code into this repository.

12 days ago

hi,

thank you. i was not aware of the branch and did not search for it =)

  • fuel_value issue in heliBase.lua::1015:
    after my changes, in scenario editor, the game crashed when i deployed, entered and started the helicopter.
    1) applied factorio2.1 migration changes (braking_force, friction_force, settings, disabled_by_script), build package and load into game
    2) start scenario editor, give test-items to a chest (helicopter, fuel, ammo, inserter ...)
    3) start scenario
    4) place helicopter, fill with items (fuel, ammo)
    5) enter helicopter (g button for me)
    6) start helicopter. In first tests with same code i got a crash, but cant reproduce it now. error text:
    "
    The mod HelicopterRevival 0.7.0 caused a non-recoverable error.
    error while running event HelicopterRevival::on_tick (ID 0)
    HelicopterRevival/logic/heliBase.lua:1015: attempt to perform arithemtic on field 'fuel_value' (a nil value)
    stack traceback:
    HelicopterRevival/logic/heliBase.lua:1015: in function "getFuelFullness"
    HelicopterRevival/logic/heliBase.lua:1026: in function "handleFuelConsumption"
    HelicopterRevival/logic/heliBase.lua:275: in function "OnTick"
    HelicopterRevival/logic/heliBase.lua:549: in function "OnTick"
    HelicopterRevival/logic/util.lua:122 in function "checkAndTickInGlobal"
    HelicopterRevival/control.lua:174: in function
    <HelicopterRevival/control.lua:173>
    "
    The crash cannot be reproduced now. Dont know why, after a few experiments it just vanished. I've reset the experimental-fix-code.
    i've played with my current version several hours but will soon switch to yours when inserters-disable is live =)

  • AI: With great power comes great responsibility. I know and experience your concern in company too. I just asked the AI to find and fix the factorio2.1 relevant spots. i dont upload non-reviewed random AI code. In this case the AI code is almost 100% same as required for the migration. So AI is not always poison, it depends on the person who uses the tool. But dont understand my statement as a discussion. :)

  • Setting-name: Yeah i was not sure if i can just remove and replace a old/new setting ...

Thank you. Love this mod since 2017.

cu

12 days ago
(updated 12 days ago)

Hm.... definitely interesting crash... Something that absolutely shouldn't happen... 'cause:

    if burner.currently_burning then
        full_value = burner.currently_burning.name.fuel_value * burner.currently_burning.name.stack_size * #burner.inventory
    end

Certainly something to keep an eye on... Maybe odd one out, bur we'll see what happens...

--

AI: I'm well versed in pros and cons of AI stuff... I just don't want it in my open-source projects... There are 2 reasons for it: 1) If it's a complex project, you have no idea where the code came from... If it's something complex, you can get in trouble if there's proprietary code in your project. 'Cause the AI gobblers gobble everything, regardless if the code is patented or not. The other one is, that you basically forefit the thinking to AI... I just like to know what is where and what does what. And yes, even I like to hand over the mundane jobs to AI. "I want you to build me a form with error-checking for 100 of these fields!"

--

Thank you. Love this mod since 2017.

I agree! Kumpu did a phenomenal job with it!

New response