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 "v0.34:Interaction token"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
m
(and that's the rest)
Line 1: Line 1:
 
{{av}}
 
{{av}}
  
The following tokens can be used to define interactions.
+
The following tokens can be used to define and use interactions.
  
==Interactions==
+
==Interaction Definitions==
 
{| {{prettytable}}
 
{| {{prettytable}}
 
|- bgcolor="#C0C0C0"
 
|- bgcolor="#C0C0C0"
Line 130: Line 130:
 
| Type
 
| Type
 
| Specifies the type of material the interaction targets. Valid values:
 
| Specifies the type of material the interaction targets. Valid values:
* FLOW:[[Breath attack token]] - Specifies an attack not made of any material.
+
* FLOW:[[Breath attack]] token - Specifies an attack not made of any material.
* MATERIAL:[[Material token]]:[[Breath attack token]] - Specifies an attack made of a specific material.
+
* MATERIAL:[[Material token]]:[[Breath attack]] - Specifies an attack made of a specific material.
 
* CONTEXT_MATERIAL - Gets the material and breath attack from the relevant creature's CDI:MATERIAL token.
 
* CONTEXT_MATERIAL - Gets the material and breath attack from the relevant creature's CDI:MATERIAL token.
  
Line 187: Line 187:
 
|  
 
|  
 
| Indicates that this is a generated interaction. Cannot be specified in user-defined raws.
 
| Indicates that this is a generated interaction. Cannot be specified in user-defined raws.
 +
 +
|}
 +
 +
==Interaction Usage==
 +
In order to actually use an interaction, add the [[creature token]] [CAN_DO_INTERACTION:NAME] followed by a series of [CDI:...] tokens. Interactions can also be granted through [[syndrome]]s using the token [CE_CAN_DO_INTERACTION] (plus the same series of CDI tokens).
 +
 +
The following CDI tokens can be specified:
 +
{| {{prettytable}}
 +
|- bgcolor="#C0C0C0"
 +
! Token
 +
! Arguments
 +
! Description
 +
 +
|-
 +
| INTERACTION
 +
| id
 +
| Specifies which interaction can be performed. Only to be used with syndromes, since CE_CAN_DO_INTERACTION does not allow specifying the interaction ID directly.
 +
 +
|-
 +
| TARGET
 +
| target ID, target type
 +
| Specifies how the creature chooses what to . Target ID refers to an I_TARGET defined in the interaction itself. Valid target types:
 +
* LINE_OF_SIGHT - the source needs to be able to see the target
 +
* TOUCHABLE - the source needs to be able to touch the target
 +
* DISTURBER_ONLY - the target must be whoever disturbed the source
 +
* SELF_ALLOWED - the target can be the source
 +
* SELF_ONLY - the target '''must''' be the source
 +
 +
|-
 +
| TARGET_RANGE
 +
| target ID, range
 +
| Specifies how far away the target can be, in tiles.
 +
 +
|-
 +
| LOCATION_HINT
 +
| Location Hint (see avove)
 +
| ?
 +
 +
|-
 +
| USAGE_HINT
 +
| Usage hint token
 +
| Indicates how the interaction is to be used. Valid values:
 +
* MAJOR_CURSE
 +
* GREETING
 +
* CLEAN_SELF
 +
* CLEAN_FRIEND
 +
* ATTACK
 +
* FLEEING
 +
 +
|-
 +
| ADV_NAME
 +
| text
 +
| Specifies the interaction's name when used in Adventurer mode.
 +
 +
|-
 +
| MAX_TARGET_NUMBER
 +
| ID, number
 +
| Specifies the maximum number of things that can be selected for a particular I_TARGET.
 +
 +
|-
 +
| WAIT_PERIOD
 +
| number
 +
| Controls how often the interaction can be used.
 +
 +
|-
 +
| VERBAL
 +
|
 +
| When the creature performs the interaction, they will speak a line of text to their target.
 +
 +
|-
 +
| VERBAL_SPEECH
 +
| filename
 +
| Specifies what the creature says when they perform the interaction. Filename path is relative to /data/speech.
 +
 +
|-
 +
| CAN_BE_MUTUAL
 +
|
 +
| ?
 +
 +
|-
 +
| FREE_ACTION
 +
|
 +
| Indicates that performing the interaction doesn't take any time.
 +
 +
|-
 +
| VERB
 +
| self:other:?
 +
| When a creature uses the interaction, a message will display, describing the source as doing this.
 +
 +
|-
 +
| VERB_REVERSE
 +
| ?
 +
| ?
 +
 +
|-
 +
| TARGET_VERB
 +
| plural:singular
 +
| When a creature uses the interaction, a message will display, describing the target as doing this.
 +
 +
|-
 +
| BP_REQUIRED
 +
| Body part criteria
 +
| Indicates that a particular body part must be present in order to perform the interaction. Criteria are BY_CATEGORY:category, BY_TYPE:type, or BY_TOKEN:token.
 +
 +
|-
 +
| FLOW
 +
| [[Breath attack]] token
 +
| Causes the interaction to create an effect not made of any material. Only makes sense for FIREBALL, FIREJET, or DRAGONFIRE.
 +
 +
|-
 +
| MATERIAL
 +
| [[Material token]], [[Breath attack]] token
 +
| Causes the interaction to create an effect made of a specific material. Doesn't make sense for FIREBALL, FIREJET, or DRAGONFIRE.
  
 
|}
 
|}

Revision as of 18:41, 19 February 2012

This article is about an older version of DF.

The following tokens can be used to define and use interactions.

Interaction Definitions

Token Context Arguments Description
I_SOURCE Global type Defines what things are capable of triggering this interaction. Can be specified multiple times. Valid values:
  • REGION
  • UNDERGROUND_SPECIAL
  • SECRET
  • DISTURBANCE
  • DEITY
  • ATTACK
  • INGESTION
  • CREATURE_ACTION
IS_HIST_STRING_1 Within I_SOURCE text Describes what the interaction did to a historical figure. Displayed after the name of the historical figure that performed the interaction.

[IS_HIST_STRING_1: cursed ]

IS_HIST_STRING_2 Within I_SOURCE text Describes what the interaction did to a historical figure. Displayed after the name of the historical figure that was targetted by the interaction.

[IS_HIST_STRING_2: to assume the form of a lizard-like monster every full moon]

IS_FREQUENCY Within I_SOURCE Number ?
IS_NAME Within I_SOURCE string Generally used with secrets, describes what the secret is about.
IS_REGION Within I_SOURCE:REGION Region type Indicates what types regions are capable of performing this interaction. Can be specified multiple times. Valid values:
  • ANY
  • ANY_TERRAIN
  • NORMAL_ALLOWED
  • EVIL_ALLOWED
  • GOOD_ALLOWED
  • SAVAGE_ALLOWED
  • EVIL_ONLY
  • GOOD_ONLY
  • SAVAGE_ONLY
  • Region type - SWAMP, DESERT, FOREST, MOUNTAINS, OCEAN, LAKE, GLACIER, TUNDRA, GRASSLAND, HILLS
IS_SPHERE Within I_SOURCE:SECRET Sphere Indicates the sphere to which this secret pertains.
IS_SECRET_GOAL Within I_SOURCE:SECRET Secret Goal token Indicates why somebody would want to learn the secret. Valid values:
  • IMMORTALITY
IS_SECRET Within I_SOURCE:SECRET Secret Flag Indicates how the secret can be learned. Valid values:
  • SUPERNATURAL_LEARNING_POSSIBLE - the secret can be learned by supernatural means
  • MUNDANE_RESEARCH_POSSIBLE - the secret can be researched by mundane means
  • MUNDANE_TEACHING_POSSIBLE - the secret can be taught to apprentices
  • MUNDANE_RECORDING_POSSIBLE:objects/text/(book_title).txt:objects/text/(book_topic).txt - the secret can be written in books with the specified title.
IS_USAGE_HINT Within I_SOURCE:DEITY Usage Hint token Indicates why a deity would choose to perform this interaction. Usually MAJOR_CURSE; GREETING, CLEAN_SELF, CLEAN_FRIEND, ATTACK, and FLEEING don't make sense here.
I_TARGET Global id, type Specifies what things this interaction acts upon. Can be specified multiple times. Valid values:
  • CORPSE
  • CREATURE
  • MATERIAL
  • LOCATION
IT_LOCATION Within I_TARGET Location Narrows down exactly what the interaction targets. Valid values:
  • CONTEXT_REGION
  • CONTEXT_CREATURE
  • CONTEXT_ITEM
  • CONTEXT_BP
  • CONTEXT_LOCATION
IT_MANUAL_INPUT Within I_TARGET text Tells the player what they should be selecting.
IT_MATERIAL Within I_TARGET:MATERIAL Type Specifies the type of material the interaction targets. Valid values:
  • FLOW:Breath attack token - Specifies an attack not made of any material.
  • MATERIAL:Material token:Breath attack - Specifies an attack made of a specific material.
  • CONTEXT_MATERIAL - Gets the material and breath attack from the relevant creature's CDI:MATERIAL token.
I_EFFECT Global type Specifies what the interaction does to the targets. Can be specified multiple times. Valid values:
  • ANIMATE
  • RESURRECT
  • ADD_SYNDROME
  • CLEAN
  • HIDE
  • CONTACT
  • MATERIAL_EMISSION
IE_TARGET Within I_EFFECT ID Specifies which I_TARGET this effect will be applied to
IE_INTERMITTENT Within I_EFFECT Frequency Indicates that the effect happens intermittently and specifies roughly how often. Valid values:
  • WEEKLY
IE_IMMEDIATE Within I_EFFECT Indicates that the effect happens immediately.
IE_LOCATION Within I_EFFECT Location Hint Indicates where the effect can take place. Valid values:
  • IN_WATER
  • IN_MAGMA
  • NO_WATER
  • NO_MAGMA
IE_ARENA_NAME Within I_EFFECT text Allows the interaction to be applied to newly spawned creatures in Arena mode.
GENERATED Global Indicates that this is a generated interaction. Cannot be specified in user-defined raws.

Interaction Usage

In order to actually use an interaction, add the creature token [CAN_DO_INTERACTION:NAME] followed by a series of [CDI:...] tokens. Interactions can also be granted through syndromes using the token [CE_CAN_DO_INTERACTION] (plus the same series of CDI tokens).

The following CDI tokens can be specified:

Token Arguments Description
INTERACTION id Specifies which interaction can be performed. Only to be used with syndromes, since CE_CAN_DO_INTERACTION does not allow specifying the interaction ID directly.
TARGET target ID, target type Specifies how the creature chooses what to . Target ID refers to an I_TARGET defined in the interaction itself. Valid target types:
  • LINE_OF_SIGHT - the source needs to be able to see the target
  • TOUCHABLE - the source needs to be able to touch the target
  • DISTURBER_ONLY - the target must be whoever disturbed the source
  • SELF_ALLOWED - the target can be the source
  • SELF_ONLY - the target must be the source
TARGET_RANGE target ID, range Specifies how far away the target can be, in tiles.
LOCATION_HINT Location Hint (see avove) ?
USAGE_HINT Usage hint token Indicates how the interaction is to be used. Valid values:
  • MAJOR_CURSE
  • GREETING
  • CLEAN_SELF
  • CLEAN_FRIEND
  • ATTACK
  • FLEEING
ADV_NAME text Specifies the interaction's name when used in Adventurer mode.
MAX_TARGET_NUMBER ID, number Specifies the maximum number of things that can be selected for a particular I_TARGET.
WAIT_PERIOD number Controls how often the interaction can be used.
VERBAL When the creature performs the interaction, they will speak a line of text to their target.
VERBAL_SPEECH filename Specifies what the creature says when they perform the interaction. Filename path is relative to /data/speech.
CAN_BE_MUTUAL ?
FREE_ACTION Indicates that performing the interaction doesn't take any time.
VERB self:other:? When a creature uses the interaction, a message will display, describing the source as doing this.
VERB_REVERSE ? ?
TARGET_VERB plural:singular When a creature uses the interaction, a message will display, describing the target as doing this.
BP_REQUIRED Body part criteria Indicates that a particular body part must be present in order to perform the interaction. Criteria are BY_CATEGORY:category, BY_TYPE:type, or BY_TOKEN:token.
FLOW Breath attack token Causes the interaction to create an effect not made of any material. Only makes sense for FIREBALL, FIREJET, or DRAGONFIRE.
MATERIAL Material token, Breath attack token Causes the interaction to create an effect made of a specific material. Doesn't make sense for FIREBALL, FIREJET, or DRAGONFIRE.

See Also