Desynced

Desynced

28 ratings
CopyFactory (Multi-building blueprints)
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
14.738 KB
20 Oct, 2023 @ 9:14am
15 Jun @ 11:21am
13 Change Notes ( view )

Subscribe to download
CopyFactory (Multi-building blueprints)

In 1 collection by sacroimper
Sacroimper's Desynced mods
11 items
Description
This mod lets you copy and paste multiple buildings at a time. And also lets you save multi-building blueprints to the Library.

Copy & Paste

For the copy and paste functionality, there are 3 types of placing the copied buildings:
  • Relative (Rel): Paste with relative links to the new entities. All registers that contain selected buildings will be updated to the new buildings.
  • Original (Orig): Paste with links to the original entities. All registers that contain entities will be preserved.
  • Reset (Reset): Paste reseting entity links (only the references between the selected entities). All registers that contain selected buildings will be empty.

The buttons are located at the bottom left of the screen when more than one unit is selected.

Library

'CopyFactory' blueprints can be stored into the Library by selecting multiple buildings, using the copy button or by importing from text (like blueprints and behaviors). Blueprints built from the Library will always keep their relative links.

Behavior Instructions

  • Place Constructions (CopyFactory): Places a construction site for each building in the CopyFactory blueprint.
  • Check CopyFactory: Checks if a construction site is part of a CopyFactory blueprint
  • Loop Constructions (CopyFactory): Performs code for all Construction sites that are part of the same multi-building blueprint as the input


Additional notes

All buildings will be built at the same time when all the constructions sites are ready. Visual register will change to green when ready, and to yellow when some unit is preventing the construction.

Compatible with Behavior Manager

For any comment or bug report check this mod channel in the Official Desynced Discord[discord.com]

Known limitations:
  • Only buildings that can be made into blueprints can be copied
  • The visuals while pasting don't match the buildings
  • No upgrade functionality
  • More than 100 buildings at a time may cause some lag or 1-2 seconds freeze while constructing the buildings. I've decided not to limit the number of buildings, but use it with responsibility.
  • Bigger factories may need some help to disband the bots from the construction sites.

Future functionality:
  • Library folders
  • ...
21 Comments
sacroimper  [author] 15 Jun @ 11:26am 
It should be fixed now. Thanks for reporting and I really appreciate the logs.
crashfly 13 Jun @ 2:07pm 
the mod currently mostly works in the alien update except for allowing buildings to be placed in the blight. i do have the research already available to be in the blight without damage.

Critical error while executing Main/ui/utilities.lua:175: attempt to index a nil value
Error: stack traceback:
Error: Main/ui/utilities.lua:175: in function 'LocationBlockedByBlight'
Error: CopyFactory/copyfactory.lua:506: in function 'CanPlaceCopyFactory'
Error: CopyFactory/copyfactory.lua:517: in function 'CreateConstructionSiteCopyFactory'
Error: CopyFactory/copyfactory.lua:571: in function <CopyFactory/copyfactory.lua:566>
Error: Unexpected error in simulation code can result in an unrecoverable state.
crashfly 9 Jun @ 5:53pm 
wow ... steam hates updating. had to unsubscribe and then resubscribe to get this updated mod. seems to work much better now.

i will let you know if i run across any issues. thanks for looking into this.
sacroimper  [author] 9 Jun @ 7:10am 
I've pushed a new version, both errors should be fixed. Thanks for reporting.
crashfly 7 Jun @ 9:29pm 
looks like the in the latest "alien" update, this mod is broken. previously made blueprints of factories does partially work {buildings are not reconnected and buildings spawn in one at a time, not all together}
attempting to make copies of new factories errors out:
Critical error while executing CopyFactory/copyfactory.lua:1035: attempt to call a nil value (global 'DeepCopy')
Error: stack traceback:
Error: CopyFactory/copyfactory.lua:1035: in function <CopyFactory/copyfactory.lua:1034>

any chance on fixing this and this mods other errors?
crashfly 13 Mar @ 6:56pm 
a small request if possible, can you add folders to file the prints in. i have several versions of each factory depending on how far into the game i am. a basic "starter" factory and then later with better buildings i have an "upgraded" factory.

however the main issue with this is that these are just one long list. it would be convenient to file into folders like the behaviors and single building blueprints.
crashfly 10 Mar @ 4:25pm 
awesome.
thank you for that update. this mod truly is a necessary mod for this game.
it makes doing "replays" so much more convenient. :steamthumbsup:
ManaTheGentlefox 10 Mar @ 1:20pm 
Thank you so much, this really should be vanilla feature
sacroimper  [author] 10 Mar @ 10:59am 
One of the reasons to have the "building disabled" feature was just what you are trying to do. I've pushed an update to fix this behavior. Now you should be able to build a blueprint if all not-unlocked buildings are disabled.

Thanks for spoting this out.
crashfly 9 Mar @ 10:35am 
so i have a problem with being able to place copies of factories that have a single building that has not been researched yet {larger storage at the end}. i have gone into the blueprint and disabled that building, but i still cannot place the blueprint. is this by design? and if it is, can the option to delete a building from a blueprint so it can be added to the mod?