Biteorio


Farm bugs for resources, researching to help them grow

Overhaul
10 months ago
1.1
354
Combat Environment

i Spit collector

10 months ago
(updated 10 months ago)

Very cool idea, brings a risk / reward mechanic to Factorio. I have a suggestion, I think it will fit your mod quite well.

The idea is to have a building that's purpose is to be attacked by biters. It should have a lot of armor such that it requires a group biters / spitters to attack it, not just one biter. When the building is damaged by biters (or perhaps destroyed, depends on what is possible to implement) it generates a liquid (biter spit or whatever) that can be processed to sulfuric acid for example.

The challenge of course is that the player wants as many biters as possible attacking the collector without killing them too much and without them getting out of control, but he also needs to protect the infrastructure around it.

10 months ago

Not a bad idea, but I dont feel it fits the theme I'm going for, and tbh I don't know how I would implement it

10 months ago
(updated 10 months ago)

If you think this does not fit the theme it's fine, but if you change your mind here is an example of a storage tank that fills with sulfuric acid every time an enemy tries to damage it with acid. It is also immune to acid damage (but not physical or other). The harder the hit the more acid is generated.

The implementation is straight-forward (it does not involve any workarounds or hacks) and should not hit the performance too much because the event filtering for the correct damage type is done by the Factorio engine, not in lua.

data.lua:

local recipe = {
    type = 'recipe',
    name = 'spit-collector-recipe',
    enabled = true,
    ingredients = { {'storage-tank', 1} },
    result = 'spit-collector-item',
}

local item = {
    type = 'item',
    name = 'spit-collector-item',
    localised_name = 'Spit collector',
    stack_size = 50,
    place_result = 'spit-collector-entity',
    icon = "__base__/graphics/icons/storage-tank.png",
    icon_size = 64,
    icon_mipmaps = 4,
    subgroup = "storage",
}

local entity = table.deepcopy(data.raw['storage-tank']['storage-tank'])
entity.name = 'spit-collector-entity'
entity.is_military_target = true -- to make it a high priority target for biters
entity.item_to_place_this = { 'spit-collector-item' }
entity.minable.result = 'spit-collector-item'
entity.max_health = 1000
entity.resistances = {{ type = 'acid', percent = 100 }}

data:extend{item, entity, recipe}

control.lua:

function on_entity_damaged(event)
    if not event.force or event.force.name ~= 'enemy' then 
        -- Prevent players from filling the container themselves
        return
    end

    -- fill the tank with acid, scaling with the damage amount
    event.entity.insert_fluid{ 
        name = 'sulfuric-acid',
        amount = event.original_damage_amount
    }
end

script.on_event(defines.events.on_entity_damaged, on_entity_damaged,
{
    {
        filter = 'name',
        name = 'spit-collector-entity',
    },
    {
        filter = 'damage-type',
        type= 'acid',
        mode = 'and',
    }
})
9 months ago

oooh super cool
I might do smt with it, but no promises

New response