My patch(es) (place house manually)
Moderator: OpenTTD Developers
-
- Tycoon
- Posts: 1283
- Joined: 23 Oct 2009 19:35
- Location: Here and there, sometime or another
My patch(es) (place house manually)
I've completely given up that old patch and made something more immediately useful - a mechanism for placing single houses in the scenario editor. It's attached as a diff against r22277, with a screenshot. The only thing I haven't been able to figure out yet is how to show a preview of the house being built.
--------------------------------------------------------------------------------------
This patch converts Toyland to a "real" world map, with rainforests, deserts, snow and(not really represented)savanna areas. It is unfinished, I do not think I will work much more on it, so I hereby present it to anyone who wants to take it up.
--------------------------------------------------------------------------------------
This patch converts Toyland to a "real" world map, with rainforests, deserts, snow and(not really represented)savanna areas. It is unfinished, I do not think I will work much more on it, so I hereby present it to anyone who wants to take it up.
- Attachments
-
- real_toyland.patch
- Old landscape patch for r19547
- (32.83 KiB) Downloaded 293 times
-
- Screenshot of house builder
- screenshot.png (57.04 KiB) Viewed 2072 times
-
- house_placing_r22277.diff
- Allow manual house construction
- (23.07 KiB) Downloaded 361 times
Last edited by oberhümer on 16 May 2011 01:22, edited 3 times in total.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
-
- Tycoon
- Posts: 1829
- Joined: 10 Jul 2006 00:43
- Location: Spain
Re: Turn Toyland into semi-realistic world landscape(UNFINISHED)
Do You have a screenshot?
Sorry if my english is too poor, I want learn it, but it isn't too easy.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
-
- Tycoon
- Posts: 1283
- Joined: 23 Oct 2009 19:35
- Location: Here and there, sometime or another
Re: Turn Toyland into semi-realistic world landscape(UNFINISHED)
Here. Normal trees are arctic, savanna trees temperate(for whatever reason).
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
Re: Turn Toyland into semi-realistic world landscape(UNFINISHED)
Why is there a long rectangular strip of snow at sea level?
- SwissFan91
- Tycoon
- Posts: 2399
- Joined: 08 Feb 2009 18:36
- Location: Alberta, Canada
Re: Turn Toyland into semi-realistic world landscape(UNFINISHED)
INteresting concept, I'd like to see how this develops.
Re: Turn Toyland into semi-realistic world landscape(UNFINISHED)
My guess would be that the world generation looks like (from north west to bottom east): temperate - savanna - desert - savanna - temperate. The grfs did not support the savannah, so graphics are not correct, but this was to illustrate the idea. Again, this is what I'm guessing.lawton27 wrote:Why is there a long rectangular strip of snow at sea level?
Re: Turn Toyland into semi-realistic world landscape(UNFINISHED)
If so I would suggest via height, lowest level jungle, then desert, temperate, arctic, combined with more hight levels patch you could have a huge fun and varied game.
Re: Turn Toyland into semi-realistic world landscape(UNFINISHED)
lawton27 wrote:Why is there a long rectangular strip of snow at sea level?
oberhümer wrote: Unfinished/unattempted:
- Separation of snow and desert code, so desert is not also drawn as snow
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: Turn Toyland into semi-realistic world landscape(UNFINISHED)
Concept looks interesting, hope to see an stable/corrected version soon.
Keep up the good work.
Keep up the good work.
! Hanno's Goal & Quest's > 1980 ~ 2000 < ! -> 1.0.1 Goal & Quests.
! Hanno's 1.0.2 Testing > 1980 ~ 2000 < ! | -> 1.0.2 Goal & Quests.
! Hanno's 1.0.2 Testing > 1980 ~ 2000 < ! | -> 1.0.2 Goal & Quests.
-
- Tycoon
- Posts: 1283
- Joined: 23 Oct 2009 19:35
- Location: Here and there, sometime or another
Re: My patch(es) (place house manually)
I created another patch, see the first post.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
Re: My patch(es) (place house manually)
Wow, this looks great. I'm one of those freaks who tries to design towns down to almost every single house when making scenarios. This would save me an awful lot of time. Hopefully this will get included in Chill's patchpack soon.
Re: My patch(es) (place house manually)
Would it not have been better to create a new thread, somehow I do not see the relationship between the old patch and this new.oberhümer wrote: I created another patch, see the first post.
The aim for any patch should be trunk inclusion and not some patchpack.Nagyzee wrote: Hopefully this will get included in Chill's patchpack soon.

Anyway,
I do like the idea of selecting houses and being able to build them ... but , without wanting to be rude (my coding is far from perfect neither), I can/will not include it in its current form for the following reasons.
- I have the feeling that at least 1 new file is missing in the patch as is ...
-- Five new strings are defined in english.txt but none are used in the attached version.
-- WC_BUILD_HOUSE is declared but there is no discription in the patch of this new window.
- There is lots of outcommented code in town_cmd.cpp ... because the outcommenting is not commented, outcommented means ¿not functional? ¿not needed? ¿buggy? (strike as needed.)
- The previewing of houses does not function yet, as stated in the first post.
Code: Select all
+ if (Town::GetNumItems() == 0) return_cmd_error(STR_ERROR_MUST_FOUND_TOWN_FIRST);
Maybe some more after viewing the complete patch ...
Note:I can not comment on the functionality because I have not tested yet and I only had a quick look at the code.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
-
- Tycoon
- Posts: 1283
- Joined: 23 Oct 2009 19:35
- Location: Here and there, sometime or another
Re: My patch(es) (place house manually)
Anyway, here's a binary, split into two parts because it is too big to attach as one file. 7-Zip is able to open it if you remove the ".txt" at the end.
- Attachments
-
- bundle.zip.001.txt
- (5 MiB) Downloaded 234 times
-
- bundle.zip.002.txt
- (3.39 MiB) Downloaded 306 times
Last edited by oberhümer on 16 May 2011 01:35, edited 2 times in total.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
-
- Tycoon
- Posts: 1283
- Joined: 23 Oct 2009 19:35
- Location: Here and there, sometime or another
Re: My patch(es) (place house manually)
Yes, there is none... I just want to keep everything together.ChillCore wrote:Would it not have been better to create a new thread, somehow I do not see the relationship between the old patch and this new.
Not anymore.ChillCore wrote: - I have the feeling that at least 1 new file is missing in the patch as is ...
Fixed that too.ChillCore wrote: - There is lots of outcommented code in town_cmd.cpp ... because the outcommenting is not commented, outcommented means ¿not functional? ¿not needed? ¿buggy? (strike as needed.)
I think you're misunderstanding something here, what that code checks for is how many towns there are in the town pool.ChillCore wrote:- It is perfectly possible to create a town and delete all houses and roads that belong to it without deleting it completely ... The error message is IMHO incorrect as the town already exist, else you would not be able to check properties of it?Code: Select all
+ if (Town::GetNumItems() == 0) return_cmd_error(STR_ERROR_MUST_FOUND_TOWN_FIRST);
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
Re: My patch(es) (place house manually)
Okidoki, it is your thread and more people have done that before ... I just do not see the advantage or the point of doing that.oberhümer wrote:Yes, there is none... I just want to keep everything together.ChillCore wrote: Would it not have been better to create a new thread, somehow I do not see the relationship between the old patch and this new.
Thank you for replacing the patch with the complete version.Not anymore.- I have the feeling that at least 1 new file is missing in the patch as is ...
Will give it a spin tomorrow.

Thank you.Right, I'll fix that.- There is lots of outcommented code in town_cmd.cpp ... because the outcommenting is not commented, outcommented means ¿not functional? ¿not needed? ¿buggy? (strike as needed.)
I think you're misunderstanding something here, what that code checks for is how many towns there are in the town pool.- It is perfectly possible to create a town and delete all houses and roads that belong to it without deleting it completely ... The error message is IMHO incorrect as the town already exist, else you would not be able to check properties of it?Code: Select all
+ if (Town::GetNumItems() == 0) return_cmd_error(STR_ERROR_MUST_FOUND_TOWN_FIRST);

-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
-
- Tycoon
- Posts: 1283
- Joined: 23 Oct 2009 19:35
- Location: Here and there, sometime or another
Re: My patch(es) (place house manually)
Can anybody explain why this function only draws the ground sprite of the (NewGRF) house, and the one of the first building stage at that? (tested with Swedish Houses)
Code: Select all
void DrawNewHouseTileInGUI(int x, int y, HouseID house_id)
{
HouseSpec *hs = HouseSpec::Get(house_id);
const SpriteGroup *group;
ResolverObject object;
NewHouseResolver(&object, house_id, INVALID_TILE, NULL);
group = SpriteGroup::Resolve(hs->grf_prop.spritegroup[0], &object);
if (group == NULL || group->type != SGT_TILELAYOUT) return;
const DrawTileSprites *dts = ((const TileLayoutSpriteGroup *)group)->dts;
SpriteID image = dts->ground.sprite;
PaletteID pal = dts->ground.pal;
if (GB(image, 0, SPRITE_WIDTH) != 0) {
DrawSprite(image, GroundSpritePaletteTransform(image, pal, PAL_NONE), x, y);
}
const TileLayoutSpriteGroup *tlgroup = (const TileLayoutSpriteGroup *)group;
/* Limit the building stage to the number of stages supplied. */
byte stage = (byte )TOWN_HOUSE_COMPLETED;
// stage = Clamp(stage - 4 + tlgroup->num_building_stages, 0, tlgroup->num_building_stages - 1);
DrawNewGRFTileSeqInGUI(x, y, dts, stage, PAL_NONE);
}
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
Re: My patch(es) (place house manually)
@oberhümer
Is this patch save game (or saved scenario) compatible with trunk btw? I clearly remember that the fantastic Cindini map was partly done with the help of a house placer patch like yours which was compatible with unpatched OTTD. So I thought maybe this one is compatible, too.
@ChillCore:
Of course all patches should strive for inclusion in trunk but for me it makes little difference whether it gets included into your patchpack or into trunk as I play your patchpack exclusively. Or rather, I use its scenario editor as it takes a lot of time to design scenarios I'm satisfied with.
Is this patch save game (or saved scenario) compatible with trunk btw? I clearly remember that the fantastic Cindini map was partly done with the help of a house placer patch like yours which was compatible with unpatched OTTD. So I thought maybe this one is compatible, too.

@ChillCore:
Of course all patches should strive for inclusion in trunk but for me it makes little difference whether it gets included into your patchpack or into trunk as I play your patchpack exclusively. Or rather, I use its scenario editor as it takes a lot of time to design scenarios I'm satisfied with.

Re: My patch(es) (place house manually)
I've been toying around with your house placer patch lately. While doing so I've run into problems. So far I have found the following:
Sets from which houses can be placed with your patch without serious problems (at least I haven't had serious problem with them yet):
- Swedish Houses (1.1) - Ran into the minor problem of the original 1x1 church showing up when placing one of the 2x2 shopping areas once (this problem was also gone after a restart of OTTD, see below), nothing else yet
- ECS Houses
(- original houses)
Weird behaviour:
- TTRS (both 3.02 and 3.11) - Sometimes I can't place any of its buildings, sometimes I can place most except for a select few that can't be placed at all, and a few that show up incorrectly (for example some of the statues in the set show up as the original fountain or the original statue)
- Japanese Buildings (v2.0) - Sometimes I can place everything without a problem, sometimes nothing, sometimes only 4-5 buildings of the set show up on the list and I can't build even those...
- Houses in Alpine climate - Sometimes I can't place any of its buildings, sometimes I can place all without a problem
- Suburban Renewal Houses (v0.11) - Same as with Alpine
I've tested the problematic newgrfs in the scenario editor completely alone, no other newgrfs loaded whatsoever. The weirdest thing is that sometimes a simple restart of the game changes the behaviour. For example when I couldn't build houses from the Japanese Buildings set I simply quit the program, started it up again and then it worked correctly. Problems seem to occur more likely if newgrf settings in the main menu have been changed since the last restart of the program.
A typical example:
I'm working in the scenario editor with a set of grfs. I quit the editor, change the newgrf list to include only say TTRS then I start a new map in scenario editor. In this case I most often can't place TTRS buildings in the editor. If then I shut down the program, restart it and go straight to the editor without touching anything else then most often I can place TTRS houses. It's as if newgrf setting changes don't register till a restart.
Edit:
Just tried TTRS and Swedish Houses together (TTRS first in the list). Even after a restart I can't build any of the Swedish houses. From the TTRS houses I can build most except for the last 5-6 or so on the list. It seems the problems are universal, not newgrf-specific.
Sets from which houses can be placed with your patch without serious problems (at least I haven't had serious problem with them yet):
- Swedish Houses (1.1) - Ran into the minor problem of the original 1x1 church showing up when placing one of the 2x2 shopping areas once (this problem was also gone after a restart of OTTD, see below), nothing else yet
- ECS Houses
(- original houses)
Weird behaviour:
- TTRS (both 3.02 and 3.11) - Sometimes I can't place any of its buildings, sometimes I can place most except for a select few that can't be placed at all, and a few that show up incorrectly (for example some of the statues in the set show up as the original fountain or the original statue)
- Japanese Buildings (v2.0) - Sometimes I can place everything without a problem, sometimes nothing, sometimes only 4-5 buildings of the set show up on the list and I can't build even those...
- Houses in Alpine climate - Sometimes I can't place any of its buildings, sometimes I can place all without a problem
- Suburban Renewal Houses (v0.11) - Same as with Alpine
I've tested the problematic newgrfs in the scenario editor completely alone, no other newgrfs loaded whatsoever. The weirdest thing is that sometimes a simple restart of the game changes the behaviour. For example when I couldn't build houses from the Japanese Buildings set I simply quit the program, started it up again and then it worked correctly. Problems seem to occur more likely if newgrf settings in the main menu have been changed since the last restart of the program.
A typical example:
I'm working in the scenario editor with a set of grfs. I quit the editor, change the newgrf list to include only say TTRS then I start a new map in scenario editor. In this case I most often can't place TTRS buildings in the editor. If then I shut down the program, restart it and go straight to the editor without touching anything else then most often I can place TTRS houses. It's as if newgrf setting changes don't register till a restart.
Edit:
Just tried TTRS and Swedish Houses together (TTRS first in the list). Even after a restart I can't build any of the Swedish houses. From the TTRS houses I can build most except for the last 5-6 or so on the list. It seems the problems are universal, not newgrf-specific.
-
- Tycoon
- Posts: 1283
- Joined: 23 Oct 2009 19:35
- Location: Here and there, sometime or another
Re: My patch(es) (place house manually)
Just checked it out, and I have absolutely no idea.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---
--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
-
- Tycoon
- Posts: 1534
- Joined: 14 Mar 2006 12:46
- Location: Netherlands
Re: My patch(es) (place house manually)
i took the liberty of updating patch to r24018:
not sure on crashes/errors, i just ported it over, no extra features or stuff added yet, just check if it works and give some feedback if you can:)
not sure on crashes/errors, i just ported it over, no extra features or stuff added yet, just check if it works and give some feedback if you can:)
Who is online
Users browsing this forum: No registered users and 15 guests