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.

Difference between revisions of "Template talk:Creature/is humanoid"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m (note)
m
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Is there any way to do wildcard matches with DFRawFunctions? I was going to add all the humanoid creature variations (HUMANOID_HOOF, the zillion different numbers of limbs each type can have, etc.), but if there's any way to just search for any body tag that begins "HUMANOID_", that would be infinitely preferable.--[[User:Zzedar|Zzedar]] ([[User talk:Zzedar|talk]]) 23:55, 15 April 2013 (UTC)
+
''(Old discussion moved to [[Category talk:DF2012:Humanoids]])''
:I couldn't find any creatures that had tags like those, but something like this:
 
<pre>{{#rsplit:{{#df_tagentry:{{/raw}}|BODY|0|1|NOT_HUMANOID}}|_|0}}</pre>
 
:should give you "HUMANOID" or something else, which can then be checked with #ifeq:
 
<pre>{{#ifeq:{{#rsplit:{{#df_tagentry:{{/raw}}|BODY|0|1|NOT_HUMANOID}}|_|0}}|HUMANOID|1|0}}</pre>
 
:where 1=yes, 0=no. --{{User:Lethosor/sig}} 00:24, 16 April 2013 (UTC)
 
  
:Example: Antman - {{#ifeq:{{#rsplit:{{#df_tagentry:{{DF2012:Antman/raw}}|BODY|0|1|NOT_HUMANOID}}|_|0}}|HUMANOID|1|0}}, Cat - {{#ifeq:{{#rsplit:{{#df_tagentry:{{DF2012:Cat/raw}}|BODY|0|1|NOT_HUMANOID}}|_|0}}|HUMANOID|1|0}}, Ettin - {{#ifeq:{{#rsplit:{{#df_tagentry:{{DF2012:Ettin/raw}}|BODY|0|1|NOT_HUMANOID}}|_|0}}|HUMANOID|1|0}}
+
Problem with the HUMANOID_ARMLESS exception: [[crab men]] (edit:also harpies, but a case could be made that they shouldn't be considered humanoid). I think if we're going to do this categorization at all, it's going to have to be in Wittgensteinian fashion -- that is, a checklist where any creature satisfying more than a certain number of the conditions is considered humanoid (e.g., if we had ten conditions, any creature that met at least seven would qualify). --[[User:Zzedar|Zzedar]] ([[User talk:Zzedar|talk]]) 21:29, 16 April 2013 (UTC)
: Implemented. Thanks for the idea. --{{User:Lethosor/sig}} 00:27, 16 April 2013 (UTC)
+
:Right, forgot about that. If that's the only exception, I may as well add it in as a special case. --{{User:Lethosor/sig}} 21:50, 16 April 2013 (UTC)
 +
::Arguably harpies. What worries me is that if we put in these special cases (well, let's be honest: if ''you'' do it, because I'm not anything like comfortable enough with the commands to do it), we'll have to rewrite the template as soon as some other creature is added that doesn't mesh well.--[[User:Zzedar|Zzedar]] ([[User talk:Zzedar|talk]]) 22:15, 16 April 2013 (UTC)
  
:Uh-oh... [[barn owl]]s should definitely not be included in this. The #switch may have been a better way to determine this after all. Thoughts? --{{User:Lethosor/sig}} 00:32, 16 April 2013 (UTC)
+
:Actually, the multiple-characteristic idea could work, if the [APPLY_CREATURE_VARIATION] tag were accessible (it's replaced on [[DF2012:Crab man/raw]]). Not sure how to access this from a template, but I'll see if it's possible. --{{User:Lethosor/sig}} 21:52, 16 April 2013 (UTC)
::Looks like a lot of birds use HUMANOID_ARMLESS. On the other hand, so do crab men. I guess we could exclude (armless + 2 wings), but that's awfully hacky. Let's take a step back. What is the purpose of this category? I mean, what attributes of humanoidness do we care about that it's worth making a category for them? We should just check those.--[[User:Zzedar|Zzedar]] ([[User talk:Zzedar|talk]]) 00:54, 16 April 2013 (UTC)
+
::It can be done -- instead of using the /raw page, we can use the original file, along the lines of <nowiki>{{#df_tagentry:DF2012:creature_standard.txt|whatever}}</nowiki>. That would require listing out all of the .txt files that contain creatures, though (to the best of my knowledge, there's no way to have the df parser look across all of the files, you have to list them out). I guess I could create a page for inclusion that's just all the raws glommed together. Should I?--[[User:Zzedar|Zzedar]] ([[User talk:Zzedar|talk]]) 22:15, 16 April 2013 (UTC)
 
+
:::Whoops, got my commands confused. tagentry can't take just the file name, it has to be processed by df_raw first, along the lines of <nowiki>{{#df_tagentry:{{#df_raw:DF2012:creature_standard.txt}}|whatever}}</nowiki>--[[User:Zzedar|Zzedar]] ([[User talk:Zzedar|talk]]) 23:08, 16 April 2013 (UTC)
:::I'd say this category should just be animal men or obviously humanoid creatures (ettins, humans, etc.). I'm not sure of an easy (non-hacky) way to do this either, but I'll take another look at the raws. --{{User:Lethosor/sig}} 00:59, 16 April 2013 (UTC)
+
::::No, wait, that'll just look at the first creature in the file, not all creatures. Just a sec.--[[User:Zzedar|Zzedar]] ([[User talk:Zzedar|talk]]) 23:10, 16 April 2013 (UTC)
::::That's going to just be the intelligent/learning creatures plus the bronze colossus, isn't it?--[[User:Zzedar|Zzedar]] ([[User talk:Zzedar|talk]]) 01:06, 16 April 2013 (UTC)
+
:::::Ah, no, that ''will'' work! <tt><nowiki>{{#df_tagentry:{{#df_raw:DF2012:creature_standard.txt|CREATURE|creaturenamehere}}|whatever}}</nowiki></tt> --[[User:Zzedar|Zzedar]] ([[User talk:Zzedar|talk]]) 23:14, 16 April 2013 (UTC)
::::Whoops, forgot about fire imps. Lessee... are there any non-humanoids with [EQUIPS]?--[[User:Zzedar|Zzedar]] ([[User talk:Zzedar|talk]]) 01:10, 16 April 2013 (UTC)
+
::::::I'm an idiot. There's an existing option to not parse the creature variation -- we don't have to do anything. Look at <tt><nowiki>{{:DF2012:Crab man/raw|1}}</nowiki></tt> --[[User:Zzedar|Zzedar]] ([[User talk:Zzedar|talk]]) 23:28, 16 April 2013 (UTC)
:::::<s>Or other creatures that have human-like bodies (which there aren't ''that'' many of). I'd intended to include all creatures with BODY_HUMANOID or some other similar tag, but then there's the problem with HUMANOID_ARMLESS creatures. Maybe just excluding the HUMANOID_ARMLESS tag is easiest, but then another tag's bound to turn up. --{{User:Lethosor/sig}} 01:12, 16 April 2013 (UTC)</s> Checking that...
+
:::::::Wow, I completely forgot about that. Thanks for pointing it out. I just added a wrapper around the current template to test for animalmen first (which might be a little bit faster than the other order). It looks like it only added [[DF2012:Crab man]] (the count is now 182, up from 181), but it's probably a good idea to check for animalman status anyway. Let me know if you find any more problems. --{{User:Lethosor/sig}} 00:34, 17 April 2013 (UTC)
:::::: [[Green devourer]] does '''not''' have [EQUIPS], but it's unclear exactly what it's classified as. I'd say it's probably more bird-like, though. --{{User:Lethosor/sig}} 01:15, 16 April 2013 (UTC)
+
::::::::Bad news, I'm afraid: kangaroos (and giant kangaroos) have [BODY:HUMANOID]. And, as mentioned before, harpies are problematic. Edit: oh, and giant bats have HUMANOID_FLIER; not sure whether blocking that will cause any other problems.--[[User:Zzedar|Zzedar]] ([[User talk:Zzedar|talk]]) 00:52, 17 April 2013 (UTC)

Latest revision as of 00:53, 17 April 2013

(Old discussion moved to Category talk:DF2012:Humanoids)

Problem with the HUMANOID_ARMLESS exception: crab men (edit:also harpies, but a case could be made that they shouldn't be considered humanoid). I think if we're going to do this categorization at all, it's going to have to be in Wittgensteinian fashion -- that is, a checklist where any creature satisfying more than a certain number of the conditions is considered humanoid (e.g., if we had ten conditions, any creature that met at least seven would qualify). --Zzedar (talk) 21:29, 16 April 2013 (UTC)

Right, forgot about that. If that's the only exception, I may as well add it in as a special case. --Lethosor (talk) 21:50, 16 April 2013 (UTC)
Arguably harpies. What worries me is that if we put in these special cases (well, let's be honest: if you do it, because I'm not anything like comfortable enough with the commands to do it), we'll have to rewrite the template as soon as some other creature is added that doesn't mesh well.--Zzedar (talk) 22:15, 16 April 2013 (UTC)
Actually, the multiple-characteristic idea could work, if the [APPLY_CREATURE_VARIATION] tag were accessible (it's replaced on DF2012:Crab man/raw). Not sure how to access this from a template, but I'll see if it's possible. --Lethosor (talk) 21:52, 16 April 2013 (UTC)
It can be done -- instead of using the /raw page, we can use the original file, along the lines of {{#df_tagentry:DF2012:creature_standard.txt|whatever}}. That would require listing out all of the .txt files that contain creatures, though (to the best of my knowledge, there's no way to have the df parser look across all of the files, you have to list them out). I guess I could create a page for inclusion that's just all the raws glommed together. Should I?--Zzedar (talk) 22:15, 16 April 2013 (UTC)
Whoops, got my commands confused. tagentry can't take just the file name, it has to be processed by df_raw first, along the lines of {{#df_tagentry:{{#df_raw:DF2012:creature_standard.txt}}|whatever}}--Zzedar (talk) 23:08, 16 April 2013 (UTC)
No, wait, that'll just look at the first creature in the file, not all creatures. Just a sec.--Zzedar (talk) 23:10, 16 April 2013 (UTC)
Ah, no, that will work! {{#df_tagentry:{{#df_raw:DF2012:creature_standard.txt|CREATURE|creaturenamehere}}|whatever}} --Zzedar (talk) 23:14, 16 April 2013 (UTC)
I'm an idiot. There's an existing option to not parse the creature variation -- we don't have to do anything. Look at {{:DF2012:Crab man/raw|1}} --Zzedar (talk) 23:28, 16 April 2013 (UTC)
Wow, I completely forgot about that. Thanks for pointing it out. I just added a wrapper around the current template to test for animalmen first (which might be a little bit faster than the other order). It looks like it only added DF2012:Crab man (the count is now 182, up from 181), but it's probably a good idea to check for animalman status anyway. Let me know if you find any more problems. --Lethosor (talk) 00:34, 17 April 2013 (UTC)
Bad news, I'm afraid: kangaroos (and giant kangaroos) have [BODY:HUMANOID]. And, as mentioned before, harpies are problematic. Edit: oh, and giant bats have HUMANOID_FLIER; not sure whether blocking that will cause any other problems.--Zzedar (talk) 00:52, 17 April 2013 (UTC)