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 upConvert braziers from traps to furniture #21321
Conversation
Night-Pryanik
added some commits
Jun 27, 2017
This comment has been minimized.
This comment has been minimized.
|
That simplifies things. Though one thing I'd rather keep: the ability to deploy it with an action. Save migration of old trap braziers to the new furniture ones, however, is mandatory. |
Coolthulhu
reviewed
Jun 27, 2017
| { "item": "sheet_metal", "count": [0, 2] }, | ||
| { "item": "scrap", "count": [2, 3] }, | ||
| { "item": "steel_chunk", "count": [1, 2] } | ||
| ] |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 27, 2017
Contributor
Why does it deconstruct into parts instead of back into brazier?
This comment has been minimized.
This comment has been minimized.
Night-Pryanik
Jun 27, 2017
•
Author
Member
I wasn't sure which path is better - deconstruct it to brazier item or directly to components. Now that you mention it, I'll change it.
This comment has been minimized.
This comment has been minimized.
You mean through creating legacy file, putting deleted info from traps.json to it, and then raising game core version? |
This comment has been minimized.
This comment has been minimized.
If you do it that way, you will also need to restore the handling in fields.cpp, preferably with a comment indicating that it's only for pre-0.D saves. |
This comment has been minimized.
This comment has been minimized.
Is there other way to do migration? |
This comment has been minimized.
This comment has been minimized.
|
You could also detect it in mapbuffer.cpp, in the |
This comment has been minimized.
This comment has been minimized.
|
So now we will need a hammer and screwdriver to take down a brazier? |
This comment has been minimized.
This comment has been minimized.
Yes, like all furniture. |
This comment has been minimized.
This comment has been minimized.
That is a problem, yes. I attempted to devise code to allow taking down select furniture without tools, but was unable to devise an effective way to implement it. |
This comment has been minimized.
This comment has been minimized.
This means that if I'm standing near brazier trap, save game, make changes in mapbuffer and compile, then trap will convert to furniture after I load a save? |
This comment has been minimized.
This comment has been minimized.
Yes. |
This comment has been minimized.
This comment has been minimized.
|
Is there any way to make furniture carryable? |
This comment has been minimized.
This comment has been minimized.
|
You have to add a method to transform the furniture into an item. |
This comment has been minimized.
This comment has been minimized.
|
For this I would suggest that @Night-Pryanik attempt to implement some method of easier deconstruction (as I tried to in #18346). |
This comment has been minimized.
This comment has been minimized.
|
Implementing it on an |
This comment has been minimized.
This comment has been minimized.
|
@Coolthulhu I think mapbuffer way you mentioned is much more cleaner than legacy way, but I'm afraid I'm doing something wrong while trying to implement it. Could you or anyone else please help me here?
But this doesn't seems to work. |
This comment has been minimized.
This comment has been minimized.
|
"jsin" looks suspiciously like a typo for "json"... |
This comment has been minimized.
This comment has been minimized.
|
What do you mean "doesn't seem to work"? Doesn't compile or doesn't do what it should? If it fails to compile at
try wrapping the string in an ID so that you compare and ID with an ID. |
This comment has been minimized.
This comment has been minimized.
|
It successfully compiles, but doesn't convert trap to furniture. |
This comment has been minimized.
This comment has been minimized.
|
I've taken a save from my old game, where character is standing next to brazier trap. I've copied this save to my branch where brazier is furniture and no trace of tr_brazier at all. I loaded this save and it does not give me any errors at the start. |
This comment has been minimized.
This comment has been minimized.
|
Oh, I see it now. Why do you iterate over the whole submap? You only need to replace this line:
with something like
|
Night-Pryanik
added some commits
Jun 29, 2017
Coolthulhu
reviewed
Jun 29, 2017
| sm->frn[i][j] = furn_id( "f_brazier" ); | ||
| } else { | ||
| sm->trp[i][j] = trid.id(); | ||
| } |
This comment has been minimized.
This comment has been minimized.
Coolthulhu
Jun 29, 2017
Contributor
Also comment the conversion, with something like @todo: remove after 0.D.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
It worked! Thanks @Coolthulhu. As for deconstructing selected furniture don't require screwdriver and hammer - I think it should be in some other PR. The same for carryable furniture. |
This comment has been minimized.
This comment has been minimized.
Depending on what others say, it may be required for those PRs to happen first. |
This comment has been minimized.
This comment has been minimized.
I do advocate in favor of some way to take down braziers without using deconstruction. Though I will admit that is not just because it avoids a regression in player convenience, but due to how useful the feature would be for other purposes. |
This comment has been minimized.
This comment has been minimized.
|
It's actually just "code aware copy+paste" tier in difficulty of writing (both deployment and taking down), the only problem here is the feature freeze. |
This comment has been minimized.
This comment has been minimized.
|
This doesn't fix #21283. That issue is about stoves, not braziers. The thing about converting braziers is a side issue, and a very minor one at that. Disassembly requiring arbitrary new tools for braziers is an unacceptable regression for the release, feel free to implement it in a new PR, but this one should not be merged until that is available. Frankly I don't see merging this before 0.D as it doesn't fix a major issue. |
This comment has been minimized.
This comment has been minimized.
That's not about disassemble, but about deconstruction. As for #21283, you are right, I was wrong. But if this PR is not a fix for this issue, but a standalone feature, will this have a chance to get merged? |
This comment has been minimized.
This comment has been minimized.
|
It's a very minor feature addition (make brazier draggable), so its not going to be accepted if it has any kind of regression (i.e. requiring tools to didassemble deployed brazier). |
This comment has been minimized.
This comment has been minimized.
|
Is this a right way to avoid regression? |
This comment has been minimized.
This comment has been minimized.
|
Is it really that simple, just adding a new flag for |
This comment has been minimized.
This comment has been minimized.
|
I just tested this change. It does indeed work as expected. I will make use of this as soon as I am able to. |
Night-Pryanik commentedJun 27, 2017
•
edited
churches (New England and Gothic styles), campsites, strange cabin, standing stones, cathedral and mapgen-test;FIRE_CONTAINERflag in field.cpp;