Cataclysm-dda: Recipe loaded on e-ink tablet screen is not available in crafting menu

Created on 25 Apr 2018  路  6Comments  路  Source: CleverRaven/Cataclysm-DDA

Game version:

0.C-27466-gca7d9b3

Operating system:

Windows 10

Tiles or curses:

Tiles

Mods active:

  • Dark Days Ahead
  • Filthy Clothing
  • Disable NPC NEeds
  • Simplified Nutrition
  • Bionic Systems Mod
  • Craftable Gun Pack
  • Makeshift Items Mod
  • Medieval and Historic Weapons Content
  • Beta National Guard Camp
  • Vehicle Additions Pack
  • Tanks and Other Vehicles
  • Boats

Expected behavior

Recipe loaded on e-ink tablet should show in crafting menu when the tablet meets the other usual circumstances for recipes from books being added to the crafting menu.

Actual behavior

It does not.

Steps to reproduce the behavior

  1. ensure no book with recipe in range, and that recipe is not already memorized
  2. e-ink tablet loaded with recipe (onboard chemistry lab is the recipe in question)
  3. ensure skills at high enough level (electronics 3 here, the character in question has 5)
  4. activate tablet, make sure recipe is displayed (fourth menu item is "Recipe: onboard chemistry lab")
  5. enter crafting menu, search for recipe by name, note no results
  6. find a book with the recipe ("What's a Transistor?" and "Under the Hood" were available in my test case), put it in range
  7. enter crafting menu, search for recipe by name, note single result
(S2 - Confirmed) <Bug> Crafting / Construction / Recipes Good First Issue Info / User Interface Items / Item Actions / Item Qualities

Most helpful comment

It was working at some point, this is the intended behaviour for e-ink tablets, and electronic readers in general.

Yes, seems to work in stable 0.C.


That's the code in 0.C that gets e-ink book recipes working:

https://github.com/CleverRaven/Cataclysm-DDA/blob/b5b4d4834970b78c76883cc5c66de07b3966aca4/src/player.cpp#L12436-L12463

But code with all that HAS_RECIPE and RECIPE tags is not in current version anymore. I first thought about #18633, but it happened to be #17494.

All 6 comments

Was it even working previously? When you select recipe on the E-Ink it just starts to be displayed on its menu, it is not being added to the list of your known recipes.

I can't answer to "working previously" because I usually go a while between builds and don't know if this existed before. To the rest, let me respond with this: The expectation I'm referring to in the report is that the tablet in range set to "show" the recipe in question would add to the list of craftable recipes the same way that a book in range adds recipes that are not memorized to your list of craftable recipes.

It was working at some point, this is the intended behaviour for e-ink tablets, and electronic readers in general.

It was working at some point, this is the intended behaviour for e-ink tablets, and electronic readers in general.

Yes, seems to work in stable 0.C.


That's the code in 0.C that gets e-ink book recipes working:

https://github.com/CleverRaven/Cataclysm-DDA/blob/b5b4d4834970b78c76883cc5c66de07b3966aca4/src/player.cpp#L12436-L12463

But code with all that HAS_RECIPE and RECIPE tags is not in current version anymore. I first thought about #18633, but it happened to be #17494.

Cooper was before the blame on this, so I'm guessing the "is_book" logic added to this broke it, unless there is a way that tablet types are modified at runtime that I don't know. https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/player.cpp#L9164-L9187

EDIT: And yes, according to ZhilkinSerg's edit, there is supplementary code that used to exist.

This seems straightforward-ish, the ereader maintains a string encoding all the recipes it "knows", the crafting code just needs to get at it. Mechanically that means decoding a comma-seperated string of recipe names and fixing up some other code. Stylistically that means adding an item::get_recipes() method because the crafting code has no business knowing the internals of how the recipes are stored.

Along with fixing it, I'm going to remove the "display a recipe on the ereader" feature, it's unnecessary.

Was this page helpful?
0 / 5 - 0 ratings