[MOD 0.15+] Copy & Paste Modules v0.3.1

Topics and discussion about specific mods
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

[MOD 0.15+] Copy & Paste Modules v0.3.1

Post by Mooncat »

Type: Mod
Name: Copy & Paste Modules
Description: Lets you also copy and paste modules from a machine to another.
License: GNU LGPLv3
Version: 0.3.1
Release: 2017-6-21
Tested-With-Factorio-Version: 0.15.21
Category: (Helper)
Tags: copy, paste, module
Download-Url: https://mods.factorio.com/mods/Mooncat/ ... te-modules
Website: viewtopic.php?f=97&t=48801
License
Long description
For modders
Version history
Last edited by Mooncat on Wed Jun 21, 2017 2:17 pm, edited 10 times in total.
User avatar
Nova
Filter Inserter
Filter Inserter
Posts: 960
Joined: Mon Mar 04, 2013 12:13 am
Contact:

Re: [MOD 0.15+] Copy & Paste Modules

Post by Nova »

That sounds like it should be in the base game. Nice mod, will try it!
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.15+] Copy & Paste Modules

Post by Mooncat »

Nova wrote:That sounds like it should be in the base game. Nice mod, will try it!
Thanks! I hope there is an option for this in the base game too. :D
ibeatbabybiters
Inserter
Inserter
Posts: 30
Joined: Sun Apr 30, 2017 7:14 pm
Contact:

Re: [MOD 0.15+] Copy & Paste Modules

Post by ibeatbabybiters »

Thank you a thousand times for this. I wished for a simple copy and paste feature ever since I got to use blueprints for the first time. The blueprinting system in itself is such an awesome idea, but the interaction with it is so damn weird. The new blueprint library maybe helps managing tons of blueprints, builtin import/export is also nice, but the actual handling of them is just horrible in my opinion. I don't understand why this was implemented as items in the inventory (my guess would be old code that didn't fit new ideas, like it always is in software development :) especially if you're a small team and not a mega corp with hordes of developers)
I simply hate fiddling with blueprints in the inventory, so I only use them to tile down e.g. mining outposts and train stations, or other "bigger" projects. Maybe I'm just using the current blueprint system wrong all along, but I'm using the quickbar for example and I'm unable to use it efficiently.

I've now played a few hours with your mod, and this feels like inserting Productivity, Speed and Efficiency Modules into my brain. I had so many horrible parts in my factory which I always dreaded to refactor, simply because it would be too annoying to do. But now, with your mod, I got so much done in so little time.

Again thank you and well done. The Devs should integrate this into the base game asap in my opinion, because this would instantly improve gameplay for everyone.

Edit: HAHA I'm so sorry but I posted in the wrong thread :D :D :D The mod I was talking about is Cut n Paste tools: https://mods.factorio.com/mods/mickael9 ... sion/13853

I used it yesterday and wanted to give feedback, so I search for "Copy and Paste" instead of Cut and Paste", and the screenshot looked a bit similar and so I accidentally landed here :D But your mod also looks super useful! I'll definitively try it.
Usually I don't beat babies, but when I do I beat baby biters.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.15+] Copy & Paste Modules

Post by Mooncat »

ibeatbabybiters wrote:Thank you a thousand times for this. I wished for a simple copy and paste feature ever since I got to use blueprints for the first time. The blueprinting system in itself is such an awesome idea, but the interaction with it is so damn weird. The new blueprint library maybe helps managing tons of blueprints, builtin import/export is also nice, but the actual handling of them is just horrible in my opinion. I don't understand why this was implemented as items in the inventory (my guess would be old code that didn't fit new ideas, like it always is in software development :) especially if you're a small team and not a mega corp with hordes of developers)
I simply hate fiddling with blueprints in the inventory, so I only use them to tile down e.g. mining outposts and train stations, or other "bigger" projects. Maybe I'm just using the current blueprint system wrong all along, but I'm using the quickbar for example and I'm unable to use it efficiently.

I've now played a few hours with your mod, and this feels like inserting Productivity, Speed and Efficiency Modules into my brain. I had so many horrible parts in my factory which I always dreaded to refactor, simply because it would be too annoying to do. But now, with your mod, I got so much done in so little time.

Again thank you and well done. The Devs should integrate this into the base game asap in my opinion, because this would instantly improve gameplay for everyone.

Edit: HAHA I'm so sorry but I posted in the wrong thread :D :D :D The mod I was talking about is Cut n Paste tools: https://mods.factorio.com/mods/mickael9 ... sion/13853

I used it yesterday and wanted to give feedback, so I search for "Copy and Paste" instead of Cut and Paste", and the screenshot looked a bit similar and so I accidentally landed here :D But your mod also looks super useful! I'll definitively try it.
Are you sure the screenshots are similar? :twisted:
But I agree that mod is good too. ;)
ibeatbabybiters
Inserter
Inserter
Posts: 30
Joined: Sun Apr 30, 2017 7:14 pm
Contact:

Re: [MOD 0.15+] Copy & Paste Modules

Post by ibeatbabybiters »

Well, not exactly similar, but both have a building in the screenshot and so I was too quick and confused them :)
Usually I don't beat babies, but when I do I beat baby biters.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.15+] Copy & Paste Modules

Post by orzelek »

Really nice idea - it should be in base game for sure.

Can you also make the mod overwrite modules that are there already and return them to player?
Basically to update modules in all machines I'd need to remove them by hand now still and then copy-paste. It would be nice if mod could remove modules that are in the machine and then paste new ones.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.15+] Copy & Paste Modules

Post by Mooncat »

orzelek wrote:Really nice idea - it should be in base game for sure.

Can you also make the mod overwrite modules that are there already and return them to player?
Basically to update modules in all machines I'd need to remove them by hand now still and then copy-paste. It would be nice if mod could remove modules that are in the machine and then paste new ones.
Directly inserting the modules back to player will be OP, considering you can copy and paste over long distance. So a valid solution would be using the robots.

Here is a request for removing items from an entity without deconstructing it, but unfortunately it is rejected: viewtopic.php?f=28&t=48634

As a workaround, I think I can spill the modules on the ground and mark them for deconstruction. I think it will look "interesting". :P
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.15+] Copy & Paste Modules

Post by orzelek »

Actually I just noticed that module inserter mod does it somehow.
If you order it to insert modules into building that has them already bots drop new ones and it teleports old ones to inventory when bot drops new one.
Might be worth checking out.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.15+] Copy & Paste Modules

Post by Mooncat »

orzelek wrote:Actually I just noticed that module inserter mod does it somehow.
If you order it to insert modules into building that has them already bots drop new ones and it teleports old ones to inventory when bot drops new one.
Might be worth checking out.
I somehow kept thinking that you can do copy-and-paste with unlimited distance, so I thought it is cheaty to get the modules back instantly. But it turns out it is limited by reach distance. I has probably played too much creative mode. :lol:
Thanks for the hint. I have briefly checked the mod. But I don't really like to do on_tick in this tiny mod, so I remove the modules right after the paste action, before modules are inserted. It doesn't look bad.
Though I can't spill the module on ground because the API does not return the item entity, I have to create the module at the same position of the machine, so it would be a problem if you want to get that module back without mining the machine.


Released v0.2.0.
Changelog
Player take back the replaced modules
Robots take back the replaced modules
Spent some time to create the item insertion flying text. I was surprised that the vanilla flying text is not placeable off grid.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.15+] Copy & Paste Modules v0.2.0

Post by orzelek »

Ohh nice - new update :D
Is there any practical difference between bots carry module or it appears in inventory ?
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.15+] Copy & Paste Modules v0.2.0

Post by Mooncat »

orzelek wrote:Ohh nice - new update :D
Is there any practical difference between bots carry module or it appears in inventory ?
If you want module inserting and replacing to be fully automated, don't want any module appear in your inventory and are too lazy to set the auto-trash slots, bot carry module will be your thing. ;)
Factorie
Fast Inserter
Fast Inserter
Posts: 100
Joined: Wed May 31, 2017 2:29 am
Contact:

Re: [MOD 0.15+] Copy & Paste Modules v0.2.0

Post by Factorie »

Gonna check this out. Good QOL mod
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.15+] Copy & Paste Modules v0.2.1

Post by Mooncat »

Released v0.2.1. Just a small update:
  • If there are enough modules in your character's inventory, they will be inserted before requests to the robot system are made for the remaining ones.
Since copy-&-paste is limited by reach distance, the same as quick insert, why not just take modules out from the player's inventory when they are needed. :P
bNarFProfCrazy
Fast Inserter
Fast Inserter
Posts: 194
Joined: Sat Apr 23, 2016 7:11 am
Contact:

Re: [MOD 0.15+] Copy & Paste Modules v0.2.1

Post by bNarFProfCrazy »

First of all: This is really an awesome mod.

I also have some suggestions for improvements:

1) Also copy the modules, that are not yet delivered to the building.
I usually/always have too few (-3.5k Speed3 + 1.5 Prod3) modules , that why its even hard for me to put enough modules into a single building.
Most of my blueprints already contain the nessesary modules, but of course, some are always missing or a single building needs to be added/rebuild due to space constraints. Then copy pasting the exing factories with their not yet present but requested modules would be nice.

2) Update existing module request markers.
Same exampel as above, I have blueprints with some modules lets say 2x Speed 1, but I want to change them to Speed 3 and Prod 3, currently i have to manually delete the request marker and then paste the modules back. It would be nice if the request marker would be updated/replaced/removed as well.

3) Manually insert modules on pasted structures.
I know this is already partially implemented, and it might be fully implemented by implementing two.
My modules are that laking in quantity that i sometimes have the urge to pickup some modules at the production and just paste them into the module production.
Unfortunately this is quite bothersome, as I can only insert all modules or insert them manually. The specific modules are already requested, but I can not use my personal robots to deliver them, because the robots tend to place them elsewhere. So it would be nice if I "repaste" the module config that the specific modules are taken from my inventory if available.

(I have a megafactory that uses 1-2 express fullstreams of CPUs to produce modules)
bNarFProfCrazy
Fast Inserter
Fast Inserter
Posts: 194
Joined: Sat Apr 23, 2016 7:11 am
Contact:

Re: [MOD 0.15+] Copy & Paste Modules v0.2.1

Post by bNarFProfCrazy »

Here are the German (de) translations for your mod.

EDIT: Now using UTF8
Attachments
copyPasteModules_de.cfg
German (de) translations
(1.19 KiB) Downloaded 159 times
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.15+] Copy & Paste Modules v0.2.1

Post by Mooncat »

bNarFProfCrazy wrote:First of all: This is really an awesome mod.

I also have some suggestions for improvements: ...
Thanks!

Not 100% sure what your first and third suggestions mean, so please correct me if I'm wrong:

1) Add the ability to copy-and-paste the request marker, so that modules can be copy-and-pasted even if they have not been delivered.

3) Pasting on a machine that already has a module request marker will try to insert the modules from your character inventory.


I think they are all valid and doable. But 3) may not work the same as you think. Whenever a machine is pasted, the settings from the machine that was copied will be used. So if you want to insert the modules, you will need to find the machine that has the same modules to copy from first.

About 2), updating the marker may or may not work. I will need some testing. Worst case will be removing the old marker and creating a new marker. Doing so will make the robots that are on the way cancel their tasks.

(I admit I was a bit lazy when making the mod, so it doesn't work whenever there is a request marker on the pasted machine. :P )

And thanks for the German translation! I will add it in the next update. ;)
bNarFProfCrazy
Fast Inserter
Fast Inserter
Posts: 194
Joined: Sat Apr 23, 2016 7:11 am
Contact:

Re: [MOD 0.15+] Copy & Paste Modules v0.2.1

Post by bNarFProfCrazy »

Yes, thats exactly what i want.

1) include both the delivered and not yet delivered.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.15+] Copy & Paste Modules v0.2.1

Post by Mooncat »

A few days ago, I have finished updating the mod so it also took care of the item request proxies, but something just didn't feel right...
I figured that its copy-and-paste behaviour is different than the vanilla one.
For vanilla, when you copy an entity and paste to another, the settings in the pasted entity will be "replaced" by the source settings.
However, in our mod, we "add" the source modules to the destination, and only remove modules if there are not enough slots.

So I decided to change it. The third time this mod was redesigned! :lol:
But I don't know whether I'm in a bad condition, or the algorithm is really harder than I thought (mostly caused by the different combinations of mod settings), it took me 2 days to clear my mind and finish implementing it...
And I'm still testing it.
(Maybe I should have submitted the updated version first... :oops: )

Since the mod has been rewritten, the settings are also updated...
@bNarFProfCrazy Sorry I have wasted your translation... If you could translate the following ones, I can include them in the next version. Thanks! :mrgreen:

Code: Select all

[mod-setting-name]
copy-and-paste-modules_enable=Enable copy & paste modules
copy-and-paste-modules_robot-inserts-modules-after-player=    Robot inserts modules after player
copy-and-paste-modules_complete-override=    Complete override
copy-and-paste-modules_replace-unwanted-modules-for-insufficient-slots=        Replace unwanted modules for insufficient slots
copy-and-paste-modules_robot-removes-modules-after-player=    Robot removes modules after player

[mod-setting-description]
copy-and-paste-modules_enable=When you copy the settings of a machine and paste to another one, the modules from the source machine will also be pasted to the destination machine.
copy-and-paste-modules_robot-inserts-modules-after-player=If you don't have enough modules in your inventory, robots will insert the remaining ones for you.
copy-and-paste-modules_complete-override=Those existing or requested modules on the destination machine but not on the source machine will be removed.
copy-and-paste-modules_replace-unwanted-modules-for-insufficient-slots=If there are not enough slots in the destination machine, the unwanted modules will be removed, so that the wanted ones can be inserted.\nThis is used only if Complete override is disabled.
copy-and-paste-modules_robot-removes-modules-after-player=If you don't have enough inventory slot to take anymore removed modules, robots will get the job done.
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.15+] Copy & Paste Modules v0.3.0

Post by Mooncat »

I have finished testing. So far so good. Not 100% sure it is bugless, but it is working. :P
Changelog
Post Reply

Return to “Mods”