What is the easiest method to create a mod bundle?

Place to get help with not working mods / modding interface.
Post Reply
admo
Inserter
Inserter
Posts: 27
Joined: Tue Jun 28, 2016 1:07 am
Contact:

What is the easiest method to create a mod bundle?

Post by admo »

I'm playing on a multiplayer server with some friends, in order to ease things for everyone I thought to bundle all our mods into a single mod. Once I got started though things just kept spiraling in hackery so I thought to come here and see what lua experts thought on the topic.

My first thought was to place all the mods into a sub folder, "mods", and require() their data.lua files in the real data.lua. But then it started to get wonky via relative paths. Am I going at this the worst possible way? Perhaps I should just merge all the mods and concatenate all same-named files.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: What is the easiest method to create a mod bundle?

Post by DaveMcW »

admo wrote:Perhaps I should just merge all the mods and concatenate all same-named files.
You only get one script.on_init() call per mod, after that it overwrites the previous one. Same with all other script.* functions. So you will have to do some merging anyway.

admo
Inserter
Inserter
Posts: 27
Joined: Tue Jun 28, 2016 1:07 am
Contact:

Re: What is the easiest method to create a mod bundle?

Post by admo »

DaveMcW wrote:
admo wrote:Perhaps I should just merge all the mods and concatenate all same-named files.
You only get one script.on_init() call per mod, after that it overwrites the previous one. Same with all other script.* functions. So you will have to do some merging anyway.
Seems I should give up on the cleverness and just give them a zipped mod folder.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: What is the easiest method to create a mod bundle?

Post by bobingabout »

that's definitely easier.

Merging mods together (which can actually be a violation of some of the mod licences) is quite the modding job. you need to merge control.lua so all scripts with the same name are one big script... and this is actually the easy part.

you'll need to find all references in all the data files to directories "__bobplates__/" would be a directory example, and change them all to the name of your new mod, then make sure the directories all point to the right place.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

admo
Inserter
Inserter
Posts: 27
Joined: Tue Jun 28, 2016 1:07 am
Contact:

Re: What is the easiest method to create a mod bundle?

Post by admo »

bobingabout wrote:that's definitely easier.

Merging mods together (which can actually be a violation of some of the mod licences) is quite the modding job. you need to merge control.lua so all scripts with the same name are one big script... and this is actually the easy part.

you'll need to find all references in all the data files to directories "__bobplates__/" would be a directory example, and change them all to the name of your new mod, then make sure the directories all point to the right place.
I went ahead with the zipped mod folder plan, but I came across some oddity I didn't understand. While doing the "mods" subfolder inside my bundle mod's directory structure:

Code: Select all

%appdata%
--factorio
----mods
------admo_bundle-0.0.1
--------mods
----------autofill
----------squeak_through
I tried then having admo_bundle's control.lua use this:

Code: Select all

local savedPath = package.path
package.path = "../mods/autofill/?.lua"
require("data") --intended to force the load of autofill's data.lua over the admo_bundle's data.lua
package.path = savedPath
But admo_bundle's data.lua ended up recursively loading itself, is the package.path not used in Factorio?

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: What is the easiest method to create a mod bundle?

Post by darkfrei »

It will be good, when you have all script events in the control.lua, but they are have only one handler function per sub_mod.
If you have the second sub_mod, then you are need to add new handler function and choose which folder it have.

Pandemoneus
Fast Inserter
Fast Inserter
Posts: 127
Joined: Fri May 08, 2015 2:25 pm
Contact:

Re: What is the easiest method to create a mod bundle?

Post by Pandemoneus »

Another way would be to share a savegame and let people click the "sync mods with savegame" button. Then it will prompt them to download all the mods from the mod portal. You would also have to ship the mod-settings file too if you changed ingame settings.
My RSO+Bob's+Angel's modpack: Farlands (outdated)
Mods (current): Resource Labels
Mods (old): Biter Spires

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: What is the easiest method to create a mod bundle?

Post by steinio »

In general mod packs suck hard because at the moment they are published they are outdated if one of the included mods are updated.
At any point of time the uploader abandone the pack and all users complain of bugs not fixed anymore or complain about bugs in the mod pack for what the uploader is not responsible for...

A link list with all recommended mods would be easier to maintain.

ModMyFactory(viewtopic.php?f=137&t=33370) provides ModPack files but i'm no expert for this tool.

Greetings, steinio.
Image

Transport Belt Repair Man

View unread Posts

admo
Inserter
Inserter
Posts: 27
Joined: Tue Jun 28, 2016 1:07 am
Contact:

Re: What is the easiest method to create a mod bundle?

Post by admo »

steinio wrote:In general mod packs suck hard because at the moment they are published they are outdated if one of the included mods are updated.
At any point of time the uploader abandone the pack and all users complain of bugs not fixed anymore or complain about bugs in the mod pack for what the uploader is not responsible for...

A link list with all recommended mods would be easier to maintain.

ModMyFactory(viewtopic.php?f=137&t=33370) provides ModPack files but i'm no expert for this tool.

Greetings, steinio.
The pack wouldn't be published, it's just to help some people who have not played with mods before, while also helping me who does play with mods and I update my mods for my own games. The zip seemed easiest, I can swap the mod folders in my %appdata% path for whichever games I'm playing.

foodfactorio
Filter Inserter
Filter Inserter
Posts: 454
Joined: Tue Jun 20, 2017 1:56 am
Contact:

Re: What is the easiest method to create a mod bundle?

Post by foodfactorio »

Hi one of the things i did with a friend, for us to play co-op together, was to simply test all the mods locally to see if they work ok, and then to copy and paste them to his Dropbox folder... then he just copies and pasted them into his mods folder, overwriting what was there.

with the exception of about 9 mods that i added recently, all of these seem to play together very nicely:
(based on an initial bundle of angels and bobs from an earlier arumba pack) :)
listed here in case you fancy a look:
viewtopic.php?f=95&t=40288&start=20#p290313
(also me from the mod portal - im not dustine lol) = https://mods.factorio.com/mods/Dustine/ ... ssion/9108
my 1st Mod Idea :) viewtopic.php?f=33&t=50256

Post Reply

Return to “Modding help”