[patch] Clipboard (a/k/a "Copy and Paste")

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

McDeffice
Engineer
Engineer
Posts: 13
Joined: 26 May 2012 23:13

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by McDeffice »

kamnet wrote: 03 Feb 2020 05:26 You're attempting to apply a patch written for OpenTTD 1.8.0 (over 2 years ago) against OpenTTD 1.9.3 (several months ago). Source code is continually updated. In order to successfully apply this patch you will first need to update the patch to match the changes in the source code. The failed lines will give you a clue as to what's changed. You'll probably need to analyze the 1.8.0 code to figure that out.

Also, if you apply a patch against OpenTTD 1.9.3, it no longer is technically version 1.9.3, and it will not be compatible with other 1.9.3 clients. It's best to apply it against a nightly, so at least you get the benefits of game improvements and bug fixes.
Thank you for your response and this information.
I have some knowledge of English, sorry if I misunderstand or speak poorly. excuse me.
Indeed the code is updated continuously. An OpenTTD version 1.10.0-beta2 is available. https://www.openttd.org/downloads/opent ... sting.html

I understand that if I modify the code - with a patch - The client is that technically it no longer has the same version, an improvement is to be made. does this mean that this version is no longer compatible with other Openttd Clients of the same original version?

I am thinking of communities such as n-ice or btpro which modify the connection interface as well as some aspects of the client side of the game. This client remains recognized as version 1.9.3 and allows connection to servers 1.9.3. No verification of checksums is carried out.


The patch I'm trying to apply is for version 1.8.0 at least two years ago.

In the meantime, some lines that the patch trying to match may have moved or been changed. This explains why the patch does not know how to carry out the insertion of code to implant the clipboard in several files.

Is the solution to look at the lines that the patch can no longer find and modify so that it can return to where the modifications are to be made?

Or is it some more complicated things because between 1.8.0 and 1.9.3 the coding style to change and functionality have been completely replaced? Perhaps dependencies that have evolved and the way of typing to change?
User avatar
jfs
Tycoon
Tycoon
Posts: 1757
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by jfs »

There's been several changes to code style standards since 1.8, which will make most old patches unable to apply. There's also many new features that have touched files and functions all across the code, which patches will need to be adjusted to. Making it work again might need rewriting large parts of the code.
staale
Engineer
Engineer
Posts: 2
Joined: 30 Apr 2020 16:01

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by staale »

I have managed to rebase 1.10.0 on top of the 1.8 version with the clipboard patch, and have pushed this to my own github:

https://github.com/staale/OpenTTD/tree/clipboard-1.10.0

I have just briefly tested this, and it works for me. I will try and play a bit more with it to see if I encounter any more errors. There where about 1300 commits to rebase, and quite a few merge errors. I am not a C++ developer, so I had to make a best effort to fix things. However, everything compiles now, and I have installed it in Manjaro via the openttd-git package there. I will report back if I continue to develop this, or find any issues.
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by agentw4b »

staale wrote: 30 Apr 2020 16:07 I have managed to rebase 1.10.0 on top of the 1.8 version with the clipboard patch, and have pushed this to my own github:

https://github.com/staale/OpenTTD/tree/clipboard-1.10.0

I have just briefly tested this, and it works for me. I will try and play a bit more with it to see if I encounter any more errors. There where about 1300 commits to rebase, and quite a few merge errors. I am not a C++ developer, so I had to make a best effort to fix things. However, everything compiles now, and I have installed it in Manjaro via the openttd-git package there. I will report back if I continue to develop this, or find any issues.
Could you make an .exe file for people who can't compile and patch the program?
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
staale
Engineer
Engineer
Posts: 2
Joined: 30 Apr 2020 16:01

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by staale »

agentw4b wrote: 30 Apr 2020 18:24 Could you make an .exe file for people who can't compile and patch the program?
Unfortunately it crashed pretty quickly once I tried to copy and paste some larger structures.

I will see if I can make an exe - though I am not sure how as I currently play this on linux.
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by agentw4b »

staale wrote: 01 May 2020 06:14

Unfortunately it crashed pretty quickly once I tried to copy and paste some larger structures.

I will see if I can make an exe - though I am not sure how as I currently play this on linux.
Eventually I created openttd.exe from your application source, but quite often the game crashes, so it's not completely fixed.
But when I have an almost blank map without industry and few cities, it works and that's enough for me. Thank you and I am putting here to download a compiled program in the form of a ZIP for Windows 10 64bit. But I can't guarantee it will work on all computers because I'm not a programmer and I can't fix these things.
clipboard.zip
(20.05 MiB) Downloaded 202 times
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by agentw4b »

agentw4b wrote: 06 May 2020 09:09
staale wrote: 01 May 2020 06:14

Unfortunately it crashed pretty quickly once I tried to copy and paste some larger structures.

I will see if I can make an exe - though I am not sure how as I currently play this on linux.
Eventually I created openttd.exe from your application source, but quite often the game crashes, so it's not completely fixed.
But when I have an almost blank map without industry and few cities, it works and that's enough for me. Thank you and I am putting here to download a compiled program in the form of a ZIP for Windows 10 64bit. But I can't guarantee it will work on all computers because I'm not a programmer and I can't fix these things.

clipboard.zip
I'm sorry, but this is not a suitable exe. Unfortunately, the game crashes very often. I will probably have to wait for someone to properly adapt the patch to the new versions of OpenTTD :-(
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
User avatar
Torben DH
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 31 Dec 2004 09:09
Location: Denmark

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by Torben DH »

agentw4b wrote: 06 May 2020 10:24
agentw4b wrote: 06 May 2020 09:09
staale wrote: 01 May 2020 06:14

Unfortunately it crashed pretty quickly once I tried to copy and paste some larger structures.

I will see if I can make an exe - though I am not sure how as I currently play this on linux.
Eventually I created openttd.exe from your application source, but quite often the game crashes, so it's not completely fixed.
But when I have an almost blank map without industry and few cities, it works and that's enough for me. Thank you and I am putting here to download a compiled program in the form of a ZIP for Windows 10 64bit. But I can't guarantee it will work on all computers because I'm not a programmer and I can't fix these things.

clipboard.zip
I'm sorry, but this is not a suitable exe. Unfortunately, the game crashes very often. I will probably have to wait for someone to properly adapt the patch to the new versions of OpenTTD :-(
I have used this exe for the last couple of weeks and not experiencing many crashes.

But dont copy bridges and tunnels or it will crash.

For some reason ctrl+build station is broken.
TDH
DayLight9382
Engineer
Engineer
Posts: 2
Joined: 20 Jan 2021 15:22

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by DayLight9382 »

anybody here fixing this? :-(

My friends and me want so make another Monster Map, and without copy&paste of crucial connections thats not fun at all :-(
_dp_
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 18 Dec 2013 12:32

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by _dp_ »

FWIW, I just posted an experimental version of CityMania client with copy&paste tool and am currently gathering feedback. It's not based on this particular patch but from what I've read here it should be relatively similar. You can get it here: https://citymania.org/forum/topic/123
DayLight9382
Engineer
Engineer
Posts: 2
Joined: 20 Jan 2021 15:22

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by DayLight9382 »

Hi all,

this is something I want to copy & paste.
or even more complicated train crossings....
Unbenannt.PNG
(931.4 KiB) Not downloaded yet
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by Dante123 »

DayLight9382 wrote: 20 Jan 2021 15:42 anybody here fixing this? :-(

My friends and me want so make another Monster Map, and without copy&paste of crucial connections thats not fun at all :-(
yea same here;
Tried to do a marathon playtrough with a friend on a 4kx4k map; but after the 20th leafclover crossing i wish i could compile this into my fav. patchpack :mrgreen:
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by agentw4b »

_dp_ wrote: 29 Jan 2021 21:00 FWIW, I just posted an experimental version of CityMania client with copy&paste tool and am currently gathering feedback. It's not based on this particular patch but from what I've read here it should be relatively similar. You can get it here: https://citymania.org/forum/topic/123
It doesn't reach many of the features of the original patch, but at least thanks for something. The good thing is that the game still looks like 1.10.3 :-) Please try to improve it even more, especially rotating objects around the axis would be good.

...Unfortunately, it is not stable, the game crashes with that. :-(
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
_dp_
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 18 Dec 2013 12:32

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by _dp_ »

agentw4b wrote: 21 Feb 2021 16:32 It doesn't reach many of the features of the original patch, but at least thanks for something. The good thing is that the game still looks like 1.10.3 :-) Please try to improve it even more, especially rotating objects around the axis would be good.

...Unfortunately, it is not stable, the game crashes with that. :-(
It does have rotation. And if you have a crash please report it properly, just saying that it crashes isn't helpful :p
QbuS
Engineer
Engineer
Posts: 2
Joined: 26 Feb 2021 12:48

Template creating for rails

Post by QbuS »

Hello everyone!

I want to use the copypaste grf. But i dont know how to install it. The thread about this grf is very old so i dont know if its a good idea to write in this thread. So:

How to make this grf working?
Is there a "better" or newer grf for the exact same purpose?

Im new to this forum so if i created this thread in the wrong sub forum im sorry :(

Have a nice day!

[Moderator note: this post, and the next two, were merged back into the Clipboard patch thread -- Kamnet]
_dp_
Transport Coordinator
Transport Coordinator
Posts: 278
Joined: 18 Dec 2013 12:32

Re: Template creating for rails

Post by _dp_ »

It's not a grf, you need a modified version of the game to use copy&paste. And AFAIK the only one currently working is the experimental branch of CityMania client. It's fully compatible with vanilla OpenTTD version so you can just download and use it instead without losing any savegame or network compatibility. You can read more about it here: https://citymania.org/forum/topic/123-c ... ta-testing
QbuS
Engineer
Engineer
Posts: 2
Joined: 26 Feb 2021 12:48

Re: Template creating for rails

Post by QbuS »

Thx! i will try this one!
agentw4b
Traffic Manager
Traffic Manager
Posts: 216
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by agentw4b »

It does have rotation. And if you have a crash please report it properly, just saying that it crashes isn't helpful :p
Just a running game with this client will fall in a few minutes, I don't know why and what more can I tell you about it. And I didn't find the objects rotating.
Owner and admin of servers with names "Experimental games" .
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS
User avatar
jez
Traffic Manager
Traffic Manager
Posts: 158
Joined: 23 Aug 2003 21:24

Re: [patch] Clipboard (a/k/a "Copy and Paste")

Post by jez »

It's a shame this patch didn't add a button in its clipboard panel for "persist clipboard". The clipboard could be persisted between games, meaning you could load a map with useful track structures, copy from there, then load your game and paste into there. Alas, the clipboard is cleared when you load and I don't think there's a way to stop that.
=== Jez ===
McDeffice
Engineer
Engineer
Posts: 13
Joined: 26 May 2012 23:13

Re: Template creating for rails

Post by McDeffice »

_dp_ wrote: 26 Feb 2021 14:35 It's not a grf, you need a modified version of the game to use copy&paste. And AFAIK the only one currently working is the experimental branch of CityMania client. It's fully compatible with vanilla OpenTTD version so you can just download and use it instead without losing any savegame or network compatibility. You can read more about it here: https://citymania.org/forum/topic/123-c ... ta-testing
Very Nice Job ! very tks
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 19 guests