Copy It!
Copy It!
By popular request, here is a tool that allows you to copy/paste segments and constructions.
Features:
– Select multiple constructions and segments at the same time to create a template
– (Optionally) name the template, and it is saved to the clipboard
– Select a template and paste it with a mouse click – easy
– Templates can be rotated using the slider in the UI window
– Integrated with my Undo!
– Choose whether to build with collision. If not, then the tool will highlight the collision entities.
– Optionally save the templates into your savegame, this comes with a caveat (see below)
Limitations:
– Limited to constructions that are directly buildable by the player (no town buildings, no asset plopping (unless a construction))
– I cannot find a way for the API to preview the build, so it is limited to a white outline painted on the terrain
– Related to that, there is (deliberately) no height adjustment, it will build level with the terrain – use my Move It! Mod if you want to make fine adjustments
– There is no keyboard listener in the API (probably just as well), so I cannot implement any keyboard shortcuts, which is why rotation is a bit clunky
– I made savegame saving optional because the way TPF2 does this is it constantly sends the data from the engine thread to the UI thread, I am not sure exactly how this is implemented, but if it requires copying the data each time it could impact performance.
– The pasting has to be done in two stages, first to get the construction and then the segments – this is because it needs to find the nodes to connect to. I have tried to make sure it validates the segment part first, so it shouldn’t end up with half a job. Note though that for Undo! This will require two clicks of the Undo button.
As always, please back up and save regularly. Let me know if you encounter any problems in the comments below.
Enjoy!