Page 1 of 2

[MOD 0.11.20] Upgrade with construction robots - v1.0.3

Posted: Fri Apr 10, 2015 5:13 pm
by kds71
Download mod for version 0.13: https://mods.factorio.com/mods/Slayer15 ... de-planner


Note: If you are using Factorio 0.12.x, you can find updated version of this mod here.

Mod adds a new item and recipe (unlocked with Automated Construction technology): Upgrade Planner - now fully configurable!

It looks like deconstruction planner (except it is yellow instead of red) and works in similar way: you can mark an area and entities in this area will be upgraded (or downgraded) to different entities, according to your configuration.

Recipes set in Assembling Machines are preserved while upgrading.

Since version 1.0.1 multiple rulesets may be stored and restored, so you can easily switch between them. More info below.

Note 1: Mod should work properly in multiplayer now, but there is one minor quirk: if more than one player has an upgrade planner in their hand (or one player has an upgrade planner and another one has a deconstruction planner), the planner will do nothing. Sorry for the inconvenience, but it is impossible to resolve it in different way currently. I don't have means to test this mod in multiplayer right now, if you do and you find any bugs, please report them :)

Note 2: This mod requires Factorio version 0.11.20 or higher, because of this bug that has been fixed in 0.11.20.

Note 3: Since version 1.0.0 interface for other mods to add new rules has been totally removed. Right now it is not needed at all, since players can setup their own rulesets using GUI.

Mod has been inspired by this post on reddit.

Before using upgrade planner, you must configure it using button displayed in top-left corner on the screen (button will appear once you discover Automated Construction technology). Configuration is explained below.
Demo - mod in action
In game configuration
Changelog
Special thanks to

Re: [MOD 0.11.20] Upgrade with construction robots

Posted: Fri Apr 10, 2015 5:59 pm
by waduk
Wow,..just wow...i haven't test this, since i'm on a break playing factorio. Based on the premise alone, this is a must have mod !
IMO this is a serious contender for the dev to natively support this feature in vanilla.

And it already happen with other mod (pocket construction bot), kovarex says there's a chance a similar feature will be added someday in the future :
Source :
https://forums.factorio.com/forum/vie ... =30#p75937

Re: [MOD 0.11.20] Upgrade with construction robots

Posted: Fri Apr 10, 2015 6:33 pm
by Alvin853
Is it possible for other mods to define their own set of upgrade rules? For example additional types of belts, or different mining drills, whatever people want to mod really... This could take off like a rocket.

Re: [MOD 0.11.20] Upgrade with construction robots

Posted: Fri Apr 10, 2015 6:50 pm
by KrzysD
You just made the most asked for mod ever, Thank you for this! I bet the Factorio team will implement this at one point. :D :D :D

Re: [MOD 0.11.20] Upgrade with construction robots

Posted: Fri Apr 10, 2015 6:52 pm
by kds71
Alvin853 wrote:Is it possible for other mods to define their own set of upgrade rules? For example additional types of belts, or different mining drills, whatever people want to mod really... This could take off like a rocket.
Hm yeah, I think it should be possible. I just have to move list of upgrade definitions to some globally accessible variable, then other mods should be able to add new rows to this table easily. Well, there is still a chance that there is an item that can't be easily upgraded because it requires some special action upon placing (like assembling machines require recipe to be restored), but in most cases it should be fine.

Re: [MOD 0.11.20] Upgrade with construction robots

Posted: Fri Apr 10, 2015 9:52 pm
by Vitduo
What about inserted modules in assemblers to be upgraded?

Re: [MOD 0.11.20] Upgrade with construction robots

Posted: Fri Apr 10, 2015 10:47 pm
by kds71
Vitduo wrote:What about inserted modules in assemblers to be upgraded?
I might be wrong, but I think it is not possible to put a module into assembling machine with robots :(

Re: [MOD 0.11.20] Upgrade with construction robots

Posted: Sat Apr 11, 2015 1:49 am
by MasterBuilder
This looks like it marks old entities for destruction. Could you make a planner that removes anything in the way?
Or more specifically, two variants:
1: Mark anything in the way of the BP for removal.
2: Mark everything not in the BP for removal.

I didn't know we could mod BPs. Are these even possible and would you be interested in making them?

Re: [MOD 0.11.20] Upgrade with construction robots

Posted: Sat Apr 11, 2015 3:34 am
by darkshadow1809
Awh heck yeh! This is freakin cool. Mind if i throw it in both modpacks :o?

Re: [MOD 0.11.20] Upgrade with construction robots

Posted: Sat Apr 11, 2015 9:35 am
by kds71
MasterBuilder wrote:This looks like it marks old entities for destruction. Could you make a planner that removes anything in the way?
Or more specifically, two variants:
1: Mark anything in the way of the BP for removal.
2: Mark everything not in the BP for removal.

I didn't know we could mod BPs. Are these even possible and would you be interested in making them?
My upgrade planner is based on the deconstruction planner, not the blueprint. I don't think it is possible to make a blueprint that removes something, but I will investigate that and let you know if I find something :)
darkshadow1809 wrote:Awh heck yeh! This is freakin cool. Mind if i throw it in both modpacks :o?
I don't mind at all! However, this is an early version and I'm going to fix some stuff and improve it, so maybe it is better idea to wait a bit?

Re: [MOD 0.11.20] Upgrade with construction robots

Posted: Sat Apr 11, 2015 9:44 am
by darkshadow1809
kds71 wrote:
MasterBuilder wrote:This looks like it marks old entities for destruction. Could you make a planner that removes anything in the way?
Or more specifically, two variants:
1: Mark anything in the way of the BP for removal.
2: Mark everything not in the BP for removal.

I didn't know we could mod BPs. Are these even possible and would you be interested in making them?
My upgrade planner is based on the deconstruction planner, not the blueprint. I don't think it is possible to make a blueprint that removes something, but I will investigate that and let you know if I find something :)
darkshadow1809 wrote:Awh heck yeh! This is freakin cool. Mind if i throw it in both modpacks :o?
I don't mind at all! However, this is an early version and I'm going to fix some stuff and improve it, so maybe it is better idea to wait a bit?
No need :P i update the modpack weekly if urgent daily. What better to throw it in the big public? see what bugs come out and see what ideas might come suggested :D

Re: [MOD 0.11.20] Upgrade with construction robots

Posted: Sat Apr 11, 2015 1:45 pm
by kds71
As requested, I uploaded new version of mod, which exposes interface that allows other mods to add upgrade rules to ruleset. More info in first post in this topic. Big thanks to DaveMcW for the tip!

Edit: And another update - I realized that if you enable mod and load save game in which you had Automatic Construction researched already, you would not get recipe for Upgrade Planner unlocked. It is now fixed in v0.1.4.

Re: [MOD 0.11.20] Upgrade with construction robots

Posted: Mon Apr 13, 2015 7:06 am
by kds71
Big update! Now mod provides GUI which allows you to configure upgrade rules! You can for example upgrade yellow belts directly to blue ones or exclude some type of item from upgrading. More details in first post in this thread.

Another update: stone furnaces can be now upgraded to steel furnaces and basic inserters to fast inserters.

Re: [MOD 0.11.20] Upgrade with construction robots - v0.1.7

Posted: Mon Apr 13, 2015 1:44 pm
by SHiRKiT
Can players create rules themselves without need to go to the code? Like upgrading modded buildings?

Re: [MOD 0.11.20] Upgrade with construction robots - v0.1.7

Posted: Mon Apr 13, 2015 2:02 pm
by kds71
SHiRKiT wrote:Can players create rules themselves without need to go to the code? Like upgrading modded buildings?
Edit: Meh, I worded that poorly. Let me rephrase what I wrote before:

Currently there are there are three ways to add new upgrade rule to ruleset:

1. Execute this code in console, replacing " my-entity-1" with name of entity you want to upgrade and "my-entity-2" with name of entity you want to be a replacement:

Code: Select all

remote.call("replacer_interface", "add_rule", "my-entity-1", { "my-entity-2" })
This method is not recommended because you will have to execute this code every time you load / start a new game.

2. Unzip replacer mod file, find control.lua, open it in any text editor (windows notepad will suffice) and find this code:

Code: Select all

replacer_ruleset["basic-inserter"] = { "fast-inserter" }
Copy it and paste it below, then modify names to suit your needs (change "basic-inserter" to name of entity you want to upgrade and change "fast-inserter" to name of entity you want to be a replacement).

3. The best method - open control.lua file in mod that adds buildings you want to have in the ruleset and add following code somewhere (replacing "my-entity-1" and "my-entity-2" with proper names as described above):

Code: Select all

if remote.interfaces.replacer_interface and remote.interfaces.replacer_interface.add_rule then
    remote.call("replacer_interface", "add_rule", "my-entity-1", { "my-entity-2" })
end
4. Additional method - contact author of the mod you want to be included in ruleset and ask him to adjust his mod to be compactible with my mod :D

I don't plan to implement any method of adding a new rules without modifying the code: IMHO it is way too complicated to be included in game.

Re: [MOD 0.11.20] Upgrade with construction robots - v0.1.7

Posted: Mon Apr 13, 2015 3:06 pm
by Ohz
Wow, amazing mod ! Should be implemented in the game !

Re: [MOD 0.11.20] Upgrade with construction robots - v0.1.7

Posted: Mon Apr 13, 2015 3:30 pm
by DaveMcW
You don't need a recipe flag, just use this function:

Code: Select all

function has_recipe(entity)
	return (game.entityprototypes[entity] and game.entityprototypes[entity].type == "assembling-machine")
end

Re: [MOD 0.11.20] Upgrade with construction robots - v0.1.7

Posted: Mon Apr 13, 2015 4:13 pm
by kds71
DaveMcW wrote:You don't need a recipe flag, just use this function:

Code: Select all

function has_recipe(entity)
	return (game.entityprototypes[entity] and game.entityprototypes[entity].type == "assembling-machine")
end
You are right, I feel ashamed that I haven't thought about that :( Now code is much simplier, awesome! I could also got rid of has_subtype flag in similar manner. I already uploaded version 0.1.8 without these useless flags. Thanks a lot!

Version 0.1.8 also has a bugfix - there was a bug which could occur if you saved game while configuration panel was open. Now it should work properly.

Re: [MOD 0.11.20] Upgrade with construction robots - v0.1.7

Posted: Mon Apr 13, 2015 7:28 pm
by kds71
SHiRKiT wrote:Can players create rules themselves without need to go to the code? Like upgrading modded buildings?
Haha, disregard everything I wrote earlier, I realized that it is actually simple to do it that way. Now I updated mod to (hopefully) stable version v1.0.0 and you can setup your own ruleset using in game GUI as you wish. Also new version should work in multiplayer.

Re: [MOD 0.11.20] Upgrade with construction robots - v1.0.0!

Posted: Mon Apr 13, 2015 8:34 pm
by dee-
Gosh! This is wonderful!

Is it possible to have multiple and different upgrade/downgrade plans? Like having different yellow blueprints that each have their own rules. That way you don't have to redefine the rules when you want to change something but just use the other ruleset.