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
10 days ago
0.18 - 2.1
105K
Transportation Combat

b Settings not working for scout helicopter

3 days ago

The settings for weight, acceleration power (consumption) and braking force all work for the helicopter, but only the one for weight is applied to the scout helicopter (with a 0.5x factor). I figure that the rest ought to apply in a scaled fashion as well (perhaps with a factor of 0.3125x for consumption and 0.5x for braking force?).

Yeah, the values for scout are fixed... Maybe a separate option would be better than relying on scaling? Let user decide and stuff?

2 days ago
(updated 2 days ago)

Separate settings would not be bad! Although, if you create such settings, you might want to expose the main effectivity property as well to lessen confusion. I would simultaneously set the effectivity property within energy_source to 1 (normal for Factorio) and adjust other values accordingly. Startup settings with equivalent values might then look like this:

Scout helicopter weight: 1400
Scout helicopter braking force: 8333.33
Scout helicopter active fuel consumption: 1333.33kW
Scout helicopter acceleration efficiency: 0.375
Helicopter weight: 2800
Helicopter braking force: 16666.66
Helicopter active fuel consumption: 6400kW
Helicopter acceleration efficiency: 0.2

The code might look like this:

-- Helicopter:
{
    weight = settings.startup["heli-weight"].value, -- 2800
    effectivity = settings.startup["heli-effectivity"].value, -- 0.2
    consumption = settings.startup["heli-consumption"].value, -- 6400kW (1280kW accel.)
    braking_force = settings.startup["heli-braking-force"].value, -- 16666.66
    energy_source = {
        effectivity = 1,
    },
}

(By the way, I prefer to greatly increase the breaking force on the helicopters so they are more fun to use. 25000/50000 feels about right to me.)

Tip: If you want to automatically scale the parameters of the scout helicopter without adding new settings, you can use Factorio's in-built util.parse_energy(energy) function for the consumption property (which takes a string value) to do that. It might look like this with a neat 1:4 ratio:

-- Scout helicopter:
{
    consumption = util.parse_energy(settings.startup["heli-consumption"].value) * 60 / 4 .. "W", -- 1600kW
}

... My response got a bit long, but I wanted to be precise when talking about code!

[EDIT]: Fixed typos.

Yeah, that should work... Should be updated shortly...

I really don't like how the braking force values changed. Ugh.

(deleted your [duplicate] post c: )

2 days ago

All right! (Yeah, I was wondering about the braking force too, which seemed unusually particular...)

New response