Lex's Aircraft

by lexsus

Your attention is presented to the futuristic VTOL aircraft that are well suited to the style of the game. The mod includes aircraft: transport, light combat, heavy combat.

Content
11 months ago
1.1
31.6K
Transportation Combat

b Dependency on space science?

1 year, 9 months ago

Is it intended that the heavy combat aircraft tech depends on space science but doesn’t actually require any space science to research?

P.S. https://mods.factorio.com/mod/SpidertronPatrols/discussion/62d06080c3132d49100aceff in case you missed it :p

1 year, 9 months ago

Hello! Great question, actually with the latest Space Exploration update I'm confused )
I don't even know what science packages to give these planes. I plan to make an update on time with minor fixes and if there are suggestions for changes in scientific packages, I will be happy to listen)

I also wanted to disable the placement of aircraft in space and make a separate mod with spacecraft, but did not figure out how to disable the placement of my entities in space) I still do not lose hope of doing this. I already have a graphic. Gotta do something about it)

1 year, 9 months ago
(updated 1 year, 9 months ago)

Patched together from space-exploration's data.lua and prototype/phase-3/space-collision.lua, untested :)

if mods["space-exploration"] then
  local collision_mask_util_extended = require("__space-exploration__/collision-mask-util-extended/data/collision-mask-util-extended")
  local space_collision_layer = collision_mask_util_extended.get_make_named_collision_mask("space-tile")
  prototype.collision_mask = collision_mask_util_extended.get_mask(prototype)
  collision_mask_util_extended.add_layer(prototype.collision_mask, space_collision_layer)
  data_util.collision_description(prototype)
end
1 year, 9 months ago

Spacecraft sounds great, looking forward to it!
I don't particularly have suggestions for science packs, I just thought it was strange to lock the heavy aircraft behind space science if it doesn't require space science to research the actual tech.

1 year, 9 months ago

Thank you very much for the space tip. But I'm all over the place as to how to use it. I can't ><. I will investigate further.

1 year, 9 months ago

I can have a proper go later today, I’ve got a lot of experience with space exploration compatibility, which certainly isn’t easy!

1 year, 9 months ago
(updated 1 year, 9 months ago)

Got it :D

Add this to the bottom of data.lua (or in a separate file)

if mods["space-exploration"] then
    local collision_mask_util_extended = require("__space-exploration__/collision-mask-util-extended/data/collision-mask-util-extended")
    local data_util = require("__space-exploration__/data_util")
    local space_collision_layer = collision_mask_util_extended.get_make_named_collision_mask("space-tile")

    local names = {"lex-flying-cargo", "lex-flying-gunship", "lex-flying-heavyship"}

    for _, name in pairs(names) do
        local prototype = data.raw["spider-vehicle"][name]
        prototype.collision_mask = collision_mask_util_extended.get_mask(prototype)
        collision_mask_util_extended.add_layer(prototype.collision_mask, space_collision_layer)

        for _, leg_specification in pairs(prototype.spider_engine.legs) do
            local leg_prototype = data.raw["spider-leg"][leg_specification.leg]
            leg_prototype.collision_mask = collision_mask_util_extended.get_mask(leg_prototype)
            collision_mask_util_extended.add_layer(leg_prototype.collision_mask, space_collision_layer)
            collision_mask_util_extended.add_layer(leg_prototype.collision_mask, "colliding-with-tiles-only")
        end

        data_util.collision_description(prototype)  -- Adds "Cannot be placed on..." to tooltip
    end
end

And add a optional hidden dependency on space-exploration in info.json:

    "(?) space-exploration"
1 year, 9 months ago

Let me know if you want help with the spacecraft mod, feel free to send it to me and I can help you out. Or contact me on Discord: TomB#1249

1 year, 9 months ago
(updated 1 year, 9 months ago)

Hmm actually my solution isn't perfect as now you can't place aircraft on top of ground buildings that can't be placed in space.
Fixed by adding the "colliding-with-tiles-only" line in.

1 year, 9 months ago

Amazing, it works! Exactly, he also has legs :D I think I understand how it works ). Thanks a lot!

1 year, 8 months ago

thanks guys! it's really cool to see this kind of collaboration :)

New response