Error updating mod for Factorio 2.0

Place to get help with not working mods / modding interface.
Keysivi
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Error updating mod for Factorio 2.0

Post by Keysivi »

There is a mod "The Ruins Mod" https://mods.factorio.com/mod/AbandonedRuins

Its author has disappeared and cannot be contacted.

I tried to update this mod myself for local use with Factorio 2.0 and Factorio: Space Age

An incomprehensible error occurred:

Code: Select all

   0.643 Loading mod settings AbandonedRuins 1.1.6 (settings.lua)
   0.646 Loading mod core 0.0.0 (data.lua)
   0.668 Loading mod base 2.0.12 (data.lua)
   0.888 Loading mod AbandonedRuins 1.1.6 (data.lua)
   0.897 Loading mod elevated-rails 2.0.12 (data.lua)
   0.926 Loading mod quality 2.0.12 (data.lua)
   0.940 Loading mod space-age 2.0.12 (data.lua)
   1.232 Loading mod base 2.0.12 (data-updates.lua)
   1.247 Loading mod quality 2.0.12 (data-updates.lua)
   1.269 Loading mod space-age 2.0.12 (data-updates.lua)
   1.429 Checksum for core: 1043092351
   1.429 Checksum of base: 3158838524
   1.429 Checksum of AbandonedRuins: 1924087029
   1.429 Checksum of elevated-rails: 4201662503
   1.429 Checksum of quality: 4264147466
   1.429 Checksum of space-age: 3246333523
   1.681 Error ModManager.cpp:1738: Error while loading item prototype "AbandonedRuins-claim" (selection-tool): Key "select" not found in property tree at ROOT.selection-tool.AbandonedRuins-claim
Modifications: The Ruins Mod
Please tell me - what is this error and how to fix it?
Xorimuth
Filter Inserter
Filter Inserter
Posts: 692
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Xorimuth »

https://github.com/tburrows13/factorio- ... ting-guide

Have you looked at the docs for selection tools in 2.0 and compared it to the 1.1 docs?

https://github.com/tburrows13/ModuleIns ... f9d76ad0c8 You might find this helpful.
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Keysivi
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Keysivi »

Thank you! I looked.

Unfortunately, the mod itself is non-standard... For example, I figured out the recipes myself.

And what is the error in this mod - it is not clear.

It has neither recipes nor images of units
Keysivi
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Keysivi »

It complains about
selection-tool
But the only file with this parameter is data.lua

Here is the code:

Code: Select all

local base_util = require("__core__/lualib/util")
data.raw["utility-constants"]["default"].default_other_force_color = base_util.copy(data.raw["utility-constants"]["default"].default_enemy_force_color)


data:extend
{
  {
    type = "selection-tool",
    name = "AbandonedRuins-claim",
    icon = "__AbandonedRuins__/graphics/AbandonedRuins-claim.png",
    icon_size = 64,
    stack_size = 1,
    selection_color = {1, 1, 1},
    alt_selection_color = {1, 1, 1},
    selection_mode = {"buildable-type", "not-same-force", "friend"},
    alt_selection_mode = {"any-entity", "not-same-force", "friend"},
    selection_cursor_box_type = "train-visualization",
    alt_selection_cursor_box_type = "train-visualization",
    always_include_tiles = true,
    flags = {"only-in-cursor", "spawnable"}
  },
  {
    type = "shortcut",
    name = "AbandonedRuins-claim",
    action = "spawn-item",
    icon =
    {
      filename = "__AbandonedRuins__/graphics/AbandonedRuins-claim-shortcut.png",
      size = 32
    },
    item_to_spawn = "AbandonedRuins-claim",
    associated_control_input = "AbandonedRuins-claim"
  },
  {
    type = "custom-input",
    name = "AbandonedRuins-claim",
    icon = "__AbandonedRuins__/graphics/AbandonedRuins-claim.png",
    icon_size = 64,
    key_sequence = "SHIFT + C",
    action = "spawn-item",
    item_to_spawn = "AbandonedRuins-claim"
  }
}
It is not clear where the error is
Bilka
Factorio Staff
Factorio Staff
Posts: 3309
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Error updating mod for Factorio 2.0

Post by Bilka »

Keysivi wrote: Wed Nov 13, 2024 9:04 am There is a mod "The Ruins Mod" https://mods.factorio.com/mod/AbandonedRuins

Its author has disappeared
Damn, I disappeared?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Keysivi
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Keysivi »

Bilka wrote: Wed Nov 13, 2024 10:00 am
Keysivi wrote: Wed Nov 13, 2024 9:04 am There is a mod "The Ruins Mod" https://mods.factorio.com/mod/AbandonedRuins

Its author has disappeared
Damn, I disappeared?
Hello, Bilka! I'm glad you wrote to me!

It's just that comments on your mod's page are disabled, and there was no response to such a request on github.com..

Your mods are very interesting.... If possible, please update them!!! That would be just great!!!

https://mods.factorio.com/mod/AbandonedRuins
https://mods.factorio.com/mod/ruin-maker
Bilka
Factorio Staff
Factorio Staff
Posts: 3309
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Error updating mod for Factorio 2.0

Post by Bilka »

All there was on github for ruins mod was people pointing out the obvious, that the mods dont work in 2.0.

It's possible to update the mods, but over the years (among other things) the rude and occasionally demanding behaviour of the users of my mods has placed maintaining them pretty low on my priority list.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Keysivi
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Keysivi »

Bilka wrote: Wed Nov 13, 2024 2:47 pm All there was on github for ruins mod was people pointing out the obvious, that the mods dont work in 2.0.

It's possible to update the mods, but over the years (among other things) the rude and occasionally demanding behaviour of the users of my mods has placed maintaining them pretty low on my priority list.
Unfortunately, haters are the bane of any more or less popular product. And the more popular the product, the more haters there are among users...

It's just sad when a good mod dies because of the inadequate behavior of individual commentators.
Keysivi
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Keysivi »

Xorimuth wrote: Wed Nov 13, 2024 9:37 am https://github.com/tburrows13/factorio- ... ting-guide

Have you looked at the docs for selection tools in 2.0 and compared it to the 1.1 docs?

https://github.com/tburrows13/ModuleIns ... f9d76ad0c8 You might find this helpful.
I poked around a bit with your links and made a couple of corrections:

was:

Code: Select all

selection_color = {1, 1, 1},
selection_cursor_box_type = "train-visualization",
selection_mode = {"buildable-type", "not-same-force", "friend"}, 
alt_selection_color = {1, 1, 1},
alt_selection_cursor_box_type = "train-visualization",
alt_selection_mode = {"any-entity", "not-same-force", "friend"},
became:

Code: Select all

  select = {
    border_color = { r = 1, g = 1, b = 1 },
    cursor_box_type = "train-visualization",  -- Green
    mode = {"buildable-type", "not-same-force", "friend"},
    entity_type_filters = {},
  },
  alt_select = {
    border_color = { r = 1, g = 1, b = 1 },
    cursor_box_type = "train-visualization",  -- Red
    mode = {"any-entity", "not-same-force", "friend"},
    entity_type_filters = {},
  },
The only thing is, it's not clear what exactly to specify in the entity_type_filters parameter? Since there is no such parameter in the original mod

However, another error immediately popped up:

Code: Select all

  14.549 Error ModManager.cpp:1738: Error while loading shortcut prototype "AbandonedRuins-claim" (shortcut): Value must be a string in property tree at ROOT.shortcut.AbandonedRuins-claim.icon
Modifications: The Ruins Mod
As I understand it, I should specify the location of the icons: subgroup = "", order = "" ... But I have no idea at all - how to write this...
Xorimuth
Filter Inserter
Filter Inserter
Posts: 692
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Xorimuth »

Keysivi wrote: Wed Nov 13, 2024 7:52 pm
Xorimuth wrote: Wed Nov 13, 2024 9:37 am https://github.com/tburrows13/factorio- ... ting-guide

Have you looked at the docs for selection tools in 2.0 and compared it to the 1.1 docs?

https://github.com/tburrows13/ModuleIns ... f9d76ad0c8 You might find this helpful.
I poked around a bit with your links and made a couple of corrections:

was:

Code: Select all

selection_color = {1, 1, 1},
selection_cursor_box_type = "train-visualization",
selection_mode = {"buildable-type", "not-same-force", "friend"}, 
alt_selection_color = {1, 1, 1},
alt_selection_cursor_box_type = "train-visualization",
alt_selection_mode = {"any-entity", "not-same-force", "friend"},
became:

Code: Select all

  select = {
    border_color = { r = 1, g = 1, b = 1 },
    cursor_box_type = "train-visualization",  -- Green
    mode = {"buildable-type", "not-same-force", "friend"},
    entity_type_filters = {},
  },
  alt_select = {
    border_color = { r = 1, g = 1, b = 1 },
    cursor_box_type = "train-visualization",  -- Red
    mode = {"any-entity", "not-same-force", "friend"},
    entity_type_filters = {},
  },
The only thing is, it's not clear what exactly to specify in the entity_type_filters parameter? Since there is no such parameter in the original mod

However, another error immediately popped up:

Code: Select all

  14.549 Error ModManager.cpp:1738: Error while loading shortcut prototype "AbandonedRuins-claim" (shortcut): Value must be a string in property tree at ROOT.shortcut.AbandonedRuins-claim.icon
Modifications: The Ruins Mod
As I understand it, I should specify the location of the icons: subgroup = "", order = "" ... But I have no idea at all - how to write this...
It’s all explained in the docs page for SelectionToolPrototype and ShortcutPrototype. The docs are linked in the “Important links” part of the 2.0 porting guide I sent you.

For quicker feedback you may also appreciate joining the #mod-dev-help channel in the official discord.
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Keysivi
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Keysivi »

Xorimuth wrote: Wed Nov 13, 2024 11:45 pm
It’s all explained in the docs page for SelectionToolPrototype and ShortcutPrototype. The docs are linked in the “Important links” part of the 2.0 porting guide I sent you.

For quicker feedback you may also appreciate joining the #mod-dev-help channel in the official discord.
Thanks for the tips! I honestly tried to understand all this documentation, but it turned out to be too complicated for me...

I'm not a programmer... I just understand the code a little...

Let's hope that the author of this mod will update his mod...

Sorry for bothering me...
Keysivi
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Keysivi »

Xorimuth wrote: Wed Nov 13, 2024 11:45 pm
It’s all explained in the docs page for SelectionToolPrototype and ShortcutPrototype. The docs are linked in the “Important links” part of the 2.0 porting guide I sent you.

For quicker feedback you may also appreciate joining the #mod-dev-help channel in the official discord.
I was able to figure out the shortcut...

was:

Code: Select all

  {
    type = "shortcut",
    name = "AbandonedRuins-claim",
    action = "spawn-item",
    icon =
    {
      filename = "__AbandonedRuins__/graphics/AbandonedRuins-claim-shortcut.png",
      size = 32
    },
    item_to_spawn = "AbandonedRuins-claim",
    associated_control_input = "AbandonedRuins-claim"
  },
became:

Code: Select all

  {
    type = "shortcut",
    name = "AbandonedRuins-claim",
    order = "b[blueprints]-d[AbandonedRuins-claim]",	
    action = "spawn-item",
    item_to_spawn = "AbandonedRuins-claim",
    -- localised_name = {"shortcut.AbandonedRuins-claim"},
    associated_control_input = "AbandonedRuins-claim"	
    icon = "__AbandonedRuins__/graphics/AbandonedRuins-claim-shortcut.png",
    icon_size = 32,
  },
But a new error appeared:

Code: Select all

 262.848 Error AppManagerStates.cpp:2653: Мод The Ruins Mod (1.1.6) caused a fatal error.
Please report this error to the mod author.

Error while running event AbandonedRuins::on_init()
__AbandonedRuins__/utilities.lua:112: attempt to index global 'global' (a nil value)
stack traceback:
	__AbandonedRuins__/utilities.lua:112: in function 'get_enemy_force'
	__AbandonedRuins__/control.lua:25: in function <__AbandonedRuins__/control.lua:24>
It complains about this code:

Code: Select all

utilities.lua
----------------------------------------------------------
81 -- Set cease_fire status for all forces.
82 util.set_enemy_force_cease_fire = function(enemy_force, cease_fire)
83   for _, force in pairs(game.forces) do
84     if force ~= enemy_force then
85       force.set_cease_fire(enemy_force, cease_fire)
86       enemy_force.set_cease_fire(force, cease_fire)
87     end
88   end
89 end
90 
91 -- Set cease_fire status for all forces and friend = true for all biter forces.
92 util.set_enemy_force_diplomacy = function(enemy_force, cease_fire)
93   for _, force in pairs(game.forces) do
94     if force.ai_controllable then
95       force.set_friend(enemy_force, true)
96       enemy_force.set_friend(force, true)
97     end
98   end
99   util.set_enemy_force_cease_fire(enemy_force, cease_fire)
100 end
101 
102 local function setup_enemy_force()
103   local enemy_force = game.forces["AbandonedRuins:enemy"] or game.create_force("AbandonedRuins:enemy")
104 
105   util.set_enemy_force_diplomacy(enemy_force, false)
106 
107   global.enemy_force = enemy_force
108   return enemy_force
109 end
110
111 util.get_enemy_force = function()
112   if (global.enemy_force and global.enemy_force.valid) then
113     return global.enemy_force
114   end
115   return setup_enemy_force()
116 end

Specifically:

Code: Select all

 
 
 112   if (global.enemy_force and global.enemy_force.valid) then
And about this code:

Code: Select all

control.lua
----------------------------------------------------------
24 local function init()
25   util.set_enemy_force_cease_fire(util.get_enemy_force(), not settings.global["AbandonedRuins-enemy-not-cease-fire"].value)
26   spawn_chances()
27   if global.spawn_ruins == nil then
28     global.spawn_ruins = true
29   end
30   global.ruin_queue = global.ruin_queue or {}
31   if not global.excluded_surfaces then
32     global.excluded_surfaces = {
33       ["beltlayer"] = true,
34       ["pipelayer"] = true,
35       ["Factory floor"] = true, -- factorissimo
36       ["ControlRoom"] = true -- mobile factory
37     }
38   end
39 end
Specifically:

Code: Select all

24 local function init()
25   util.set_enemy_force_cease_fire(util.get_enemy_force(), not settings.global["AbandonedRuins-enemy-not-cease-fire"].value)
This is a real disaster...
Pi-C
Smart Inserter
Smart Inserter
Posts: 1725
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Error updating mod for Factorio 2.0

Post by Pi-C »

Keysivi wrote: Thu Nov 14, 2024 6:36 am But a new error appeared:

Code: Select all

 262.848 Error AppManagerStates.cpp:2653: Мод The Ruins Mod (1.1.6) caused a fatal error.
Please report this error to the mod author.

Error while running event AbandonedRuins::on_init()
__AbandonedRuins__/utilities.lua:112: attempt to index global 'global' (a nil value)
stack traceback:
	__AbandonedRuins__/utilities.lua:112: in function 'get_enemy_force'
	__AbandonedRuins__/control.lua:25: in function <__AbandonedRuins__/control.lua:24>
'global' has been renamed to 'storage'. You may want to check the changelog for 2.0.7 (section 'Modding') and especially the post covering 'Scripting', which covers quite a lot of things that have changed between Factorio 1.1 and 2.0.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Keysivi
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Keysivi »

Pi-C wrote: Thu Nov 14, 2024 6:55 am 'global' has been renamed to 'storage'. You may want to check the changelog for 2.0.7 (section 'Modding') and especially the post covering 'Scripting', which covers quite a lot of things that have changed between Factorio 1.1 and 2.0.
Thank you!

It seems that for me, resuscitation of this mod is a fight with "windmills"...

I can't program... As long as it concerned substituting data into ready-made tables, I still understood something.

But editing user scripts is already a "dark forest" for me... The further, the scarier it becomes...

I substituted 'storage' instead of 'global'. Now another error has appeared...

I think it's time to finish... I'm a bad "Don Quixote"...
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3026
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by BlueTemplar »

Xorimuth wrote: Wed Nov 13, 2024 11:45 pm [...]
For quicker feedback you may also appreciate joining the #mod-dev-help channel in the official discord.
Please don't do that (and don't suggest that), aside from using Discord being unethical (especially if you're a developer !), this guarantees that any help that could have been provided is black-holed in the Deep Web, unable to be found on the Open Web by other people (notably, by those using search engines, and by The Internet Archive bots), and will disappear sooner or later.

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.)
Last edited by BlueTemplar on Thu Nov 14, 2024 11:41 am, edited 1 time in total.
BobDiggity (mod-scenario-pack)
Xorimuth
Filter Inserter
Filter Inserter
Posts: 692
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
Xorimuth wrote: Wed Nov 13, 2024 11:45 pm [...]
For quicker feedback you may also appreciate joining the #mod-dev-help channel in the official discord.
Please don't do that (and don't suggest that), aside from using Discord being unethical (especially if you're a developer !), this guarantees that any help that could have been provided is black-holed in the Deep Web, unable to be found on the Open Web by other people (notably, by those using search engines, and by The Internet Archive bots), and will disappear sooner or later.
Well… sure… but the level of handholding this user would need to get this mod ported is so great that I can’t see anyone willing to do it over this forum interface, whereas if they join the discord they stand an actual chance of getting the help that they need.

I don’t see this as a case of information locked behind discord (though there certainly _is_ plenty, both in and outside of factorio) - pretty much every piece of info you need is in the excellent modding docs, and for 2.0 specifically I put a lot of time into the public 2.0 porting guide I linked earlier which collates all the info you need in one place.
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: 3026
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by BlueTemplar »

That would be the «lore» part being blackholed, rather than (in this case) the «knowledge» part. (That shopkeeper metaphor seems to be also relevant here...)
BobDiggity (mod-scenario-pack)
Xorimuth
Filter Inserter
Filter Inserter
Posts: 692
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:46 am That would be the «lore» part being blackholed, rather than (in this case) the «knowledge» part.
Well I don’t exactly know what you mean about “lore” and I’m not sure I care. I guess we’ll have to agree to disagree. Not everything has to be available in perpetuity. 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…
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: 3026
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by BlueTemplar »

It's in the link, quite well written.

You can't possibly know what will be useful later, we all have blind spots, some things that might be obvious today (and therefore not said), might only be guessed later from additional clues (present in lore but not knowledge)...
BobDiggity (mod-scenario-pack)
Keysivi
Burner Inserter
Burner Inserter
Posts: 19
Joined: Mon Feb 07, 2022 5:29 pm
Contact:

Re: Error updating mod for Factorio 2.0

Post by Keysivi »

I think there is no point in arguing about the discord. Since I am not the developer of this mod.

When I raised this issue, I did not expect that the amount of adjustments would be so significant.

Unfortunately, my level of competence does not allow me to work with scripts. And forcing someone to do the work for me would be unethical. I am closing the topic.

I apologize to everyone for the inconvenience.
Post Reply

Return to “Modding help”