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.

Editing Creature variation token

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.

If you are creating a redirect to the current version's page, do not use any namespace. For example: use #REDIRECT [[Cat]], not #REDIRECT [[Main:Cat]] or #REDIRECT [[cv:Cat]]. See DF:Versions for more information.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{Quality|Exceptional}}
+
{{Quality|Exceptional|09:52, 22 February 2022 (UTC)}}
 
{{av}}
 
{{av}}
 
{{Modding}}
 
{{Modding}}
Line 159: Line 159:
 
as the tokens added to the target creature.
 
as the tokens added to the target creature.
  
The conditional tags ({{token|CV_NEW_CTAG|cv}}/{{token|CV_ADD_CTAG|cv}}, {{token|CV_REMOVE_CTAG|cv}} and {{token|CV_CONVERT_CTAG|cv}}) are copies of CV_NEW_TAG/CV_ADD_TAG, CV_REMOVE_TAG and CV_CONVERT_TAG, except they only work if a numbered argument of APPLY_CREATURE_VARIATION has an arbitrary value. E.g. [CV_ADD_CTAG:2:HUMANOID:CAN_SPEAK] will only add [CAN_SPEAK] if argument number two is "HUMANOID".
+
The conditional tags ({{token|CV_NEW_CTAG|cv}}/{{token|CV_ADD_CTAG|cv}}, {{token|CV_REMOVE_CTAG|cv}} and {{token|CV_CONVERT_CTAG|cv}}) are copies of CV_NEW_TAG/CV_ADD_TAG, CV_REMOVE_TAG and CV_CONVERT_TAG, except they only work if a numbered argument of APPLY_CREATURE_VARIATION has an arbitrary value. E.g. [CV_NEW_TOKEN:2:HUMANOID:CAN_SPEAK] will only add [CAN_SPEAK] if argument number two is "HUMANOID".
  
 
<sup>1</sup>Functionally. Up to 65537=2<sup>16</sup>+1 arguments have been tested, with no problems other than a long load time.
 
<sup>1</sup>Functionally. Up to 65537=2<sup>16</sup>+1 arguments have been tested, with no problems other than a long load time.
 
===Example===
 
 
The following is an example of a creature variation, demonstrating most of the tokens and arguments mentioned above; with an explanation of how you would use it to change the properties of a cow.
 
 
[CREATURE_VARIATION:CREATURE_EDIT]
 
    [CV_CONVERT_CTAG:1:NAME]
 
        [CVCT_MASTER:NAME]
 
        [CVCT_TARGET:!ARG3:!ARG3s:!ARG4]
 
        [CVCT_REPLACEMENT:!ARG5:!ARG5s:!ARG6]
 
    [CV_CONVERT_CTAG:2:CNAME]
 
        [CVCT_MASTER:CASTE_NAME]
 
        [CVCT_TARGET:!ARG3:!ARG3s:!ARG4]
 
        [CVCT_REPLACEMENT:!ARG5:!ARG5s:!ARG6]
 
    [CV_NEW_CTAG:7:FC:SELECT_CASTE:FEMALE]
 
    [CV_NEW_CTAG:7:FC:COLOR:!ARG8]
 
    [CV_CONVERT_TAG]
 
        [CVCT_MASTER:STATE_NAME:LIQUID]
 
        [CVCT_TARGET:!ARG3's milk]
 
        [CVCT_REPLACEMENT:!ARG5's milk]
 
    [CV_CONVERT_TAG]
 
        [CVCT_MASTER:STATE_ADJ:LIQUID]
 
        [CVCT_TARGET:!ARG3's milk]
 
        [CVCT_REPLACEMENT:!ARG5's milk]
 
    [CV_NEW_CTAG:9:MRED:SELECT_CASTE:MALE]
 
    [CV_NEW_CTAG:9:MREL:CASTE_COLOR:4:0:0]
 
    [CV_NEW_CTAG:9:MYEL:SELECT_CASTE:MALE]
 
    [CV_NEW_CTAG:9:MYEL:CASTE_COLOR:6:0:1]
 
 
We add the following to a creature file.
 
 
    [SELECT_CREATURE:COW]
 
        [APPLY_CREATURE_VARIATION:CREATURE_EDIT:X:CNAME:cow:bovine:super-cow:cowtastic:FC:7|0|1:MYEL]
 
 
This will change the cow creature file so that the cows are now called "super-cows", which can be described as "cowtastic", are white colored and produce "super-cow's milk", and it will also change the color of the bulls to yellow.
 
 
Here is a step-by-step explanation of what is happening in order of the arguments:
 
 
* "X" doesn't match the first CTAG argument of "NAME", so we have decided not to change the overall name of the creature.
 
* "CNAME" does match the second CTAG so we are changing the name of a caste which matches arguments !ARG3 & !ARG4, as well as looking for specific liquids with state names that contain !ARG3 followed by the characters "'s milk".
 
* Using arguments 3 & 4 we look for a caste name that matches "cow:cows:bovine" and any liquid name or adjective that matches "cow's milk".
 
* The caste name and liquids do exist, so !ARG5 & !ARG6 now declare what we want to change these names to; in this case the caste name "super-cow:super-cows:cowtastic" and liquid name and adjective "super-cow's milk".
 
* Now we declare that we want CTAG argument 7 to match "FC" which means we will select the [FEMALE] caste and add a color to it which is decided by the next argument !ARG8.
 
* We need to choose three digits but they need to be separated by ":". Using this character here will move us onto the next argument, so we separate the digits with "|" instead choosing "7|0|1" (white), for a white cow (not necessarily represented by the graphics).
 
* The next argument has multiple CTAGs numbered "9", but with different arguments. Either option will use [SELECT_CASTE:MALE] but we can choose between the argument MRED or MYEL. We have chosen MYEL which adds the tag [CASTE_COLOR:6:0:1] (yellow) for us, giving the male caste (in this case a bull) yellow as a caste color.
 
  
 
==See Also==
 
==See Also==

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

This page is a member of 1 hidden category: