Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow "repeat" for character-map placement of items #28723
Conversation
ralreegorganon
added
<Documentation>
Mapgen
[C++]
<Bugfix>
labels
Mar 15, 2019
ralreegorganon
force-pushed the
ralreegorganon:mapgen-repeat
branch
from
186b862
to
ddf8b62
Mar 15, 2019
This comment has been minimized.
This comment has been minimized.
|
It warms my heart to know that my project to increase item spawns isn't going to have nearly as much work to do as I'd thought. |
ZhilkinSerg
self-assigned this
Mar 15, 2019
ZhilkinSerg
merged commit ffa79fd
into
CleverRaven:master
Mar 15, 2019
ZhilkinSerg
removed their assignment
Mar 15, 2019
This comment has been minimized.
This comment has been minimized.
|
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/8604-win-tiles-possible-item-spawn-bug-in-mansion/19309/3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
ralreegorganon commentedMar 15, 2019
Summary
SUMMARY: Bugfixes "Allow 'repeat' for character-map placement of items"
Purpose of change
All over the mapgen json, map developers have been attempting to have item placement repeat, like this:
One problem: repeat on a character-map based placement of items doesn't do anything.
"repeat"is completely ignored. The item spawn is only attempted once.To make matters more confusing for map developers, if you used the
place_itemsversion of it like the following, it did work:I'm sure this has led to confusion, inappropriately balanced item spawns, and users experiencing something other than what map developers intended. For example, these two variations above are both taken from the same mapgen file for the bank. Ever feel like the one bank variant has a lot more loot in the vault than the other? This is why.
Describe the solution
jmapgen_piececlass to have a repeat property (defaulted to 1)jmapgen_item_groupandjmapgen_spawn_itemclasses to load this propertyjmapgen_objects::applymethod to consider the repeat property when determining the number of times to repeat the apply call of the pieceAdditional context
The mapgen json is full of cases of
repeatbeing used to place items that was not actually doing anything--once this is merged, it'll start actually working. In general, that'll mean more items spawning everywhere that used this.