Copy & Paste patch, reworked
Moderator: OpenTTD Developers
Copy & Paste patch, reworked
Here's a rework of the Copy & Paste (or "Build Templates") patch that Frostregen started a while back. Since making it work with trunk, a few bugs have been fixed. Thanks should go mostly to yorick who has done much of the coding.
I'll keep this post updated for as long as I am looking at it. Please post any bugs or requests in this thread, don't bother developers with them
The patch is currently known to work with r16050. You can get Windows builds which will be generated when there are enough changes to test. If you build from source you will still need copypaste.grf from the original thread.
Windows build last updated: 13th April 2009 (r16050)
The patch has currently not been tested with cargodest (perhaps in future, or try it yourself!).
You can track development progress on my site. You can checkout and build using Mercurial from the same address, this is advised if you want the latest build on Linux.
Important note: The format for saved templates is currently changing constantly, so templates saved with one build may not load in future builds until a stable patch is finished.
I'll keep this post updated for as long as I am looking at it. Please post any bugs or requests in this thread, don't bother developers with them
The patch is currently known to work with r16050. You can get Windows builds which will be generated when there are enough changes to test. If you build from source you will still need copypaste.grf from the original thread.
Windows build last updated: 13th April 2009 (r16050)
The patch has currently not been tested with cargodest (perhaps in future, or try it yourself!).
You can track development progress on my site. You can checkout and build using Mercurial from the same address, this is advised if you want the latest build on Linux.
Important note: The format for saved templates is currently changing constantly, so templates saved with one build may not load in future builds until a stable patch is finished.
- Attachments
-
- copypaste-r14781.diff
- (120.73 KiB) Downloaded 761 times
-
- copypaste-r14952.diff
- (131.16 KiB) Downloaded 1127 times
Last edited by davidc on 13 Apr 2009 18:58, edited 6 times in total.
Re: Copy & Paste patch, reworked
Features which need adding:
- Compression for saved templates
- Copying train stations (including newgrf tiles)
- Dynamic size for copy/paste area (can reduce memory usage)
- Rotation of one-way roads
- Versions for saved templates, to stop old builds loading new templates
- Copying of bus stations
- Tram tracks on roads apparently aren't copied properly (reported by Roest)
- Doesn't integrate fully with distant-joint stations
- Improve the command queue after this update
- All types of signal can now be copied and pasted
- No longer possible to bulldoze water and build on it before it floods
- Error handling when loading templates needs improving
- Bridge rotation fixed
Last edited by davidc on 13 Apr 2009 18:59, edited 3 times in total.
Re: Copy & Paste patch, reworked
200+ views and no comments? :S
I haven't tried it yet because since reinstalling Leopard I haven't being able to compile stuff (I have to work on this).
I only tried copy & paste with 0.6.1 a few months ago.
When using it in a multiplayer game I noticed that if the paste was too big it was pasted with some problems. The terrain was badly "redone" making some bridges/tunnels being built wrongly and many signals would have wrong directions and/or types. The solution was to copy things in different parts having smaller pastes. Offline singleplayer had none of this problems.
Do you thing that "Features added: Dynamic size for copy/paste area (can reduce memory usage)" would resolve this?
Thanks
I haven't tried it yet because since reinstalling Leopard I haven't being able to compile stuff (I have to work on this).
I only tried copy & paste with 0.6.1 a few months ago.
When using it in a multiplayer game I noticed that if the paste was too big it was pasted with some problems. The terrain was badly "redone" making some bridges/tunnels being built wrongly and many signals would have wrong directions and/or types. The solution was to copy things in different parts having smaller pastes. Offline singleplayer had none of this problems.
Do you thing that "Features added: Dynamic size for copy/paste area (can reduce memory usage)" would resolve this?
Thanks
Re: Copy & Paste patch, reworked
Windows build and the patch itself updated to r14952. This includes distant-joint stations, but the patch doesn't yet make full use of them (e.g. to copy a spread out station). This will hopefully be worked on. Pasting rail stations doesn't work yet either, there are newgrf related things to think about (what happens if you only copy half of a station which has a roof spanning 2 tiles?).
Please report any problems here if you test it.
nulio: The reduced memory usage will not affect multiplayer pasting. Two things have been changed: less arrays are used to hold the data and the size is dynamic. Using less arrays helps with memory usage and makes saved templates smaller. Making the size dynamic may help with machines will less memory (e.g. you set the max copy paste area to be 16x16, not 256x256).
If you can show exactly what you mean by your problem then it may be possible to fix. However, pasting terrain will never work exactly the way everybody wants. Personally I don't like pasting terrain as invariably it makes a mess of things!
And please, only use on multiplayer servers that allow it
Please report any problems here if you test it.
nulio: The reduced memory usage will not affect multiplayer pasting. Two things have been changed: less arrays are used to hold the data and the size is dynamic. Using less arrays helps with memory usage and makes saved templates smaller. Making the size dynamic may help with machines will less memory (e.g. you set the max copy paste area to be 16x16, not 256x256).
If you can show exactly what you mean by your problem then it may be possible to fix. However, pasting terrain will never work exactly the way everybody wants. Personally I don't like pasting terrain as invariably it makes a mess of things!
And please, only use on multiplayer servers that allow it
Re: Copy & Paste patch, reworked
I attempted to patch it in on my build.... the only patches I have, don't affect any files it does.
I got an error about CommandStruct in command_type.h being a redefenition, and after a few various attempts to solve that, I can't paste anything copied.
I got an error about CommandStruct in command_type.h being a redefenition, and after a few various attempts to solve that, I can't paste anything copied.
Re: Copy & Paste patch, reworked
Are you using the older patch? I have just pulled from the Mercurial trunk and patched using copypaste-r14952.diff. It compiles fine.Gremnon wrote:I attempted to patch it in on my build.... the only patches I have, don't affect any files it does.
I got an error about CommandStruct in command_type.h being a redefenition, and after a few various attempts to solve that, I can't paste anything copied.
The older patch will definitely fail with trunk as the distant-joint stations patch introducted the CommandStruct (distant-joint and copypaste were both written by Frostregen). Pasting will fail because CMD_NO_WATER is no longer used (yorick fixed that). So it definitely sounds like you're using the older patch
-
- Chairman
- Posts: 776
- Joined: 20 Jan 2007 12:08
- Location: Germany
Re: Copy & Paste patch, reworked
It is CommandContainer in distant join and current trunk.davidc wrote:as the distant-joint stations patch introducted the CommandStruct (distant-joint and copypaste were both written by Frostregen)
Last edited by PhilSophus on 10 Jan 2009 15:19, edited 1 time in total.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Re: Copy & Paste patch, reworked
Yeah, I forgot to get the new version... my bad... and yes, it was container, I misremembered it, sorry bout that
Re: Copy & Paste patch, reworked
Glad you got it working, any feedback would be greatGremnon wrote:Yeah, I forgot to get the new version... my bad... and yes, it was container, I misremembered it, sorry bout that
Re: Copy & Paste patch, reworked
I'm getting there... I keep forgetting it's there actually, I'm used to not having it...
One question though, before I try it and possibly break something... I use the routemarkers patch too, does it copy the routemarkers?
One question though, before I try it and possibly break something... I use the routemarkers patch too, does it copy the routemarkers?
Re: Copy & Paste patch, reworked
If it's not in trunk, it wont be copied. I haven't seen the routemarkers patch, so I don't know quite how it works. If it provides sensible interfaces (e.g. GetTileType and CMD_BUILD_XX) then it would be very easy to add.Gremnon wrote:I'm getting there... I keep forgetting it's there actually, I'm used to not having it...
One question though, before I try it and possibly break something... I use the routemarkers patch too, does it copy the routemarkers?
Re: Copy & Paste patch, reworked
Ah.... useful...
Right, back to playing my game... and possibly breaking it again if I patched it wrong.
Right, back to playing my game... and possibly breaking it again if I patched it wrong.
Re: Copy & Paste patch, reworked
I'm looking forward to see it!davidc wrote:Features which need adding:
(...)(...)
- Copying train stations (including newgrf tiles)
Known bugs:
(...)
- Doesn't integrate fully with distant-joint stations
Re: Copy & Paste patch, reworked
update to current rev
- Attachments
-
- copypaste_r15338.diff
- (128.94 KiB) Downloaded 439 times
Re: Copy & Paste patch, reworked
hey there,
is it possible to make this work in the scenario editor? so i can copy industries?
is it possible to make this work in the scenario editor? so i can copy industries?
Re: Copy & Paste patch, reworked
hey, nice patch
i'd love to see this in trunk!!
i'd love to see this in trunk!!
Re: Copy & Paste patch, reworked
Hello Folks!
i'm using Mac OS X 10.5.6 - is there someone nice who can compile a running Openttd with copy and paste functionality for me?? I'm not sure how to patch the r14953 It would be great if there someone who could help me!!
Thanks!
toast
i'm using Mac OS X 10.5.6 - is there someone nice who can compile a running Openttd with copy and paste functionality for me?? I'm not sure how to patch the r14953 It would be great if there someone who could help me!!
Thanks!
toast
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Copy & Paste patch, reworked
With MacOS it should be quite easy: Install xcode from your DVD, install svn and you can compile yourself. An extensive walk-through is found in the sticky thread in this forum.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Copy & Paste patch, reworked
Would someone pretty please update this patch to 0.7.0 ß1?
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Re: Copy & Paste patch, reworked
That one still applies to current trunk (r15541), didn't test it tho.
- Attachments
-
- copypaste_r15495.diff
- (128.7 KiB) Downloaded 486 times
Who is online
Users browsing this forum: Ahrefs [Bot] and 15 guests