Pity. But I can live with thatBilbo wrote:As I looked in the patch - since it modifies the network protocol for leveling and clearing area by adding flag for dialognal clear ... no. Unfortunately, it is not network compatible.
45° rotated rectangle clearing / leveling patch
Moderator: OpenTTD Developers
Re: 45° rotated rectangle clearing / leveling patch
Re: 45° rotated rectangle clearing / leveling patch
Well, yes, it's obvious to you and me - we've both been programming for quite some time.What's the return value of || or && ? Obviously boolean, since they're logic operators, so no need for the if.
I remember, though, that when I first started programming, that logical equations could confuse me.
I usually try not to do computations in the return statement - I guess it's mostly a matter of style.
"If a man does not keep pace with his companions, perhaps it is because he hears a different drummer. Let him step to the music he hears, however measured or far away" --Henry David Thoreau
- NukeBuster
- Traffic Manager
- Posts: 222
- Joined: 04 Jan 2006 18:16
- Location: Alphen aan den Rijn, The Netherlands
- Contact:
Re: 45° rotated rectangle clearing / leveling patch
I´ll be at my home computer in a few days. When I do I will round up the function stuff.
NukeBuster
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
- NukeBuster
- Traffic Manager
- Posts: 222
- Joined: 04 Jan 2006 18:16
- Location: Alphen aan den Rijn, The Netherlands
- Contact:
Re: 45° rotated rectangle clearing / leveling patch
I am currently working on the function, but I have some questions about a bit of code.
Is it ok to replace the above code with:
The change in code will make the innards more compatible with the code from landscape.cpp. It will allow me to use the same innards for diagonal demolishing and leveling. Which in turn will make it easier to turn the repeated statement into a function.
Code: Select all
BEGIN_TILE_LOOP(tile2, size_x, size_y, tile) {
curh = TileHeight(tile2);
while (curh != h) {
ret = DoCommand(tile2, 8, (curh > h) ? 0 : 1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND);
if (CmdFailed(ret)) break;
if (flags & DC_EXEC) {
money.AddCost(-ret.GetCost());
if (money.GetCost() < 0) {
_additional_cash_required = ret.GetCost();
return cost;
}
DoCommand(tile2, 8, (curh > h) ? 0 : 1, flags, CMD_TERRAFORM_LAND);
}
cost.AddCost(ret);
curh += (curh > h) ? -1 : 1;
}
} END_TILE_LOOP(tile2, size_x, size_y, tile)
Code: Select all
for (int x = sx; x <= ex; ++x) {
for (int y = sy; y <= ey; ++y) {
curh = TileHeight(TileXY(x, y));
while (curh != h) {
ret = DoCommand(TileXY(x, y), 8, (curh > h) ? 0 : 1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND);
if (CmdFailed(ret)) {
money.AddCost(-ret.GetCost());
curh += (curh > h) ? -1 : 1;
continue;
}
/* To be able to determine how much the operation will cost, add the cost to cost. */
cost.AddCost(ret);
if (flags & DC_EXEC) {
money.AddCost(-ret.GetCost());
if (money.GetCost() < 0) {
_additional_cash_required = ret.GetCost();
/* Remove cost for not executed DoCommand from cost. So it is not billed anyway.*/
cost.AddCost(-ret.GetCost());
return cost;
}
DoCommand(TileXY(x, y), 8, (curh > h) ? 0 : 1, flags, CMD_TERRAFORM_LAND);
}
curh += (curh > h) ? -1 : 1;
}
}
}
NukeBuster
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
-
- Engineer
- Posts: 63
- Joined: 26 Aug 2005 15:12
Re: 45° rotated rectangle clearing / leveling patch
Is this thing still being worked on?
Snuk the Great
- NukeBuster
- Traffic Manager
- Posts: 222
- Joined: 04 Jan 2006 18:16
- Location: Alphen aan den Rijn, The Netherlands
- Contact:
Re: 45° rotated rectangle clearing / leveling patch
I'm looking into it from time to time, but as I am a student. I do not have much time to spend on patches.
Also I was thinking on how to do the function stuff. If the patch doesn't apply anymore, please let me know. I will be happy to up it to the latest nightly.
Also I was thinking on how to do the function stuff. If the patch doesn't apply anymore, please let me know. I will be happy to up it to the latest nightly.
NukeBuster
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
Re: 45° rotated rectangle clearing / leveling patch
I haven't looked at the original patch for quite a while, but the code used in ChrisIN from this patch has been updated quite a few times and works fine. The code isn't super nice but it works and has no known bugs and it's also network compatible, don't know why someone above said this patch isn't network compatible. So if you look at the .diff for this patch it won't be too much work to extract the required changes from the ChrisIN .diff.
- NukeBuster
- Traffic Manager
- Posts: 222
- Joined: 04 Jan 2006 18:16
- Location: Alphen aan den Rijn, The Netherlands
- Contact:
Re: 45° rotated rectangle clearing / leveling patch
Thanks Chrissicom, I will try to rediff this file later tonight or look at the changes you have made.
NukeBuster
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
Re: 45° rotated rectangle clearing / leveling patch
Hello,
Can i use this patch with 0.5.3? And use it so easy like Build Templates (Copy&Paste) (r11248 + 0.5.3) ?
Can i use this patch with 0.5.3? And use it so easy like Build Templates (Copy&Paste) (r11248 + 0.5.3) ?
- NukeBuster
- Traffic Manager
- Posts: 222
- Joined: 04 Jan 2006 18:16
- Location: Alphen aan den Rijn, The Netherlands
- Contact:
Re: 45° rotated rectangle clearing / leveling patch
No you cannot, although it is in the ChrisIn. Which is probably the best thing at the moment if you wish to play with this feature. Please look in this forum for a topic about the CrisIN
As soon as I have enough time to continue work on this patch. I will finish it up.
As soon as I have enough time to continue work on this patch. I will finish it up.
NukeBuster
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
Re: 45° rotated rectangle clearing / leveling patch
is this abandoned? its my favorite feature thats not in the trunk yet.
Re: 45° rotated rectangle clearing / leveling patch
I would like to see this in trunk as well... I hope somebody will take this feature up again.
English is not my native language, so please excuse me if I sometimes might appear a bit harsh or if I make a spelling or grammar mistake!
Re: 45° rotated rectangle clearing / leveling patch
I've made a patch for terraforming that does something else. When holding CTRL, you can "draw" any area you want for tools like raise, lower, level, dynamite, place rivers and place stones (last two for scedit).
Maybe you want to give it a try? It's also included in Gonozal's patch pack.
Maybe you want to give it a try? It's also included in Gonozal's patch pack.
Re: 45° rotated rectangle clearing / leveling patch
sure I'll give it a try, thanks!
English is not my native language, so please excuse me if I sometimes might appear a bit harsh or if I make a spelling or grammar mistake!
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Re: 45° rotated rectangle clearing / leveling patch
For the record, I am still interested in that patch, but it will not be in 0.6.
Let's wait for it to be released (no.. you wait, we work in releasing it) and than we'll see if it can be put in trunk or not.
The idea is wonderful, we all agree on it
Let's wait for it to be released (no.. you wait, we work in releasing it) and than we'll see if it can be put in trunk or not.
The idea is wonderful, we all agree on it
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
- NukeBuster
- Traffic Manager
- Posts: 222
- Joined: 04 Jan 2006 18:16
- Location: Alphen aan den Rijn, The Netherlands
- Contact:
Re: 45° rotated rectangle clearing / leveling patch
The latest problem was, that at the moment the CTRL key is already used for something else. There is a discussion going on on how to solve it.
If that could be solved, I would be willing to finish up the remaining stuff. But there would need to be a clean solution. (I could use another key, but there was much upheavel on what key to use.(I'd still suggest Z))
Regards.
If that could be solved, I would be willing to finish up the remaining stuff. But there would need to be a clean solution. (I could use another key, but there was much upheavel on what key to use.(I'd still suggest Z))
Regards.
NukeBuster
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !
OpenTTD patch(es): Password at join
Re: 45° rotated rectangle clearing / leveling patch
The CTRL was used in the another terrain modificaztion patch for "drawing" the terrain, so in that mode you have ordinary levelling and with Ctrl drawing, in the new "diagonal" mode you could have still ordinary levelling and with ctrl 45 degrees rotated levelling. Since IMHO moere people woudl use then 45 rotated levelling, perhaps it can be even the 'default' with old keyboard shortcut and the freedraw mode will get 'Z' as shortcut (or let people configure it in patches)
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
-
- Chairman
- Posts: 776
- Joined: 20 Jan 2007 12:08
- Location: Germany
Re: 45° rotated rectangle clearing / leveling patch
I agree with that. I have never missed that freedraw mode (I don't want to say it isn't useful for others, especially in the scenario editor which I have never really used), but I miss diagonal leveling almost every time I build diagonal rails.Bilbo wrote:Since IMHO more people woudl use then 45 rotated levelling, perhaps it can be even the 'default' with old keyboard shortcut and the freedraw mode will get 'Z' as shortcut (or let people configure it in patches)
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
- kyosuke1989
- Transport Coordinator
- Posts: 273
- Joined: 24 Mar 2008 13:04
- Location: Finland
Re: 45° rotated rectangle clearing / leveling patch
When this patch was integrated in trunk?
Projects in progress: Finnish Trainset (DevZone)| Finnish Rail Infrastructure and Stations Set (DevZone)
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: 45° rotated rectangle clearing / leveling patch
http://hg.openttd.org/openttd/trunk.hg/log?rev=diagonal leads to 13 December 2010kyosuke1989 wrote:When this patch was integrated in trunk?
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
Who is online
Users browsing this forum: No registered users and 1 guest