-
Notifications
You must be signed in to change notification settings - Fork 191
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
[quickfort] allow blueprints to specify bins/barrels/wheelbarrows for stockpiles #254
Conversation
in #place blueprints
fields.max_wheelbarrows = ntiles | ||
if max_wb < 0 then max_wb = 1 end | ||
if max_wb >= ntiles - 1 then | ||
fields.max_wheelbarrows = ntiles - 1 |
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 think this is the case, but just to confirm - you are directly setting this field, not sending keypresses to the game, right? Asking because tweak max-wheelbarrows
changes the in-game wheelbarrow UI (the vanilla UI uses w
to cycle through numbers and only goes up to 3), and it's not always obvious that this is a DFHack feature.
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.
That's right - the variable ui for setting wheelbarrows is the whole reason for this feature. This will set the wheelbarrow (and/or container) count programmatically
How should something like this be handled?
Currently the
so I'm not really sure what makes sense here. |
Good point. So the options are:
Not obvious to me which route is better. Ease of editing and maintenance, less clutter vs visual clarity of meaning. The same question will come up when I implement stockpile labels, which will allow disjoint sections to be considered part of the same stockpile. The problem gets even worse then because labels will be much longer than the numbers added here. The decision we make now will decide the implementation of that feature too. I'm leaning towards ignoring the numbers for purposes of boundary detection, mostly for its decluttering property, which will become even more important with labels. How to handle conflicting specifications, though? I'll come back and finish this thought in a bit. |
I should note that I expect most stockpile declarations to be in expansion syntax: |
Ok, conflicting specifications. Again, choices here will propagate to the future label feature. Option 1, log but ignore conflicts, just use one. Option 2, fail with parse error on conflict detection. Option 3, consider conflict as defining a separate stockpile. I'm thinking option 3 is most flexible. For each stockpile, each tile can have either no metadata or the same metadata as was declared elsewhere in the same stockpile. This allows the convenient method of only defining the metadata once, i.e.:
But also allows two adjacent, non-expansion syntax stockpiles to be differentiated:
Labels could make this a little more clear:
And of course labels would be able to differentiate the piles even if they were both
I think this will give the blueprint designer simple convenience in the more common case but will also provide the flexibility required for complex layouts. Thoughts? |
I've looked into the required code changes. It alters a basic assumption the code has had up to this point -- that the literal cell text is the boundary map key. This assumption goes deep enough that I think the planned changes are too risky to do without regression tests, especially so close to a major release. Since the proposed changes will be backwards compatible with the current implementation, how about if we merge this as-is, then I spend some time setting up automated regression tests, then make the changes after I'm more certain things won't break? edit: I updated the docs in DFHack/dfhack#1768 to explain how to specify container counts in stockpiles that do not use expansion syntax. |
I figured it would be complicated to make every possibility work well. Thanks for looking into it! I think DFHack/dfhack@3278519 is plenty good enough for now. I also don't expect stockpiles specified with non-expansion syntax and with custom container counts to be very common, so glad to hear that you agree. |
in #place blueprints.
syntax documentation in DFHack/dfhack#1768