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 "Creature variation token"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m (Changed quality rating from "Unrated" to "Tattered" using the rating script)
m (Interwiki link)
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Quality|Tattered|18:04, 24 August 2014 (UTC)}}
+
{{Quality|Superior|22:05, 20 September 2016 (UTC)}}
{{Migrated_article}}
 
 
 
 
{{av}}
 
{{av}}
 
Creature variations are used to create creatures which are derived from another already-existing creature without having to duplicate every single token. They are defined as CREATURE_VARIATION objects, and the default variations are defined in c_variation_default.txt
 
Creature variations are used to create creatures which are derived from another already-existing creature without having to duplicate every single token. They are defined as CREATURE_VARIATION objects, and the default variations are defined in c_variation_default.txt
 +
 +
From the raws:
 +
 +
Order of application:
 +
Remove tags are applied starting from the bottom, then convert tags from the bottom, then add tags from the top.
 +
 +
Arguments:
 +
If APPLY_CREATURE_VARIATION in the creature raws sends in arguments, you can use them below as !ARG1, !ARG2, etc.  The GAIT variations below have some examples.  In the creature raws, if an argument is of the form "5|6", for example, it'll be converted to "5:6" in the creature variation, so you can handle variable-token arguments with the | character.
 +
 +
Conditional tags:
 +
Change TAG to CTAG and add, for example, CV_REMOVE_CTAG:1:YES:<regular stuff> to require !ARG1 to be YES to execute the changes.
  
 
{| {{prettytable}}
 
{| {{prettytable}}
Line 21: Line 30:
 
|
 
|
 
*token
 
*token
| Alias for CV_NEW_TAG
+
| Alias for CV_NEW_TAG.
  
 
|-
 
|-
Line 28: Line 37:
 
*token
 
*token
 
| Removes a token from the creature's variant.
 
| Removes a token from the creature's variant.
 +
 +
|-
 +
| {{text anchor|CV_NEW_CTAG}}
 +
|
 +
*ARG number
 +
*token
 +
| As CV_NEW_TAG, but only activates if !ARG(num) is YES, e.g. CV_NEW_CTAG:1:YES:<regular stuff> to require !ARG1 to be YES to execute the changes.
 +
 +
|-
 +
| {{text anchor|CV_ADD_CTAG}}
 +
|
 +
*ARG number
 +
*token
 +
| Alias for CV_NEW_CTAG.
 +
 +
|-
 +
| {{text anchor|CV_REMOVE_CTAG}}
 +
|
 +
*ARG number
 +
*token
 +
| As CV_REMOVE_TAG with conditions as described above.
  
 
|-
 
|-
Line 51: Line 81:
 
*value
 
*value
 
| Replaces the parameter specified by CVCT_TARGET within the token specified by CVCT_MASTER. If no replacement is specified, the target will simply be removed.
 
| Replaces the parameter specified by CVCT_TARGET within the token specified by CVCT_MASTER. If no replacement is specified, the target will simply be removed.
 +
|
 +
 +
|-
 +
| {{text anchor|CV_CONVERT_CTAG}}
 +
|
 +
| As CV_CONVERT_TAG with conditions.
 
|}
 
|}
  
 
{{Category|Modding}}
 
{{Category|Modding}}
 
{{Category|Tokens}}
 
{{Category|Tokens}}
 +
 +
[[ru:Creature variation token]]

Revision as of 22:17, 31 March 2019

This article is about the current version of DF.
Note that some content may still need to be updated.

Creature variations are used to create creatures which are derived from another already-existing creature without having to duplicate every single token. They are defined as CREATURE_VARIATION objects, and the default variations are defined in c_variation_default.txt

From the raws:

Order of application: Remove tags are applied starting from the bottom, then convert tags from the bottom, then add tags from the top.

Arguments: If APPLY_CREATURE_VARIATION in the creature raws sends in arguments, you can use them below as !ARG1, !ARG2, etc. The GAIT variations below have some examples. In the creature raws, if an argument is of the form "5|6", for example, it'll be converted to "5:6" in the creature variation, so you can handle variable-token arguments with the | character.

Conditional tags: Change TAG to CTAG and add, for example, CV_REMOVE_CTAG:1:YES:<regular stuff> to require !ARG1 to be YES to execute the changes.

Token Arguments Description
CV_NEW_TAG
  • token (plus any additional parameters)
Adds a new token to the creature's variant.
CV_ADD_TAG
  • token
Alias for CV_NEW_TAG.
CV_REMOVE_TAG
  • token
Removes a token from the creature's variant.
CV_NEW_CTAG
  • ARG number
  • token
As CV_NEW_TAG, but only activates if !ARG(num) is YES, e.g. CV_NEW_CTAG:1:YES:<regular stuff> to require !ARG1 to be YES to execute the changes.
CV_ADD_CTAG
  • ARG number
  • token
Alias for CV_NEW_CTAG.
CV_REMOVE_CTAG
  • ARG number
  • token
As CV_REMOVE_TAG with conditions as described above.
CV_CONVERT_TAG Begins altering tokens within the creature's variant using the CVCT_MASTER, CVCT_TARGET, and CVCT_REPLACEMENT tokens below. If a variation template contains multiple CV_CONVERT_TAG blocks for the same CVCT_MASTER, the replacements will be applied in reverse order.
CVCT_MASTER
  • token
Specifies the token that will be modified.
CVCT_TARGET
  • value
Locates the specified parameter within the token specified by CVCT_MASTER.
CVCT_REPLACEMENT
  • value
Replaces the parameter specified by CVCT_TARGET within the token specified by CVCT_MASTER. If no replacement is specified, the target will simply be removed.
CV_CONVERT_CTAG As CV_CONVERT_TAG with conditions.