Page 2 of 5

Re: [patch]Picking and placing single houses in scenario edi

Posted: 03 Aug 2015 18:51
by adf88
Confirmed and fixed (it was a false-positive).

Re: [patch]Picking and placing single houses in scenario edi

Posted: 15 Aug 2015 10:24
by Whopper
Great work so far guys!
Unfortunately it's still quite unworkable because most buildings can't be placed in the areas I want them to.
Would it be possible to remove all the restrictions on placing buildings?

And it seems the game crashes a lot when using eyecandy as well in the map editor ...
Attached the error code.

Re: [patch]Picking and placing single houses in scenario edi

Posted: 29 Aug 2015 07:37
by adf88
Whopper wrote:Unfortunately it's still quite unworkable because most buildings can't be placed in the areas I want them to.
I'm working on it. In the next version I'll give possibility to ignore the town zones when placing houses. Also I'll allow to check what's the town zone on a given tile.

Another thing I'm planning is to give some extra information to CBID_HOUSE_CONSTRUCTION NewGRF callback (this callback decides whether a house can be placed on a given tile). The information will tell whether the house is being placed manually or not. NewGRF makers are sometimes quite restrictive on house location and the callback frequently disallows a house to be built. This approach is required to control town layouts while they grow. However, manual placement is something different and the callback should be less restrictive. Unfortunately you will have to wait a bit for this feature - the patch must get into the trunk (if ever) and GRF makers must update their town sets.

Re: [patch]Picking and placing single houses in scenario editor

Posted: 04 Sep 2015 11:34
by adf88
oberhümer wrote:Minor update to r27356. And an uninitialized variable warning...
Whopper wrote:And it seems the game crashes a lot when using eyecandy as well in the map editor ...
Attached the error code.
There is a bug in the patch from oberhümer. It reveals itself when you open booth the "place object" tool and the "place house" tool - just don't do this ;)
http://www.tt-forums.net/download/file.php?id=186856
Basically the "place object" window couldn't coexist with "place house" window before. I'm aware of a recent change in the trunk about the "place object" window (it's not a PickerWindowBase anymore) and that's probably the cause of the problems.

EDIT: it's actually a trunk bug, not related to the patch

New version of the patch (I'm working on it) should be just fine.

Re: [patch]Picking and placing single houses in scenario editor

Posted: 19 Sep 2015 16:02
by cirdan
I am considering merging this patch into my fork. Do you have a public repository with your code, other than the patch sequence attached to the first post in this thread? Otherwise, what author information should I use for your code? (Git requires a valid e-mail address for the author of a commit.)

Re: [patch]Picking and placing single houses in scenario editor

Posted: 20 Sep 2015 04:04
by adf88
No, I don't have a public repository. But you can use this address: "adf88[obvious character]interia.pl"

Re: [patch]Picking and placing single houses in scenario editor

Posted: 22 Sep 2015 19:41
by cirdan
Thank you. Note that your address will appear (unobfuscated) in my public repository. Is this fine with you?

Re: [patch]Picking and placing single houses in scenario editor

Posted: 23 Sep 2015 05:37
by adf88
That's OK.

Re: [patch]Picking and placing single houses in scenario editor

Posted: 04 Oct 2015 19:28
by cirdan
I have merged this patch into my branch; details here. I decided to only add the ability to build houses from the scenario editor, and not from a game script, for the time being, and to lift some building restrictions, such as town zones. I also had to rewrite some parts of the code due to divergences between openttd revision 26400 (against which your latest patch was created) and current trunk, and then between openttd trunk and my branch. Still, most of the work is yours, and I wanted to commend you for such a nicely written patch.

There are some issues I found during review, in case you want to fix them in a future version of your patch:
  • In patch 230, file src/terraform_gui.cpp, hunk 5

    Code: Select all

    @@ -711,6 +726,8 @@
                    this->RaiseButtons();
                    this->SetDirty();
                    DeleteWindowById(WC_BUILD_OBJECT, 0);
    +               DeleteWindowById(WC_BUILD_HOUSE, 0);
    +               DeleteWindowById(WC_SELECT_STATION, 0);
            }
     
            static HotkeyList hotkeys;
    I think that there is a typo and "WC_SELECT_STATION" should be "WC_SELECT_TOWN". (Note however that openttd trunk has changed the object selection window to a standalone window, so you may want to do the same for the house selection window as I did.)
  • The town selection window is not properly invalidated when towns are created or removed; doing so in the editor while the window is open may lead to weird strings displayed or even crashes.
  • Sprite offsets in the default house set are not applied correctly when drawing in the selection window; this is most noticeable with statues. Also, GUI zoom seems to be ignored; look here for how I modified DrawOldHouseTileInGUI.

Re: [patch]Picking and placing single houses in scenario editor

Posted: 16 Feb 2016 15:22
by openbu.org
Great. :bow:
place houses manually in multiplay games.

Re: [patch]Picking and placing single houses in scenario editor

Posted: 16 Feb 2016 19:15
by Streckenläufer
WC_SELECT_TOWN gives a crash, when clicking on ... see picture
WC_SELECT_STATION is ok.

Re: [patch]Picking and placing single houses in scenario edi

Posted: 27 Feb 2016 00:14
by Streckenläufer
adf88 wrote:I'm working on it. In the next version I'll give possibility to ignore the town zones when placing houses. Also I'll allow to check what's the town zone on a given tile.
Hello adf88 is already canceled this dependence?

Re: [patch]Picking and placing single houses in scenario editor

Posted: 11 Mar 2016 07:30
by adf88
Yes, new version is almost ready. Grab an unofficial alpha if you wish.

Re: [patch]Picking and placing single houses in scenario editor

Posted: 12 Mar 2016 00:06
by Streckenläufer
Hello adf88,

did everything meticulously applied by hand, get the following error.
town_land.h line: 2276? (see Appendix)

Re: [patch]Picking and placing single houses in scenario editor

Posted: 20 Mar 2016 09:04
by adf88
OK, now my compiler is sensitive to narrowing conversions and I did remove the issue.

// EDIT
Something went wrong with the upload. The file is updated now.

Re: [patch]Picking and placing single houses in scenario editor

Posted: 25 Mar 2016 01:33
by b1tm4rx1st
On what version do i have to apply thepatch?

I would love the custom house placing and funding options...


version=r27356?

Code: Select all

svn update -r 27356
Skipped '.'
Summary of conflicts:
  Skipped paths: 1

And can someone tell me where i can get the correct version? and how to apply the diffs to it.. (ubuntu 14.04 r higher)

Compiling from source works ok but i cant download the correct version and cause of that i cant apply the diff correctly

And yes i saw these links:
https://wiki.openttd.org/Compiling_on_( ... install_it

i can apply the diffs (above this post) to 27525 but then i have the problem that i dont see any houses... and the windows of house placing works but there is no button showing up in it
Does this patch get injected in the main version in the future?

Re: [patch]Picking and placing single houses in scenario editor

Posted: 25 Mar 2016 06:29
by adf88
r27523 but 27525 should be fine too. Make sure you cleaned up everything correctly. Also have in mind that this is just a "work in progress". Official release will be soon (download at front page of this thread).

Re: [patch]Picking and placing single houses in scenario editor

Posted: 25 Mar 2016 15:35
by b1tm4rx1st
27523 works but while compiling i got these errors

Code: Select all



[/In file included from /openttd/src/saveload/oldloader_sl.cpp:36:0:
/openttd/src/saveload/../table/townname.h:1840:29: warning: ‘_name_czech_subst_stem’ defined but not used [-Wunused-variable]
 static const CzechNameSubst _name_czech_subst_stem[] = {
                             ^
/openttd/src/saveload/../table/townname.h:1893:29: warning: ‘_name_czech_subst_ending’ defined but not used [-Wunused-variable]
 static const CzechNameSubst _name_czech_subst_ending[] = {
                             ^
And when im in game and want to start a new scenario ive got the error there is no space for placing some towns xD

Re: [patch]Picking and placing single houses in scenario editor

Posted: 25 Mar 2016 15:58
by Leanden
Are savegames made with this patch compatible with trunk?

Re: [patch]Picking and placing single houses in scenario editor

Posted: 25 Mar 2016 19:02
by b1tm4rx1st
Leanden wrote:Are savegames made with this patch compatible with trunk?
so far as i know yes... there were some scenarios that were compatible... but ur world gets really fast messed up if you dont change the grow settings of a city to no growth...