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 "Interaction examples"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
Line 109: Line 109:
  
 
Material emissions used in this format are affected by [IT_CANNOT_HAVE_SYNDROME_CLASS:X] tags (given above as the custom tag NO_EMISSION). This allows a modder to create immunity syndromes, disallowing a creature using the emission interaction from targeting the creature with immunity.
 
Material emissions used in this format are affected by [IT_CANNOT_HAVE_SYNDROME_CLASS:X] tags (given above as the custom tag NO_EMISSION). This allows a modder to create immunity syndromes, disallowing a creature using the emission interaction from targeting the creature with immunity.
 +
 +
===Timed Self-Destruct with Override Ability===
 +
 +
This will allow the user to explode after spending a certain amount of time in combat.  A few ticks before exploding, it will flash with a "!" as a warning.
 +
You can also replace the explosion with any other powerful ability that you want it to use only after a countdown.
 +
It also comes with a syndrome that will disable the explosion.
 +
This is intended to be used by non-playable units, like animals or zombies.
 +
 +
{{gamedata|title=Timed Self-Destruct|
 +
<nowiki>
 +
[INTERACTION:EXPLOSION_READY_1] <-- This is the ability you actually give the creature.  Use CDI:USAGE_HINT:DEFEND, and CDI:TARGET:A:SELF_ONLY.
 +
[I_SOURCE:CREATURE_ACTION]
 +
[I_TARGET:A:CREATURE]
 +
[IT_LOCATION:CONTEXT_CREATURE]
 +
[IT_CANNOT_HAVE_SYNDROME_CLASS:EXPLOSION_READY_1]
 +
[I_EFFECT:ADD_SYNDROME]
 +
[IE_TARGET:A]
 +
[IE_IMMEDIATE]
 +
[SYNDROME]
 +
[SYN_NAME:counting down]
 +
[SYN_CLASS:EXPLOSION_READY_1]
 +
[CE_CAN_DO_INTERACTION:START:10:END:11:DWF_STRETCH:72] <--The START affects the amount of time spent in combat before the explosion can occur.
 +
[CDI:ADV_NAME:Draw Energy]
 +
[CDI:USAGE_HINT:DEFEND]
 +
[CDI:VERB:engage self-destruct sequence:engages self-destruct sequence:NA]
 +
[CDI:INTERACTION:EXPLOSION_READY_2]
 +
[CDI:TARGET:A:SELF_ONLY]
 +
[CDI:WAIT_PERIOD:1500]
 +
 +
[INTERACTION:EXPLOSION_READY_2]
 +
[I_SOURCE:CREATURE_ACTION]
 +
[I_TARGET:A:CREATURE]
 +
[IT_LOCATION:CONTEXT_CREATURE]
 +
[IT_CANNOT_HAVE_SYNDROME_CLASS:EXPLOSION_READY_2]
 +
[IT_CANNOT_HAVE_SYNDROME_CLASS:EXPLOSION_OVERRIDE]
 +
[I_EFFECT:ADD_SYNDROME]
 +
[IE_TARGET:A]
 +
[IE_IMMEDIATE]
 +
[SYNDROME]
 +
[SYN_NAME:ready to explode]
 +
[SYN_CLASS:EXPLOSION_READY_2]
 +
[CE_FLASH_TILE:TILE:33:4:0:0:FREQUENCY:32:16:START:0:END:2:DWF_STRETCH:72] <-- Flash as a warning
 +
[CE_SPEED_CHANGE:SPEED_PERC:50:START:0:END:2:DWF_STRETCH:72]
 +
[CE_CAN_DO_INTERACTION:START:1:END:2:DWF_STRETCH:72] <-- The AI will use this and then immediately explode, provided it is still in combat and not affected by EXPLOSION_OVERRIDE.
 +
[CDI:ADV_NAME:Remove safeties]
 +
[CDI:USAGE_HINT:DEFEND]
 +
[CDI:INTERACTION:EXPLOSION_READY_3]
 +
[CDI:TARGET:A:SELF_ONLY]
 +
[CDI:WAIT_PERIOD:250]
 +
 +
[INTERACTION:EXPLOSION_READY_3]
 +
[I_SOURCE:CREATURE_ACTION]
 +
[I_TARGET:A:CREATURE]
 +
[IT_LOCATION:CONTEXT_CREATURE]
 +
[IT_CANNOT_HAVE_SYNDROME_CLASS:EXPLOSION_READY_3]
 +
[IT_CANNOT_HAVE_SYNDROME_CLASS:EXPLOSION_OVERRIDE]
 +
[I_EFFECT:ADD_SYNDROME]
 +
[IE_TARGET:A]
 +
[IE_IMMEDIATE]
 +
[SYNDROME]
 +
[SYN_NAME:about to explode]
 +
[SYN_CLASS:EXPLOSION_READY_3]
 +
[CE_FLASH_TILE:TILE:33:4:0:0:FREQUENCY:32:16:START:0:END:2:DWF_STRETCH:72]
 +
[CE_CAN_DO_INTERACTION:START:0:END:1:DWF_STRETCH:72]
 +
[CDI:ADV_NAME:Explode]
 +
[CDI:USAGE_HINT:ATTACK]
 +
[CDI:INTERACTION:MATERIAL_EMISSION]
 +
[CDI:VERB:explode:explodes:NA]
 +
[CDI:MATERIAL:CREATURE_MAT:MATERIALS:EXPLOSION_MAJOR:UNDIRECTED_DUST] <-- This points to a dummy creature that contains the explosion material.
 +
[CDI:TARGET:C:LINE_OF_SIGHT]
 +
[CDI:TARGET_RANGE:C:1]
 +
[CDI:MAX_TARGET_NUMBER:C:1]
 +
[CDI:WAIT_PERIOD:250]
 +
 +
[INTERACTION:EXPLOSION_OVERRIDE] <-- Give this to any creature you want to be able to override the explosion.  For example, a necromancer that creates kamikaze zombies may disable any zombies nearby, to prevent friendly fire.
 +
[I_SOURCE:CREATURE_ACTION]
 +
[I_TARGET:A:CREATURE]
 +
[IT_LOCATION:CONTEXT_CREATURE]
 +
[IT_CANNOT_HAVE_SYNDROME_CLASS:EXPLOSION_READY_3]
 +
[IT_CANNOT_HAVE_SYNDROME_CLASS:EXPLOSION_OVERRIDE]
 +
[I_EFFECT:ADD_SYNDROME]
 +
[IE_TARGET:A]
 +
[IE_IMMEDIATE]
 +
[SYNDROME]
 +
[SYN_NAME:unable to explode]
 +
[SYN_CLASS:EXPLOSION_OVERRIDE]
 +
[CE_SPEED_CHANGE:SPEED_PERC:100:START:0:END:2:DWF_STRETCH:72]
 +
 +
</nowiki>
 +
}}
  
 
==Syndrome Interactions==
 
==Syndrome Interactions==

Revision as of 18:07, 7 March 2020

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

This page was created to aid those curious about the interaction process by providing example interactions for them to use or study. Those familiar with interaction raws should feel free to add helpful/obscure information to the lists below to help members of the community less experienced with interactions.

Material Emission Interactions

Following are several examples of material emission interactions.

Multiple Projectile Emission


By adding additional [I_EFFECT:MATERIAL_EMISSION] tags with their associated targets, you may stack additional projectiles.

Predefined Material Emissions

If a material is listed in this format, the creature will not need a [CDI:MATERIAL] tag in their creature raws in order to use it. This allows projectile attacks to be gained through substance ingestion, other interactions, etc.

Predefined Emissions of Different Types

This interaction fires both a solid glob of basalt and a liquid glob of granite magma.

Material Emissions With Immunity

Material emissions used in this format are affected by [IT_CANNOT_HAVE_SYNDROME_CLASS:X] tags (given above as the custom tag NO_EMISSION). This allows a modder to create immunity syndromes, disallowing a creature using the emission interaction from targeting the creature with immunity.

Timed Self-Destruct with Override Ability

This will allow the user to explode after spending a certain amount of time in combat. A few ticks before exploding, it will flash with a "!" as a warning. You can also replace the explosion with any other powerful ability that you want it to use only after a countdown. It also comes with a syndrome that will disable the explosion. This is intended to be used by non-playable units, like animals or zombies.

Syndrome Interactions

Following are examples of interactions that apply syndromes.

Emission Immunity

This interaction would prohibit a creature from being targeted by the emission interaction listed above.