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

Topics and discussion about specific mods
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

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

Post 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
Attachments
replacer_1.0.3.zip
(9.59 KiB) Downloaded 3108 times
Last edited by kds71 on Wed Aug 12, 2015 11:19 am, edited 36 times in total.
waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [MOD 0.11.20] Upgrade with construction robots

Post 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
Alvin853
Inserter
Inserter
Posts: 26
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: [MOD 0.11.20] Upgrade with construction robots

Post 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.
KrzysD
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Mon Oct 27, 2014 6:49 pm
Contact:

Re: [MOD 0.11.20] Upgrade with construction robots

Post 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
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

Re: [MOD 0.11.20] Upgrade with construction robots

Post 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.
Vitduo
Fast Inserter
Fast Inserter
Posts: 182
Joined: Sun Nov 17, 2013 7:28 pm
Contact:

Re: [MOD 0.11.20] Upgrade with construction robots

Post by Vitduo »

What about inserted modules in assemblers to be upgraded?
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

Re: [MOD 0.11.20] Upgrade with construction robots

Post 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 :(
User avatar
MasterBuilder
Filter Inserter
Filter Inserter
Posts: 353
Joined: Sun Nov 23, 2014 1:22 am
Contact:

Re: [MOD 0.11.20] Upgrade with construction robots

Post 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?
Give a man fire and he'll be warm for a day. Set a man on fire and he'll be warm for the rest of his life.
User avatar
darkshadow1809
Filter Inserter
Filter Inserter
Posts: 306
Joined: Thu Jan 15, 2015 10:13 pm
Contact:

Re: [MOD 0.11.20] Upgrade with construction robots

Post by darkshadow1809 »

Awh heck yeh! This is freakin cool. Mind if i throw it in both modpacks :o?
ShadowsModpackDevelopment
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

Re: [MOD 0.11.20] Upgrade with construction robots

Post 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?
User avatar
darkshadow1809
Filter Inserter
Filter Inserter
Posts: 306
Joined: Thu Jan 15, 2015 10:13 pm
Contact:

Re: [MOD 0.11.20] Upgrade with construction robots

Post 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
ShadowsModpackDevelopment
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

Re: [MOD 0.11.20] Upgrade with construction robots

Post 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.
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

Re: [MOD 0.11.20] Upgrade with construction robots

Post 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.
User avatar
SHiRKiT
Filter Inserter
Filter Inserter
Posts: 706
Joined: Mon Jul 14, 2014 11:52 pm
Contact:

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

Post by SHiRKiT »

Can players create rules themselves without need to go to the code? Like upgrading modded buildings?
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

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

Post 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.
Last edited by kds71 on Mon Apr 13, 2015 4:10 pm, edited 1 time in total.
User avatar
Ohz
Fast Inserter
Fast Inserter
Posts: 199
Joined: Tue Feb 03, 2015 11:40 am
Contact:

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

Post by Ohz »

Wow, amazing mod ! Should be implemented in the game !
I'm not english, sorry for my mistakes
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3716
Joined: Tue May 13, 2014 11:06 am
Contact:

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

Post 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
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

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

Post 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.
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

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

Post 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.
dee-
Filter Inserter
Filter Inserter
Posts: 416
Joined: Mon Jan 19, 2015 9:21 am
Contact:

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

Post 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.
Post Reply

Return to “Mods”