Transport Fever 2

Transport Fever 2

244 ratings
Copy It!
11
4
2
3
4
2
2
2
2
   
Award
Favorite
Favorited
Unfavorite
Misc: Script Mod
Tags: Copy, Paste
File Size
Posted
Updated
529.608 KB
21 Jun, 2023 @ 7:46am
3 Jul, 2023 @ 3:32pm
4 Change Notes ( view )

Subscribe to download
Copy It!

Description
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 clipboard
- Select a template and paste with a mouse click - easy
- Templates can be rotated using the slider in the UI window
- Integrated with my Undo! mod
- 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, and 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 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 backup and save regularly. Let me know if you encounter any problems in the comments below.

Enjoy!
Popular Discussions View All (3)
0
19 May @ 12:48am
PINNED: Please post bug reports here!
okeating
0
19 May @ 12:48am
Please post feature requests here!
okeating
0
30 Jan, 2024 @ 7:20pm
Can't select stations near industries
RadiKyle
37 Comments
creasycat 6 May @ 9:51am 
Is it possible to implement a hologram of the thing you want to paste and to rotate it with your keyboard?
Kwasek98 17 Mar @ 9:00am 
I have a question, is there any way you can make it include assets? This would make the mod EXTREMELY helpful, you could make your own buildings and more!
stelerp 11 Nov, 2024 @ 10:59am 
Is it possible to save the template in a separate file and load the template into another map? Or can it be done by a procedure unknown to me?
Oldhip 22 Oct, 2024 @ 9:53pm 
I know I am an old fossil, but cant fathom out how to use this or move it.
Mark Purayah II 29 Sep, 2024 @ 10:02am 
Sad it can't copy assets
Metalkuma 24 Sep, 2024 @ 1:04am 
I have a problem with the rotation slider.
I don't know why, but it goes from 29 to 31 degrees. So it's impossible to choose a 30 degree rotation.
Metalkuma 20 Sep, 2024 @ 12:50pm 
How to say it simply... Best Mod Ever !
It's incredible how much time I'm going to save thanks to you. I had it in my head to make a symmetrical constructions on my map and I was wondering if there was a way to copy-paste constructions. And then I came across your mod. Thank you very much!
Towei 25 Aug, 2024 @ 9:44am 
can i copy contructions and paste it on another map??
Timme 10 Feb, 2024 @ 6:06am 
Some problems with height. When you paste the template, the height is different than the copied template. Unfortunately, this can only be remedied by raising or lowering the terrain. The height cannot be changed with "," and "." .
Nagger 25 Dec, 2023 @ 9:18am 
Incredible mod, gone is the tedious repeating work that made me stop connecting other cities.
What I do is make a train station, cargo hub, etc. to my liking with all rails connected on a separate part of the map, and every time I need it, I simply copy and paste it where I need it.
Many thanks sharing it!