-
-
Notifications
You must be signed in to change notification settings - Fork 844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Allow manually placing town buildings in scenario editor. #12661
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great feature. A few thoughts:
- Adding this to Scenario Editor first and then adding it to normal gameplay as a later PR makes sense.
- Adding the button to the object toolbar works, but another option (which might make more sense) is adding it to the Town button dropdown. In SE there is no dropdown since there's only one option, but in-game you long-click the Town button to open a dropdown containing
Town directory
andFound town
. This is where I would expect to findBuild houses
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd still prefer to see this accessed from a dropdown in the town button of the main toolbar, but if you feel strongly otherwise I'm open to having my mind changed. 😄
src/town_cmd.cpp
Outdated
|
||
TileIndex origin_tile = tile; | ||
if (hs->building_flags & TILE_SIZE_2x2) { | ||
if (!CheckTownBuild2x2House(&tile, t, maxz, noslope)) return_cmd_error(STR_ERROR_CAN_T_CLEAR_THIS_AREA); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this (and the others nearby) return the error string STR_ERROR_CAN_T_BUILD_HOUSE
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's a sub-error, although actually it was an incorrect string for a sub-error.
So I've changed this instead to actually call CMD_CLEAR for each tile to get a decent error message.
I've moved it to a toolbar menu now so you can try it. Although after doing so I noticed that JGRPP has a house picker in the same spot as it was, heh... |
Oh yes, I like the toolbar placement much better than in the landscaping toolbar. 😃 |
This could previous be done but only with a town and tile in mind, but for drawing in the UI, neither of those exist yet.
House picker is accessed from the Landscaping toolbar as there is no town toolbar. Once placed these houses behave like any other and can be removed by players and towns. Uses the unified picker system, so also supports used/saved favourites. As town building don't have class labels, town zones are use to imitate them.
Grouping by NewGRF is something that could equally be applied to all the build pickers, in which case it would be an additional filter. I'm not sure how that will fit in the UI yet, but that's why I didn't make the class-list behave as a NewGRF filter here.
It's just part of the standard picker interface.
Because currently if it's not expandable then the window can't be made taller. When we add an extra information panel below it then that can change.
Correct, this is a bare-minimum of an interface. There is a preview -- it's in the main list, just like when picking Waypoints.
Good point, this can probably go. I probably got carried away that it was easy to implement...
The variant is completely impossible to choose*, as it's based on the tile position on the map. Deleting and replacing a building will not change the variant on that tile. Not all house types have variant either. *I guess the 2 random bits derived from tile posiition could instead be stored on the map instead, but we know people hate random data being stored...
I don't intend to enable placing houses in normal gameplay mode. I do intend for it to be available as a sandbox setting for those players who enjoy this. Gameplay-wise, being able to manually place buildings would conflict with existing town and local authority behaviour, and I don't think it makes sense to try to shoe-horn this in. After all, this is OpenTTD, not SimCity. |
Motivation / Problem
Very little manual control over where houses are placed in towns. This is mostly to be expected as the game is meant to manage towns itself, however some manual control in the Scenario Editor (and perhaps a Sandbox mode) might be useful.
Description
Once placed these houses behave like any other and can be removed by players and towns.
Uses the unified picker system, so also supports used/saved favourites. As town building don't have class labels, town zones are use to imitate them.
Houses sometimes have up to 4 variations, selected psuedo randomly based on tile. The House Selection window does not provide a way to choose between these, as there is no manual control, so in order to represent them in the UI it will cycle through each variation every 2.5 seconds.
"Some highly advanced town planning"
More of the same, with NewGRFs...
Limitations
This is limited to Scenario Editor only. No sandbox mode as been implemented as the Sandbox Settings window is still using the old cheats system.
Once that is changed to use normal settings, not much effort is required to enable this.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.