Build Templates (Copy&Paste) (r13911 + 0.6.3 + 0.6.2)

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

Post Reply
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post by skidd13 »

ctrl or strg seems to me the same. :)
I only looked at my keyboard (indeed german) and decided to write strg.

The question right or left, no idea.
I'd prefer left, but both would be ok so.
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

yes it is, STRG = Steuerung which is the same word as control only in german :)
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Only some GUI changes in this version.

Shortcuts:
CTRL + c : Copy
CTRL + v : Paste
left or right ctrl doesn't matter.
Have you ever tried pressing ctrl+v with right-ctrl? ;)

!!You will need the copypaste.grf in your openttd\data folder.!!
Last edited by Frostregen on 05 Jun 2006 17:24, edited 1 time in total.
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

container for image....
Attachments
cp.png
cp.png (3.75 KiB) Viewed 5544 times
User avatar
proudmoore
Director
Director
Posts: 575
Joined: 01 Jun 2005 18:07

Post by proudmoore »

Erm... when i try to run it, it asks for 'copypaste.grf'.

I added the grf to the list in the config - but that doesn't seem to have affected it

When i rename the grf i downloaded (copypaste_122.grf) to just 'copypaste.grf' it asks for the one with the '_122' on the end.

Am i doing something worng, or is a problem in compiling or something?
For Knowledge, Civilisation, and Chocolate Waffles!
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

The _122 seems to be from the forum.

You just have to copy it to your data folder (as copypaste.grf)

No entry in your openttd.cfg is needed! (You have to remove the copypaste_122.grf there ;))
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

updated to latest nightly.

GetDepotDirection moved to npf.c, had to include it.
Maybe move it back to depot.h?

Don't forget copypaste.grf.
(If you don't have it already)
Loz
Engineer
Engineer
Posts: 12
Joined: 07 Jan 2003 20:02
Location: UK

Post by Loz »

I have a small suggestion that will be fairly easy to copy, and the icons already exist. Choosing what items to be copied, so rail, road, bridges, tunnels, signals, competitor's buildings, landscape. the current icons for these various things could be used. should be fairly easy by putting if () {} statements around the build commands. Just a few thoughts.

Apart from that, excellent work! i'm going to patch this in as soon as i can.
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

At the moment I'm thinking of integrating some features,
which would require 7 additional buttons.
Plus your suggested 7 would result in a totally overcrowded gui.

Did you ever need those suggested features while playing a game?
(I rarely need the copy&paste feature alltogether)
User avatar
proudmoore
Director
Director
Posts: 575
Joined: 01 Jun 2005 18:07

Post by proudmoore »

I don't know if you've been following the Through the Tube project, but \jpmaster seems to be planning to use a different map sometime soon. He seems fairly interested in using this patch - which would reduce the amount of effort to 'transfer' the map enourmously. However, this sort of use is kinda infrequent

I would suspect that certainpeople will use this a lot, while others would hate it. Either way, it would be more useful in the map editor i think.
For Knowledge, Civilisation, and Chocolate Waffles!
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Ok, this seems useful enough ;)

I'll try to make the GUI dynamic.
Maybe some sort of "Extended Options" Button - or patch setting, which expands the GUI to show all uncommon features.

Something to discuss:
Does it help, or disturb to implement a partial station copy&paste?
This means:
---
-Only uniform stations will be pasted as intended.
-Non-Uniform stations will produce something more or less unpredictable.
->may split into 2 or more stations
->maybe only partial rebuild

Code: Select all

XXXX
 XXXX
Would result in:

Code: Select all

XXXX
    Y
Y is a second station.
The last XXX can't be rebuild, since 2 different stations would touch eachother.

->Non-touching single stations would always result in 2 stations.
---
Or save the effort and just insert the stations afterwards.
(Makes sense if you want to use different newstations anyway.)
This is, how it is now.

Another thing comes to my mind:
Currently the maximum copy size is fixed to 64x64, because I use static arrays.
This seems to be common in openttd - to use arrays, instead of dynamic memory allocation. (e.g.: CustomNames array)
Is there some reason behind this? Or may I just switch to dynamic datastructures?
Pro:
-Unlimited(ram) copysize.
-No Memory usage, if feature is not used.
Con:
-Heap fragmentation. (Don't know if this really is a problem)
-a little more overhead memory usage per copied tile

The command-queue would benfit most from using a dynamic datastructure.

Maybe some developer has some background information on this topic.
User avatar
Campmaster
Engineer
Engineer
Posts: 24
Joined: 24 Feb 2005 11:59

Post by Campmaster »

I like the patch and I could live with the current functionality. In my opinion it's not neccessary to build the station, as it only takes 2-3 seconds in most cases. The hard part has always been the duplication of rail and signals with is history now ;)
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post by skidd13 »

@Frostregen:
A functionality to mirror the copied section would be cool. Only rotate is in some cases not so easy to handle (3-way junctions). Is it possible to add this feature?

Besides i noticed a small bug: some of the buttons, for example te rotate buttons, don't come up when they have been pressed. So only a gui update is needed.
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
User avatar
proudmoore
Director
Director
Posts: 575
Joined: 01 Jun 2005 18:07

Post by proudmoore »

Any chance of getting this integrated in Richk67's Mini integrated nightly? I've really started using this tool - but the savegames using this, and the savegames of the mini_in (i use some of the patches in that too) aren;t compatible. I don;t have a clue about compiling my own versions - although i'll have a go - and getting it inn the mini_in would be great
For Knowledge, Civilisation, and Chocolate Waffles!
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Ok, then there will be no station copy ;)

@skidd13:
Mirror should be easy to implement. Will be done.
The bug is only within the scenario editor... *sigh* where is the damn tick-counter that runs in every "game mode" ?

EDIT: Fixed. Just found HandleButtonClick with WE_TIMEOUT
Since this is only a minor update, i don't release this now.

@proudmoore:
No problem with that. What do I have to do for this?


Todo List:
-> CQ: "stop paste" / "clear Queue" button (multiplayer only)
-> Add 4 "Convert Rail buttons". all unclicked for original rail. if one is clicked, convert all rail to this.
-> Add Button: Continue on Error? (if one command fails, pasting is stopped.) (+ - Red Error Square symbol)
-> Button: Bulldoze before rebuild. (+ - Dynamite Image) (important for pasting bridges over water!!!)
-> Choose which items to copy: Road, Rail, Bridges, tunnels, signals, competitor/only own stuff.
-> Mirror: Horzontal + Vertical.
User avatar
proudmoore
Director
Director
Posts: 575
Joined: 01 Jun 2005 18:07

Post by proudmoore »

I'd imagine that either you try PM'ing Richk67, or post the patch in the thread dedicated to the mini_in:
http://www.tt-forums.net/viewtopic.php?t=24423

Since it is a mini_in, he only wants patchs that integrate with no problems - but i wouldn;t know about your patch. However, it would be great to have it in the mini_in. T'is very useful.
For Knowledge, Civilisation, and Chocolate Waffles!
Sebastiaan
Engineer
Engineer
Posts: 110
Joined: 20 Jun 2005 19:22
Location: Leuven, Belgium

Post by Sebastiaan »

If I remember correctly, RichK indeed only accepts patches which work against the miniIN branch. To test that one must get the SVN source from branch/miniIN and then hope it works :)) .. or modify the patch :roll: ;)
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Currently I'm waiting for the bridge branch coming back into trunk.
Sebastiaan
Engineer
Engineer
Posts: 110
Joined: 20 Jun 2005 19:22
Location: Leuven, Belgium

Post by Sebastiaan »

seems that quick retreat caused a lot of problems... :roll:
why was it taken out? haven't seen a reason anywhere...
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Post by Frostregen »

Hmm, I switched back to the old code, as it seems the bridge branch will take a while before coming back.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 8 guests