The Ruins Mod 2.0


This mod is based on 1.1.6 (abondoned mod?) and contains many fixes for Factorio 2.0. The Ruins Mod adds randomly spawns ruins in the world. These ruins are destroyed fragments of bases, forts, small oases, and more. Explore them for loot, adventure, or entertainment, but beware, some still have running defenses from the last player that landed on the planet, with more successful colonies having better defenses.

Content
13 days ago
2.0
1.56K
Environment

b Boxes not filling with items

a month ago
(updated a month ago)

Caused by improperly checking if item names are valid in spawning.lua lines: 75-84
instead of prototypes[name] you need to check prototypes.item[name], additionally local prototypes is set earlier to prototypes.entity so finally you can deal with both by using _G['prototypes'].item[name]
Original mod was skipping over invalid items instead of aborting.
If skipping items is implemented there can be 0 items to insert.
You could replace:

if not prototypes[name] then
        util.debugprint("item '" .. name .. "' does not exist")
        return
      end
      local count = expressions.number(count_expression, vars)
      if count > 0 then
        items[name] = count
      end
    end
    util.safe_insert(e, items)

with:

if not _G['prototypes'].item[name] then
        util.debugprint("item '" .. name .. "' does not exist")
        log("item '" .. name .. "' does not exist")
      else
        local count = expressions.number(count_expression, vars)
        if count > 0 then
          items[name] = count
        end
      end
    end
    if not (next(items) == nil) then
      util.safe_insert(e, items)
    end
a month ago

I added it and will release it with next (1.1.14) release. Thank you, my knowledge in LUA is limited so I depend on others to help me out. I just wanted to have this running again.

a month ago

1.1.15 removes the return keyword. Need to go to work.

a month ago
(updated a month ago)

All parentheses are needed here if not (next(items) == nil) then otherwise it does operations out of order and straight up doesn't work as result.
With changes here and line 38 in other topic the mod seems to work fine (at least without Space Age): no crashes, assemblers can have recipes, boxes have items.

This thread has been locked.