Mod list sharing for the purpose of reporting issues with a mod

Looking for a mod? Have a review on a mod you'd like to share?
Post Reply
leeux
Inserter
Inserter
Posts: 34
Joined: Sat Oct 02, 2021 2:56 am
Contact:

Mod list sharing for the purpose of reporting issues with a mod

Post by leeux »

What's the best way to obtain a mod list of the active save, in a human readable format (i.e. that contains the mod names and not their site IDs, for example... or perhaps the names in addition to their IDs,) for issue reporting purposes?

Is there a way to dump the mod list while in-game via the console, for example? I haven't find any mention or questions related to this about this in my searches, but granted, didn't look at the wiki.

I usually just take the list from the current log, where the game dumps the mods as they are being loaded, but they are repeated in that list and it's hard to know where the repetitions start when you are using 100+ mods. Besides, some mods dump info in the middle of the loading process when makes it hard to follow and exactly find just the mods and not any extraneous stuff.

There's also the mod-list.json file, but I don't consider that human readable, and it doesn't contain the mod's name there... just their IDs.

You could just share the save file, I suppose... but reaching end-game the saves tend to bloat a bit, and it might not be convenient for a mod author to download a big file just to know the mods being used.

Best regards!

Xorimuth
Filter Inserter
Filter Inserter
Posts: 624
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Mod list sharing for the purpose of reporting issues with a mod

Post by Xorimuth »

leeux wrote:
Mon Aug 15, 2022 3:26 am
I usually just take the list from the current log, where the game dumps the mods as they are being loaded, but they are repeated in that list and it's hard to know where the repetitions start when you are using 100+ mods. Besides, some mods dump info in the middle of the loading process when makes it hard to follow and exactly find just the mods and not any extraneous stuff.
Yeah there's no easy way to work around this in order to provide a simple text list.
leeux wrote:
Mon Aug 15, 2022 3:26 am
You could just share the save file, I suppose... but reaching end-game the saves tend to bloat a bit, and it might not be convenient for a mod author to download a big file just to know the mods being used.
Definitely this, or create a new save with exactly the same modset and share that. Then the person you're reporting it too can very easily sync their mods with the save (and the downloading now happens in parallel so it is very fast!).
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

leeux
Inserter
Inserter
Posts: 34
Joined: Sat Oct 02, 2021 2:56 am
Contact:

Re: Mod list sharing for the purpose of reporting issues with a mod

Post by leeux »

Xorimuth wrote:
Mon Aug 15, 2022 3:40 am
leeux wrote:
Mon Aug 15, 2022 3:26 am
<snip>
Definitely this, or create a new save with exactly the same modset and share that. Then the person you're reporting it too can very easily sync their mods with the save (and the downloading now happens in parallel so it is very fast!).
Good point! I honestly didn't thought of that! I'll keep it in mind for the next time I need to report an issue. Thanks for the idea!

For the moment I took the list from the log and used Notepad++ to clean it up a bit and posted it on pastebin and shared that.

EDIT: removed misplaced text

robot256
Filter Inserter
Filter Inserter
Posts: 596
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Mod list sharing for the purpose of reporting issues with a mod

Post by robot256 »

Space Exploration Postprocess uses code to log all the active mods and their versions in an easy-to-read section of the log. One could write a console command to do the same thing, or even write it to a separate file in the script-output folder.

leeux
Inserter
Inserter
Posts: 34
Joined: Sat Oct 02, 2021 2:56 am
Contact:

Re: Mod list sharing for the purpose of reporting issues with a mod

Post by leeux »

robot256 wrote:
Mon Aug 15, 2022 2:59 pm
Space Exploration Postprocess uses code to log all the active mods and their versions in an easy-to-read section of the log. One could write a console command to do the same thing, or even write it to a separate file in the script-output folder.
Thank you for the tip! Gonna have it in mind for next time... I can't play SE on my current hardware, but I can certainly download it and check the code!

User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 489
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: Mod list sharing for the purpose of reporting issues with a mod

Post by Silari »

leeux wrote:
Mon Aug 15, 2022 6:25 pm
robot256 wrote:
Mon Aug 15, 2022 2:59 pm
Space Exploration Postprocess uses code to log all the active mods and their versions in an easy-to-read section of the log. One could write a console command to do the same thing, or even write it to a separate file in the script-output folder.
Thank you for the tip! Gonna have it in mind for next time... I can't play SE on my current hardware, but I can certainly download it and check the code!
Just need to loop over the mods variable - it is a dictionary with all the loaded mods in it.

Code: Select all

for name, version in pairs(mods) do
  log(name .. " version " .. version)
end
Only downside is the calling mod is added into the log. You could write it to a separate file using game.write_file, but that only works during the control stage (ie when a game is loaded) so it may be problematic to use if a mod is preventing the game from loading.

leeux
Inserter
Inserter
Posts: 34
Joined: Sat Oct 02, 2021 2:56 am
Contact:

Re: Mod list sharing for the purpose of reporting issues with a mod

Post by leeux »

Silari wrote:
Mon Aug 15, 2022 11:29 pm
leeux wrote:
Mon Aug 15, 2022 6:25 pm
<snip>

Just need to loop over the mods variable - it is a dictionary with all the loaded mods in it.

Code: Select all

for name, version in pairs(mods) do
  log(name .. " version " .. version)
end
Awesome! Thank you very much for that code snippet! I'd put it to good use, if I can, next time the need arises. I'd assume you could also type it in the console using /c, right?
Silari wrote:
Mon Aug 15, 2022 11:29 pm
Only downside is the calling mod is added into the log. You could write it to a separate file using game.write_file, but that only works during the control stage (ie when a game is loaded) so it may be problematic to use if a mod is preventing the game from loading.
Gotcha, understand. Yeah, if the issue is too severe, I'd normally just attach the factorio-current.log (or post a link to gdrive containing it!) and only explicitly name the mods I think are responsible, or that the game said caused the issue.

Meanwhile, during these past days I found that using a regular expression of the form:

Code: Select all

"Loading mod .* \(data\.lua\)$"
to the contents of the factorio-current.log, matches just one stage of the loading and produces a list that contains no repetitions and no extraneous stuff.

I match the "data" stage in this case because I felt it was the "normal" loading state, where the mod proper is being loaded... the other two are pre- and post-, I think... correct me if I'm wrong on this! So that would produce a more correct list w.r.t the order of the mods being loaded, in case that matters.

Thank you again for the reply!

robot256
Filter Inserter
Filter Inserter
Posts: 596
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Mod list sharing for the purpose of reporting issues with a mod

Post by robot256 »

It's possible for a mod to be missing any or all of data.lua, data-updates.lua, or data-final-fixes.lua. If the mod only has control.lua, it won't show up in the data stage at all but will show up in the control stage initialization (when loading a save).

Pi-C
Smart Inserter
Smart Inserter
Posts: 1647
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Mod list sharing for the purpose of reporting issues with a mod

Post by Pi-C »

leeux wrote:
Tue Aug 16, 2022 5:41 pm
Silari wrote:
Mon Aug 15, 2022 11:29 pm
Just need to loop over the mods variable - it is a dictionary with all the loaded mods in it.

Code: Select all

for name, version in pairs(mods) do
  log(name .. " version " .. version)
end
Awesome! Thank you very much for that code snippet! I'd put it to good use, if I can, next time the need arises. I'd assume you could also type it in the console using /c, right?
Nope, not quite. The console is available only in the control stage, but "mods" exists only during the data stage. In the control stage, you must read "script.active_mods" instead.
robot256 wrote:
Tue Aug 16, 2022 6:05 pm
It's possible for a mod to be missing any or all of data.lua, data-updates.lua, or data-final-fixes.lua. If the mod only has control.lua, it won't show up in the data stage at all but will show up in the control stage initialization (when loading a save).
It's even possible that a mod contains nothing but info.json, so it wouldn't ever show up! Granted, such a mod wouldn't do anything at all. (@leeux: It would be useless on its own, and should never be uploaded to the mod portal!) But if you have such a mod installed locally, you could use it like a flag:

Code: Select all

if mods["my_empty_mod"] then
	do_stuff()
else
	do_other_stuff()
end
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

leeux
Inserter
Inserter
Posts: 34
Joined: Sat Oct 02, 2021 2:56 am
Contact:

Re: Mod list sharing for the purpose of reporting issues with a mod

Post by leeux »

Thank you all for the replies!

I managed to make the code posted by @Silari (with further caveat added by Pi-C) work in the console,

Code: Select all

/c for name, version in pairs(script.active_mods) do
  log(name .. " version " .. version)
end
When executed from the console, this printed to the log the list of active mods... I was confused at first because I kinda expected it to print something in the console too, but then when I looked inside the factorio-current.log I saw the list of mods, here's minimal a excerpt of what printed in my case:

Code: Select all

4072.930 Script for name, version in pairs(script.active_mods) do   log(name .. " version " .. version) end:1: base version 1.1.61
4072.930 Script for name, version in pairs(script.active_mods) do   log(name .. " version " .. version) end:1: rusty-locale version 1.0.16
4072.930 Script for name, version in pairs(script.active_mods) do   log(name .. " version " .. version) end:1: simhelper version 1.1.4
4072.930 Script for name, version in pairs(script.active_mods) do   log(name .. " version " .. version) end:1: WideChests version 4.0.2
4072.930 Script for name, version in pairs(script.active_mods) do   log(name .. " version " .. version) end:1: aai-containers version 0.2.11
4072.930 Script for name, version in pairs(script.active_mods) do   log(name .. " version " .. version) end:1: aai-signal-transmission version 0.4.7
4072.930 Script for name, version in pairs(script.active_mods) do   log(name .. " version " .. version) end:1: aai-signals version 0.6.1
4072.930 Script for name, version in pairs(script.active_mods) do   log(name .. " version " .. version) end:1: aai-vehicles-chaingunner version 0.6.1
4072.930 Script for name, version in pairs(script.active_mods) do   log(name .. " version " .. version) end:1: aai-vehicles-flame-tank version 0.5.1
Thanks again!

Pi-C
Smart Inserter
Smart Inserter
Posts: 1647
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Mod list sharing for the purpose of reporting issues with a mod

Post by Pi-C »

leeux wrote:
Wed Aug 17, 2022 4:02 am
I was confused at first because I kinda expected it to print something in the console too
You can do that by using game.print() instead of log(). This will print just the mod names and versions, without prepending each line of output with the command. Then again, you can't copy/paste text from the console …
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Post Reply

Return to “Questions, reviews and ratings”