Brave New World

by canidae

RTS-like scenario for Factorio. Player character is removed, all work must be done by bots

Scenarios
2 years ago
0.16 - 1.1
8.12K

i PyAlienLife compatbility

3 years ago

May you add support for Pyanodons AlienLife? In this mod, All farm machines need a sample in the module slot. The type of those samples is "module". The following part is a quick fix and works for me:

elseif item.type == "module" or string.match(name, ".*module.*") then
    -- allow modules
    return count
3 years ago

You mean the name contains the word 'module'. I'll look into it. I'm really interested as to what their item.type field is.

3 years ago

The original code from brave-new-world/scenarios/bnw/control is:

-- where player = game.players[event.player_index]
-- where name = player.cursor_stack.name, count = player.cursor_stack.count
function itemCountAllowed(name, count, player)
local item = game.item_prototypes[name]
local place_type = item.place_result and item.place_result.type
if ...
-- some code here
elseif string.match(name, ".module.") then
-- allow modules
return count
-- some codes here
end
return 0
end

The example code from pyalienlife/prototypes/items/items is:

-- This module can only be use in sap-extractor
ITEM {
type = "module",
name = "tree-mk01",
category = "tree",
tier = 1,
subgroup = "py-alienlife-modules",
effect = { speed = {bonus = 0.4}},
limitation = alien_life_limitations_tree
}

thx

New response