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

Starbud
Traffic Manager
Traffic Manager
Posts: 211
Joined: 05 Mar 2007 00:48
Location: Sweden
Contact:

Re: Build Templates (Copy&Paste) (r10791 + 0.5.3-rc2)

Post by Starbud »

Maybe the copied area can be held steady while ctrl is pressed?
Sort of just having the white squares and the tracks drawn like when placing the pastingarea but becoming sort of glued during ctrl?

I guess there is some things i havent thought about but it is an idea so far :)
http://openttd.org - i love building stuff :)
Someones play with pics http://dimalimsliv.blogg.se
Carskick
Engineer
Engineer
Posts: 37
Joined: 21 Apr 2004 23:00

Re: Build Templates (Copy&Paste) (r10957 + 0.5.3-rc2)

Post by Carskick »

Wow, this is great stuff!!!

I think this is a fantastic and well done copy and paste feature. I just tested it in 0.5.3 RC2, and it is very well done. What is the predicted ETA for getting into a stable? I am sure it depends if you run into more issues, but do you think it won't be implemented until 0.6.0 since all until that are technically supposed to be bug fixes?

Thanks!
Been playing Transport Tycoon since 1994.

My computer information site: http://www.freewebs.com/computerfacts/
iNVERTED
Route Supervisor
Route Supervisor
Posts: 387
Joined: 24 Apr 2005 21:21
Location: Torquay, England
Contact:

Re: Build Templates (Copy&Paste) (r10957 + 0.5.3-rc2)

Post by iNVERTED »

How about this:

To use the top left tile as the center tile, just click normally
To use a different tile, click and keep the mouse button pressed, then drag to the location of the center tile, while the highlight of the pasting area does not move, then release on the target tile.
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: Build Templates (Copy&Paste) (r10957 + 0.5.3-rc2)

Post by Frostregen »

This sounds like a good idea :)

I'll look into this.
LiOn
Engineer
Engineer
Posts: 32
Joined: 06 Aug 2007 10:17

Re: Build Templates (Copy&Paste) (r10957 + 0.5.3-rc2)

Post by LiOn »

Just one little question I could not find the answer: The copy and paste of one way streets is not possible, is it? May be I'm just cackhanded :wink:
If not - is it planed?

I really like this patch!
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: Build Templates (Copy&Paste) (r10957 + 0.5.3-rc2)

Post by Frostregen »

No, currently one-way roads are not included, but this will be easy to add.
Do one-way roads actually work now?
They were included as a roadtype inside the code for a long time, but actually for no use back then.

I'll add it in the next version.
User avatar
Sir A. Boey
Transport Coordinator
Transport Coordinator
Posts: 299
Joined: 17 Nov 2006 17:40
Location: Everywhere and nowhere

Re: Build Templates (Copy&Paste) (r10957 + 0.5.3-rc2)

Post by Sir A. Boey »

they work in the latest ChrisIN which you can find here... Or watch my [OTTD] pictures for the prove (to visit click on the img in my signature) Chapter VI on the bottom...
Image
_____________# If you believe in it, you can achieve it" # ____________
__________________# Check out My Closed Platform #___________________
LiOn
Engineer
Engineer
Posts: 32
Joined: 06 Aug 2007 10:17

Re: Build Templates (Copy&Paste) (r10957 + 0.5.3-rc2)

Post by LiOn »

Frostregen wrote:Do one-way roads actually work now?
They were included as a roadtype inside the code for a long time, but actually for no use back then.
Don't know exactly. they were introduced in r9999 (fixes in r10004, r10014, r10221), afaik.
Starbud
Traffic Manager
Traffic Manager
Posts: 211
Joined: 05 Mar 2007 00:48
Location: Sweden
Contact:

Re: Build Templates (Copy&Paste) (r11133 + 0.5.3)

Post by Starbud »

I noticed somthing thing that i would love be able to use, Copy&paste during pause in multiplayer.

I made a map where players can build during pause, then i loaded it to a server.
Works really well but Copy&paste stop working until the game is unpaused, but then some clients cant keep up with the requred speed.
Because of this i decided to pause the game and enable the "pause building mode" so more people can play the map even when it has grown as much as it has :)
Is there any ideas of how to make Copy&paste to work in pausemode for networkplayers?

The server is currently named TBG if anyone is intrested, running version 0.5.2.
http://openttd.org - i love building stuff :)
Someones play with pics http://dimalimsliv.blogg.se
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: Build Templates (Copy&Paste) (r11133 + 0.5.3)

Post by Frostregen »

It may be because the execution of queued commands depends on
"_current_tick",
which gets stopped if the server pauses. (i think)

The solution would be to execute the queue based on something else.
I have to look into the code...
Back then _current_tick was the only counter which does run in every game_mode.

Hmm, if build_while_paused is disabled, i would have to disable queue execution when paused.
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Re: Build Templates (Copy&Paste) (r11231 + 0.5.3)

Post by chrissicom »

Copying a road bridge with the default code fails with "can't build bridge here" and when I change the relevant code to

Code: Select all

static void CP_Build_Bridge(TileIndex start_tile, TileIndex end_tile, uint8 bridgetype, uint8 railtype, uint8 transport_type)
{
	CP_DoCommand(start_tile, end_tile,
		bridgetype | (railtype << 8) | (transport_type << 15), NULL, CMD_BUILD_BRIDGE | CMD_MSG(STR_5015_CAN_T_BUILD_BRIDGE_HERE));
}
See: http://www.tt-forums.net/viewtopic.php?p=632710#p632710

It pastes a rail instead of a road bridge. It seams that bit p2 isn't set to 15 for road bridges. Any idea why?
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: Build Templates (Copy&Paste) (r11231 + 0.5.3)

Post by Frostregen »

Ok, they have changed the placement code of bridges.

The copy part needs to store the roadtype now:

Code: Select all

if (GetBridgeTransportType(tile) == TRANSPORT_ROAD)
	_copy_rail[bindex] = (GetRoadTypes(tile) << 6);
And the paste code needs to be changed like this:

Code: Select all

if (((_copy_bridge[index] >> 3) & 1U) == TRANSPORT_RAIL)
	CP_Build_Bridge(tile, tmp_tile, (_copy_bridge[index] >> 8), TRANSPORT_RAIL, convertRail ? (uint) _cur_railtype : ((_copy_rail[index] >> 6) & 3U) );
else
	CP_Build_Bridge(tile, tmp_tile, (_copy_bridge[index] >> 8), TRANSPORT_ROAD, ((_copy_rail[index] >> 6) & 3U) );
For tunnels there are some changes too.
The necessary changes are all inside copy_paste.cpp,
so you may just wait for the next revision,
which should be ready in some minutes.

EDIT: DONE
tb2571989
Director
Director
Posts: 544
Joined: 04 May 2006 10:54
Location: Bristol, UK
Contact:

Re: Build Templates (Copy&Paste) (r11248 + 0.5.3)

Post by tb2571989 »

I was hoping for a tool like this, or just copy/paste. SEARCH FTW!!!

Just got to get it to work now...
What's the copypaste.grf v7 format? I download it and it's a "copypaste_grf_v7.7z". Is this a mistake or is 7z a file format i need WinRar or something like that to open?

Cheers
What about you? Will you join me when the time comes to be a hero?
LiOn
Engineer
Engineer
Posts: 32
Joined: 06 Aug 2007 10:17

Re: Build Templates (Copy&Paste) (r11248 + 0.5.3)

Post by LiOn »

Starbud
Traffic Manager
Traffic Manager
Posts: 211
Joined: 05 Mar 2007 00:48
Location: Sweden
Contact:

Re: Build Templates (Copy&Paste) (r11248 + 0.5.3)

Post by Starbud »

As far as i know you also need the binary to make it work including the languagepacks and some other things.
I have downloaded the binary and made it work right away.
If i understand your message properly you only copied the grf right?
If you still have problems with it you can PM me and i'll do what i can to help :)
http://openttd.org - i love building stuff :)
Someones play with pics http://dimalimsliv.blogg.se
clark17
Engineer
Engineer
Posts: 4
Joined: 18 Oct 2007 11:46

Re: Build Templates (Copy&Paste) (r11248 + 0.5.3)

Post by clark17 »

It there has a chance to see it in the trunk?
Sorry for my little english....
rabbit67890
Engineer
Engineer
Posts: 72
Joined: 23 Sep 2007 09:57

Re: Build Templates (Copy&Paste) (r11248 + 0.5.3)

Post by rabbit67890 »

clark17 wrote:It there has a chance to see it in the trunk?
i guess it will be in trunk
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: Build Templates (Copy&Paste) (r11248 + 0.5.3)

Post by DJ Nekkid »

any chance to get a rev 11370 update? the dude who wrote pax dest updated his patch, and i love to combine theese 2 patches. altho, buildottd cant make it, well, the compile works, but the game crashes when i try to paste something :)
Member of the
ImageImage
Frostregen
Transport Coordinator
Transport Coordinator
Posts: 340
Joined: 06 Feb 2006 23:58

Re: Build Templates (Copy&Paste) (r11248 + 0.5.3)

Post by Frostregen »

I'm currently away from home. I'll fix it tomorrow.


edit: Took a while longer, but finally...
init
Engineer
Engineer
Posts: 93
Joined: 07 Apr 2005 10:01

Re: Build Templates (Copy&Paste) (r11388 + 0.5.3)

Post by init »

Any chance of a more recent patch? I tried with r11433, but three hunks in two files (src/tables/sprites.h and src/gfxinit.cpp) failed. There seem to have been some major changes to the GRF loading code, so it does not seem to be a simple fix. As an example, it seems like files have to be mentioned in some table to be loaded, instead of using explicit loading statements for each file.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 10 guests