# The Junk Food Zone: Full Metal Soda

**URL:** <https://discourse.cataclysmdda.org/t/the-junk-food-zone-full-metal-soda/24634>\
**Category:** The Garage\
**Created:** [September 1, 2020, 10:06pm UTC](https://discourse.cataclysmdda.org/t/the-junk-food-zone-full-metal-soda/24634 "2020-09-01T22:06:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AssumeCroons](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/assumecroons/32/8570_2.png) [@AssumeCroons](https://discourse.cataclysmdda.org/u/AssumeCroons)\
**Post date:** [September 1, 2020, 10:06pm UTC](https://discourse.cataclysmdda.org/t/the-junk-food-zone-full-metal-soda/24634/1 "2020-09-01T22:06:56Z")

</div>

Can a zone sort out junk food in containers?

A custom zone with “m: junk food” as its filter doesn’t match “aluminum can of cream soda”. The item falls through to be sorted by a later non-custom “drink” filter. Presumably, the item’s material is aluminum, which is not bad for you like junk food is.

As a fall-back, I have tried custom zone with a comma-delimited filter, intending to list each junk food individually, by name. This has not worked. Starting with no commas, a custom zone with only “cream soda” as its filter doesn’t match “aluminum can of cream soda” - the item also falls through to the “drink” zone.

---

<div class="post-metadata">

**Author:** ![Profugo\_Barbatus](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@Profugo\_Barbatus](https://discourse.cataclysmdda.org/u/Profugo_Barbatus)\
**Post date:** [September 2, 2020, 12:30am UTC](https://discourse.cataclysmdda.org/t/the-junk-food-zone-full-metal-soda/24634/2 "2020-09-02T00:30:42Z")

</div>

In my experience, soda never was categorized as junk food and was always categorized as ‘drink’, even before the containers overhaul. Can’t speak to why the custom filter gave up on it though, never tried those.

---

<div class="post-metadata">

**Author:** ![Valase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/valase/32/6972_2.png) [@Valase](https://discourse.cataclysmdda.org/u/Valase)\
**Post date:** [September 2, 2020, 1:43am UTC](https://discourse.cataclysmdda.org/t/the-junk-food-zone-full-metal-soda/24634/3 "2020-09-02T01:43:09Z")

</div>

> [@Profugo\_Barbatus](#):
>
> In my experience, soda never was categorized as junk food and was always categorized as ‘drink’, […]

I can verify at least for build #10950 that `cream soda` is “made” from the “material” `Junk Food` and the category is `Food`.  
Weirdly enough, in my test it also did not sort it into the drink zone, although I’m not running the newest experimental, so it might is fixed there… the only zone it would go to was food.

> [@AssumeCroons](#):
>
> As a fall-back, I have tried custom zone with a comma-delimited filter, intending to list each junk food individually, by name.

That’s really weird… Again, maybe a newer (or older) experimental version is different than what I’m running, but in my test it worked with “cream” and “cream soda”.  
Is it possible that the zone was too far, deactivated or overlapping with an other zone (overlapping zones do have some quriks and will not move items there if there are already items from an other defined zone)?

Edit:  
Testing this with the stable and the newest experimental shows that the cans do go into the “drinks” zone in stable, but not so in the newest experimental, so I guess something broke (probably because of the containers update). This means that you are in the stable…  
This does however not change much… While they are indeed made from the material `Junk Food` there too, only the material of their “container” - aluminium can or plastic bottle - counts.  
But even there the can did move to the custom spot I’ve set up with “cream” as a filter, so I guess you indeed have overlapping zones.

---

<div class="post-metadata">

**Author:** ![AssumeCroons](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/assumecroons/32/8570_2.png) [@AssumeCroons](https://discourse.cataclysmdda.org/u/AssumeCroons)\
**Post date:** [September 2, 2020, 8:32pm UTC](https://discourse.cataclysmdda.org/t/the-junk-food-zone-full-metal-soda/24634/4 "2020-09-02T20:32:13Z")

</div>

> [@Valase](#):
>
> Weirdly enough, in my test it also did not sort it into the drink zone, although I’m not running the newest experimental, so it might is fixed there… the only zone it would go to was food.

For the original post, I was running 0.E-2. There, it does go to a `Drink` zone, when a `Food` zone exists.

For a test today, I pulled from github; built with defaults; executed; found an `aluminum can of orange soda`; made some single-tile non-overlapping zones for `Unsorted`, `Drink`, and `Food`; dropped the soda item in `Unsorted`; and finally sorted with `O` `o`. The item went to the `Food` zone, as when you tried it.

> [@Valase](#):
>
> Is it possible that the zone was too far, deactivated or overlapping with an other zone (overlapping zones do have some quriks and will not move items there if there are already items from an other defined zone)?

> [@Valase](#):
>
> But even there the can did move to the custom spot I’ve set up with “cream” as a filter, so I guess you indeed have overlapping zones.

Yep! Accurately deduced. Back in the 0.E-2, I did have an unrelated `Custom` zone (for some items renamed with markers) that overlapped the prospective Junk Food Zone, and one item in that tile from that zone. Resolving that overlap, a `Custom` zone with “cream” or “cream soda” now works as intended. So that workaround … works … around. Sweet, thanks.

This hacky script builds `Custom` zone filters for all junk food. Since each filter is limited to 256 characters, several non-overlapping zones are needed. I tested it on 0.E-2 and current from github. Something tells me I shoulda spent this time toward a fix rather than a workaround. Hoarding mindset. I am a zombie.

```auto
awk 'BEGIN {n="";m=""} /^[\t]*{[\t]*$/ {n="";m=""} /^[\t]*["]name["]:[\t]* ["]/ {match($0,"^[\t]*\"name\":[\t]*\"([^\"]*)\"",out);n=out[1]} /^[\t]*["]name["]:[\t]* {/ {match($0,"^[\t]*\"name\":[\t]*{[\t]*\"str[^\"]*\":[\t]*\"([^\"]*)\"",out);n=out[1]} /^[\t]*["]material["]:.*["]junk["]/ {m="junk"} /^[\t]*}/ {if (m=="junk") print n}' data/json/items/comestibles/*.json|tr ' ' '@'|tr '\n' ' '|fold -sw256|tr ' ' ','|tr '@' ' '|sed 's/,$//';echo
```

Anyway… With the overlap resolved in 0.E-2, a `Custom` zone with “m: junk food” still doesn’t catch `aluminum can of cream soda`. Even in the current build from github and a similar setup, the “m: junk food” filter misses `aluminum can of orange soda`. It seems that “m: junk food” doesn’t work on contained food.

Is there a better way to filter out junk food?

---

<div class="post-metadata">

**Author:** ![Valase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/valase/32/6972_2.png) [@Valase](https://discourse.cataclysmdda.org/u/Valase)\
**Post date:** [September 2, 2020, 9:18pm UTC](https://discourse.cataclysmdda.org/t/the-junk-food-zone-full-metal-soda/24634/5 "2020-09-02T21:18:42Z")

</div>

> [@AssumeCroons](#):
>
> Is there a better way to filter out junk food?

At the moment - be it 0.E stable or the newest experimental - no. At least I don’t know of any…
