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
5 days ago
0.18 - 2.1
103K
Transportation Combat

g Factorio 2.1 Migration Proposal (Prerelease)

a month ago
(updated a month 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

a month ago
(updated a month 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.

a month 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

a month ago
(updated a month 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!

a month ago

Are there any news for the 2.1 upgrade? Really miss this mod!

a month ago

It's up now c:

a month ago

wonderful :)

15 days ago
(updated 15 days ago)

@twilightthepony
would you like to look into mod settings/startup and control the heli-braking-force value please?
despite the 2.1 change this setting is still with the old name and the default value does not work correctly.
For me it shows
"unknown key: mod-settings-name.heli-braking-force" with default value 1e+06

it is possible this is some error with my own 2.1 mod update, but even after full reset (files and options) it does not show the correct new "braking power" and a working-as-expected-value.

thank you

15 days ago

Yeah, that unknown key is pretty much missing in translation.

The braking force is translated from braking_force used to be a string (in MJ), so that is just a scientific notation for 1 MJ...

I forgot to update translations since this is a new key...

15 days ago

okay thank you i understood. yes its old translation there.

but i think the 1000*1000 (1e+06) default value is not optimal compared to old pre 2.1 default value feeling in braking.
i remembered your "divide by 60" tip and from old 1 MJ default i got to rounded 16000 or 17000 which feels like old default braking behavior in tests.
with 1.000.000 it instantly stops. Or am i wrong?

14 days ago

I am not sure, actually... When I tested stuff, the new values seemed to feel like the old ones, but I didn't do any super deep dives / extensive testings... HOWEVER!

I did look at the code, and saw two things:
Attack heli
( source: https://github.com/wolfhowlmedia/factorio-helicopters/blob/master/prototypes/entities/heli_entity.lua#L260 ) pulls the braking_force from settings, and the default setting is 1 MJ (not divided by 60)

But, scout heli's braking_force is hardcoded. Namely to (500 * 1000) / 60

(source: https://github.com/wolfhowlmedia/factorio-helicopters/blob/master/prototypes/entities/heli_scout.lua#L258 )

Does scout heli feels more like the pre-2.1 one?

13 days ago
(updated 13 days ago)

Hi,

i tested the scout vehicle and braking feels normal. 500 or 1000 * 1000 / 60 seems to be the correct default value in my opinion.
i put rounded 17000 for helicopter which is a bit more aggressive than the 16.666,6̅

Hi,

i tested the scout vehicle and braking feels normal. 500 or 1000 * 1000 / 60 seems to be the correct default value in my opinion.
i put rounded 17000 for helicopter which is a bit more aggressive than the 16.666,6̅

Yeah, default value is now changed to 1000 * 1000 / 60 (aka 16.666,6̅)

New response