v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Template talk:RawToTable

From Dwarf Fortress Wiki
Revision as of 20:10, 10 April 2011 by DUMBELLS (talk | contribs) (→‎Food Source: some fixes)
Jump to navigation Jump to search

Food Source

I'm not sure how to generate whether or not a creature is a food source..
Going through the creature tokens, these are some clues I found:
Definitely a food source: [FISHITEM] / [MILKABLE] (in some sense a food source)
Disqualifiers: [ITEMCORPSE] / [FANCIFUL] / [NOMEAT] / [NOT_BUTCHERABLE] / [SMALL_REMAINS] --dUMBELLS 18:57, 10 April 2011 (UTC)

Some more disqualifiers for Dwarves would be [INTELLIGENT] and [CAN_LEARN] (and [SLOW_LEARNER]), and likely also [CAN_SPEAK]. --Quietust 19:01, 10 April 2011 (UTC)
This is what I've come up with, but it is in need of iterating,
 {{#switch:Y
 |{{#if:{{#df_tagentry:{{{1}}}|ITEMCORPSE||1}}|N|Y}}={{Cgr|N}}
 |{{#if:{{#df_tagentry:{{{1}}}|FANCIFUL||1}}|N|Y}}={{Cgr|N}}
 |{{#if:{{#df_tagentry:{{{1}}}|NOMEAT||1}}|N|Y}}={{Cgr|N}}
 |{{#if:{{#df_tagentry:{{{1}}}|NOT_BUTCHERABLE||1}}|N|Y}}={{Cgr|N}}
 |{{#if:{{#df_tagentry:{{{1}}}|SMALL_REMAINS||1}}|N|Y}}={{Cgr|N}}
 |{{#if:{{#df_tagentry:{{{1}}}|INTELLIGENT||1}}|N|Y}}={{Cgr|N}}
 |{{#if:{{#df_tagentry:{{{1}}}|CAN_LEARN||1}}|N|Y}}={{Cgr|N}}
 |{{#if:{{#df_tagentry:{{{1}}}|CAN_SPEAK||1}}|N|Y}}={{Cgr|N}}
 |#default={{#if:{{#if:{{#df_tagentry:{{{1}}}|FISHITEM||1}}||NONEMPTY}}{{#if:{{#df_tagentry:{{{1}}}|MILKABLE||1}}||NONEMPTY}}|{{Cgr|Y}}|N/A}}
 }} 
--dUMBELLS 20:09, 10 April 2011 (UTC)