Error updating mod for Factorio 2.0

Place to get help with not working mods / modding interface.
Xorimuth
Filter Inserter
Filter Inserter
Posts: 709
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Xorimuth »

BlueTemplar wrote: Thu Nov 14, 2024 11:34 am P.S.: It's also isn't the official Discord (thankfully), and the way they have just decreed themselves to be «the» Factorio Discord chatroom (rather than «[insert group's name here]'s Discord chatroom» or something) is unseemly.
(I heard the founders are the moderators of «the» Factorio subreddit ? — same issue here BTW.)
Sorry, yes you are right, I should have said "the main Factorio discord". The discord and the subreddit are solely community run and Wube employees have no moderation say in either. (And yes, the discord originated from the subreddit, has overlap in moderators, and was at one point known as the '/r/factorio discord server').

However, they are both linked from the homepage of factorio.com and on https://factorio.com/support/contact:
Some of the team members also browse and comment on the Unofficial /r/factorio Subreddit and /r/factorio Discord server.
Wube staff regularly interact on them, they have developer flairs, and they run bots which automatically post update announcements and things to both.
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3234
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by BlueTemplar »

Thanks, also I forgot to add about this :
And for something like porting mods from 1.1 to 2.0, I don’t think anyone will care to trawl through some handholding on this topic in 5 years time…
It's also for people trying to update them right now (or in these next few weeks) — in case Keysivi would have agreed to be taken through those many subsequent steps that have been hinted at, and did it here, this would also have helped other potential beginning modders with similar issues that might have stumbled on this discussion.
BobDiggity (mod-scenario-pack)
Keysivi
Fast Inserter
Fast Inserter
Posts: 108
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Keysivi »

I tried to return to the reanimation of this mod but reached the point where the brain is completely dislocated:

Here is the first error:

Code: Select all

The mod The Ruins Mod (1.1.6) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event AbandonedRuins::on_tick (ID 0)
Unknown collision-layer name: item-layer
stack traceback:
	[C]: in function 'count_tiles_filtered'
	__AbandonedRuins__/spawning.lua:152: in function 'clear_area'
	__AbandonedRuins__/spawning.lua:175: in function 'spawn_ruin'
	__AbandonedRuins__/spawning.lua:189: in function 'spawn_random_ruin'
	__AbandonedRuins__/control.lua:58: in function <__AbandonedRuins__/control.lua:53>
He complains about this:

Code: Select all

local function clear_area(half_size, center, surface)
  local area = util.area_from_center_and_half_size(half_size, center)
  -- exclude tiles that we shouldn't spawn on
  if surface.count_tiles_filtered{ area = area, limit = 1, collision_mask = {"item-layer", "object-layer"} } == 1 then
     return false
  end
  for _, entity in pairs(surface.find_entities_filtered({area = area, type = {"resource"}, invert = true})) do
    if (entity.valid and entity.type ~= "tree") or math.random() < (half_size / 14) then
      entity.destroy({do_cliff_correction = true, raise_destroy = true})
    end
  end
  return true
end
Here is the fix:

Code: Select all

local function clear_area(half_size, center, surface)
  local area = util.area_from_center_and_half_size(half_size, center)
  -- exclude tiles that we shouldn't spawn on
  if surface.count_tiles_filtered{ area = area, limit = 1, collision_mask = {layers = {item = true, object = true}} } == 1 then
     return false
  end

  for _, entity in pairs(surface.find_entities_filtered({area = area, type = {"resource"}, invert = true})) do
    if (entity.valid and entity.type ~= "tree") or math.random() < (half_size / 14) then
      entity.destroy({do_cliff_correction = true, raise_destroy = true})
    end
  end

  return true
end
Second error:

Code: Select all

The mod The Ruins Mod (1.1.6) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event AbandonedRuins::on_tick (ID 0)
Invalid CollisionLayerIdentification: expected LuaCollisionLayerPrototype or string.
stack traceback:
	[C]: in function 'count_tiles_filtered'
	__AbandonedRuins__/spawning.lua:152: in function 'clear_area'
	__AbandonedRuins__/spawning.lua:170: in function 'spawn_ruin'
	__AbandonedRuins__/spawning.lua:184: in function 'spawn_random_ruin'
	__AbandonedRuins__/control.lua:58: in function <__AbandonedRuins__/control.lua:53>
What am I doing wrong?!!! :-x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x :x
Post Reply

Return to “Modding help”