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

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:
{{migrated article}}
 
 
{{av}}
 
{{av}}
  
This page was created to aid those curious about the [[interaction token|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.
+
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.
  
 
==General Tips==
 
==General Tips==
  
 
===Synchronizing Adventure and Fort Mode syndrome timers===
 
===Synchronizing Adventure and Fort Mode syndrome timers===
Fort mode runs 144 times faster than adventure mode - which means that a syndrome that lasts a single tick in Fort Mode will last 144 ticks in Adventure Mode.  For short-term syndromes, this will cause very different behaviors between the two modes.  In order to ensure that a syndrome operates the same way regardless of mode, add DWF_STRETCH:144 to the end of the CE effect tag.
+
Fort mode runs 72 times faster than Adventure mode - which means that a syndrome that lasts a single tick in Fort Mode will last 72 ticks in Adventure Mode.  For short-term syndromes, this will cause very different behaviors between the two modes.  In order to ensure that a syndrome operates the same way regardless of mode, add DWF_STRETCH:72 to the end of the CE effect tag.
  
It is not possible to make a syndrome that lasts shorter than 144 ticks in Adventure Mode
+
It is not possible to make a syndrome that lasts shorter than 72 ticks in Adventure Mode.
  
 
===Syndromes with no effect===
 
===Syndromes with no effect===
 
There are times you will want to create a syndrome that has no actual effect - generally in order to add a SYN_CLASS that renders the target untargetable by a different interaction.  Syndromes disappear once their effects have expired, so to do this you will need to add an effect that does nothing.
 
There are times you will want to create a syndrome that has no actual effect - generally in order to add a SYN_CLASS that renders the target untargetable by a different interaction.  Syndromes disappear once their effects have expired, so to do this you will need to add an effect that does nothing.
 
Some examples:
 
Some examples:
{{gamedata|title="Dummy" syndrome tags|
+
{{gamedata|title=Useless syndrome tags|
[CE_SPEED_CHANGE:SPEED_PERC:100:START:0:END:1:DWF_STRETCH:144] <-- Makes the target move at 100% of its current speed
+
[CE_SPEED_CHANGE:SPEED_PERC:100:START:0:END:1:DWF_STRETCH:72] <-- Makes the target move at 100% of its current speed
  
[CE_SKILL_ROLL_ADJUST:PERC:100:PERC_ON:0:START:0:END:1:DWF_STRETCH:144] <-- Multiplies the target's skill by 100%, 0% of the time
+
[CE_SKILL_ROLL_ADJUST:PERC:100:PERC_ON:0:START:0:END:1:DWF_STRETCH:72] <-- Multiplies the target's skill by 100%, 0% of the time
  
[CE_MATERIAL_FORCE_MULTIPLIER:PROB:100:MAT_MULT:NONE:NONE:1:1:START:0:END:1:DWF_STRETCH:144] <-- Makes the target take 1/1 times its normal damage from attacks
+
[CE_MATERIAL_FORCE_MULTIPLIER:PROB:100:MAT_MULT:NONE:NONE:1:1:START:0:END:1:DWF_STRETCH:72] <-- Makes the target take 1/1 times its normal damage from attacks
 
}}
 
}}
  
Line 111: Line 110:
 
===Material Emissions With Immunity===
 
===Material Emissions With Immunity===
  
{{gamedata|title=Example interaction raws that may only target unprotected creatures, and the protection interaction|
+
{{gamedata|title=Example [MATERIAL_EMISSION] interaction raws that may only target creatures|
 
  <nowiki>[INTERACTION:CTARGET_BASALT_EMISSION] <-- The projectile itself
 
  <nowiki>[INTERACTION:CTARGET_BASALT_EMISSION] <-- The projectile itself
 
[I_SOURCE:CREATURE_ACTION]
 
[I_SOURCE:CREATURE_ACTION]
Line 143: Line 142:
  
 
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.
 
==Targeted Interactions==
 
Interactions that are specifically intended to target particular types of creatures.
 
 
===Turn Undead===
 
An attack that hits all procedurally-generated zombies and ghouls.
 
{{gamedata|title=Turn Undead|
 
<nowiki>
 
[INTERACTION:TURN_UNDEAD] <- Should work against all zombies and ghouls
 
[I_SOURCE:CREATURE_ACTION]
 
[I_TARGET:A:CREATURE]
 
[IT_LOCATION:CONTEXT_CREATURE]
 
[IT_MANUAL_INPUT:zombies]
 
[IT_CANNOT_HAVE_SYNDROME_CLASS:TURN_UNDEAD]
 
[IT_AFFECTED_CLASS:GENERAL_POISON]
 
[IT_REQUIRES:NO_AGING]
 
[IT_REQUIRES:NO_THOUGHT_CENTER_FOR_MOVEMENT]
 
[IT_REQUIRES:NO_CONNECTIONS_FOR_MOVEMENT]
 
[IT_REQUIRES:OPPOSED_TO_LIFE]
 
[I_EFFECT:ADD_SYNDROME]
 
[IE_TARGET:A]
 
[IE_IMMEDIATE]
 
[SYNDROME]
 
[SYN_NAME:turned]
 
[SYN_CLASS:TURN_UNDEAD]
 
[CE_REMOVE_TAG:NO_DIZZINESS:NONAUSEA:NOFEAR:NOPAIN:NOSTUN:START:0:END:8:DWF_STRETCH:144] <-- This removes the normal undead tags, rendering them vulnerable to the syndrome's other effects.
 
[CE_SKILL_ROLL_ADJUST:PERC:50:PERC_ON:100:START:0:END:8:DWF_STRETCH:144]
 
[CE_DIZZINESS:SEV:200:PROB:100:START:0:END:8:DWF_STRETCH:144]
 
[CE_NAUSEA:SEV:200:PROB:100:START:0:END:8:DWF_STRETCH:144]
 
[CE_PAIN:SEV:100:PROB:100:START:0:END:8:DWF_STRETCH:144]
 
</nowiki>
 
}}
 
 
===Smite Evil===
 
An attack that hits all procedurally-generated bogeymen, night creatures, vampires, werebeasts, demons, and... angels. There does not currently appear to be a way of excluding angels. (Eh, it's DF angels, they probably count as evil anyway).
 
{{gamedata|title=Smite Evil|
 
<nowiki>
 
[INTERACTION:SMITE_EVIL]
 
[I_SOURCE:CREATURE_ACTION]
 
[I_TARGET:A:CREATURE]
 
[IT_LOCATION:CONTEXT_CREATURE]
 
[IT_MANUAL_INPUT:night creatures]
 
[IT_CANNOT_HAVE_SYNDROME_CLASS:SMITE_EVIL]
 
[IT_IMMUNE_CLASS:NOT_EVIL] <-- used to specify custom creatures that have the normal night creature tags but will be immune to the spell.
 
[IT_REQUIRES:NO_DRINK]
 
[IT_REQUIRES:NO_EAT]
 
[IT_REQUIRES:NO_SLEEP]
 
[IT_REQUIRES:NOPAIN]
 
[IT_REQUIRES:NOSTUN]
 
[IT_REQUIRES:NONAUSEA]
 
[IT_REQUIRES:NOFEAR]
 
[IT_REQUIRES:NOEXERT]
 
[IT_REQUIRES:NO_DIZZINESS]
 
[IT_REQUIRES:NO_FEVERS]
 
[IT_REQUIRES:NOBREATHE]
 
[IT_REQUIRES:CAN_LEARN]
 
[IT_REQUIRES:CAN_SPEAK]
 
[I_EFFECT:ADD_SYNDROME]
 
[IE_TARGET:A]
 
[IE_IMMEDIATE]
 
[SYNDROME]
 
[SYN_NAME:smote]
 
[SYN_CLASS:SMITE_EVIL]
 
[CE_REMOVE_TAG:NO_DIZZINESS:NONAUSEA:NOFEAR:NOPAIN:NOSTUN:START:0:END:8:DWF_STRETCH:144]
 
[CE_SKILL_ROLL_ADJUST:PERC:50:PERC_ON:100:START:0:END:8:DWF_STRETCH:144]
 
[CE_DIZZINESS:SEV:200:PROB:100:START:0:END:8:DWF_STRETCH:144]
 
[CE_NAUSEA:SEV:200:PROB:100:START:0:END:8:DWF_STRETCH:144]
 
[CE_PAIN:SEV:100:PROB:100:START:0:END:8:DWF_STRETCH:144]
 
</nowiki>
 
}}
 
  
 
==Multi-Stage Interactions==
 
==Multi-Stage Interactions==
Line 237: Line 166:
 
[SYN_NAME:counting down]
 
[SYN_NAME:counting down]
 
[SYN_CLASS:EXPLOSION_READY_1]
 
[SYN_CLASS:EXPLOSION_READY_1]
[CE_CAN_DO_INTERACTION:START:10:END:11:DWF_STRETCH:144] <--The START affects the amount of time spent in combat before the explosion can occur.
+
[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:ADV_NAME:Draw Energy]
 
[CDI:USAGE_HINT:DEFEND]
 
[CDI:USAGE_HINT:DEFEND]
Line 257: Line 186:
 
[SYN_NAME:ready to explode]
 
[SYN_NAME:ready to explode]
 
[SYN_CLASS:EXPLOSION_READY_2]
 
[SYN_CLASS:EXPLOSION_READY_2]
[CE_FLASH_TILE:TILE:33:4:0:0:FREQUENCY:32:16:START:0:END:2:DWF_STRETCH:144] <-- Flash as a warning
+
[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:144]
+
[CE_SPEED_CHANGE:SPEED_PERC:50:START:0:END:2:DWF_STRETCH:72]
[CE_CAN_DO_INTERACTION:START:1:END:2:DWF_STRETCH:144] <-- The AI will use this and then immediately explode, provided it is still in combat and not affected by EXPLOSION_OVERRIDE.
+
[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:ADV_NAME:Remove safeties]
 
[CDI:USAGE_HINT:DEFEND]
 
[CDI:USAGE_HINT:DEFEND]
Line 278: Line 207:
 
[SYN_NAME:about to explode]
 
[SYN_NAME:about to explode]
 
[SYN_CLASS:EXPLOSION_READY_3]
 
[SYN_CLASS:EXPLOSION_READY_3]
[CE_FLASH_TILE:TILE:33:4:0:0:FREQUENCY:32:16:START:0:END:2:DWF_STRETCH:144]
+
[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:144]
+
[CE_CAN_DO_INTERACTION:START:0:END:1:DWF_STRETCH:72]
 
[CDI:ADV_NAME:Explode]
 
[CDI:ADV_NAME:Explode]
 
[CDI:USAGE_HINT:ATTACK]
 
[CDI:USAGE_HINT:ATTACK]
 
[CDI:INTERACTION:MATERIAL_EMISSION]
 
[CDI:INTERACTION:MATERIAL_EMISSION]
 
[CDI:VERB:explode:explodes:NA]
 
[CDI:VERB:explode:explodes:NA]
[CDI:MATERIAL:CREATURE_MAT:BOMBER:EXPLOSION:UNDIRECTED_DUST] <-- This points to a creature called BOMBER that contains the EXPLOSION material. It is better to put unstable materials in dummy creatures rather than making them INORGANICs, to prevent titans or forgotten beasts from being made of them.
+
[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:C:LINE_OF_SIGHT]
 
[CDI:TARGET_RANGE:C:1]
 
[CDI:TARGET_RANGE:C:1]
Line 302: Line 231:
 
[SYN_NAME:unable to explode]
 
[SYN_NAME:unable to explode]
 
[SYN_CLASS:EXPLOSION_OVERRIDE]
 
[SYN_CLASS:EXPLOSION_OVERRIDE]
[CE_SPEED_CHANGE:SPEED_PERC:100:START:0:END:2:DWF_STRETCH:144]
+
[CE_SPEED_CHANGE:SPEED_PERC:100:START:0:END:2:DWF_STRETCH:72]
 
 
</nowiki>
 
}}
 
 
 
==Transformation Interactions==
 
These are interactions that will cause a creature to transform into another creature.
 
 
 
===Demon Transformation===
 
 
 
This is a fairly straightforward transformation, as it only relies on one caste token. This interaction will transform a creature into a random non-unique demon
 
  
{{gamedata|title=Demon transformation|
 
<nowiki>
 
[INTERACTION:DEMON_POLYMORPH]
 
[I_SOURCE:CREATURE_ACTION]
 
[I_TARGET:A:CREATURE]
 
[IT_LOCATION:CONTEXT_CREATURE]
 
[I_EFFECT:ADD_SYNDROME]
 
[IE_TARGET:A]
 
[IE_IMMEDIATE]
 
[SYNDROME]
 
[SYN_CONCENTRATION_ADDED:1000:0]
 
[CE_BODY_TRANSFORMATION:START:0:PEAK:0:END:5:ABRUPT:DWF_STRETCH:144]
 
[CE:CREATURE_CASTE_FLAG:DEMON]
 
[CE_ADD_TAG:NO_AGING:START:0:PEAK:0:END:5:ABRUPT:DWF_STRETCH:144]
 
 
</nowiki>
 
</nowiki>
 
}}
 
}}
 
Note that this interaction will not work in arena mode due to the lack of generated creatures in that mode. However, it will work if a creature performs the interaction in a loaded world that contains generated demons.
 
 
 
===Vault Guardian Transformation===
 
 
Transformation syndromes that turn a creature into a titan or demon only really rely on the [DEMON] and [TITAN] tokens, but how can the same be achieved with vault guardians? Below is an example of an interaction that will reliably transform a creature into a random angel.
 
 
{{gamedata|title=Angel transformation|
 
<nowiki>
 
[INTERACTION:ANGEL_POLYMORPH]
 
[I_SOURCE:CREATURE_ACTION]
 
[I_TARGET:A:CREATURE]
 
[IT_LOCATION:CONTEXT_CREATURE]
 
[I_EFFECT:ADD_SYNDROME]
 
[IE_TARGET:A]
 
[IE_IMMEDIATE]
 
[SYNDROME]
 
[SYN_CONCENTRATION_ADDED:1000:0]
 
[CE_BODY_TRANSFORMATION:START:0:PEAK:0:END:5:ABRUPT:DWF_STRETCH:144]
 
[CE:FORBIDDEN_CREATURE_FLAG:SMALL_RACE]
 
[CE:FORBIDDEN_CREATURE_FLAG:HAS_ANY_FEATURE_BEAST]
 
[CE:CREATURE_FLAG:GENERATED] this is key, as the generated token is one unique to vault guardians and other "secret" creatures
 
[CE:FORBIDDEN_CREATURE_CASTE_FLAG:DEMON] we have to forbid all types of night creatures and other generated creatures so the game may only choose angels
 
[CE:FORBIDDEN_CREATURE_FLAG:HAS_ANY_NIGHT_CREATURE]
 
[CE:FORBIDDEN_CREATURE_FLAG:HAS_ANY_NIGHT_CREATURE_BOGEYMAN]
 
[CE:FORBIDDEN_CREATURE_FLAG:HAS_ANY_NIGHT_CREATURE_EXPERIMENTER]
 
[CE:FORBIDDEN_CREATURE_FLAG:HAS_ANY_NIGHT_CREATURE_NIGHTMARE]
 
[CE:FORBIDDEN_CREATURE_FLAG:HAS_ANY_NIGHT_CREATURE_HUNTER]
 
[CE:FORBIDDEN_CREATURE_CASTE_FLAG:CANNOT_BREATHE_AIR]
 
[CE:FORBIDDEN_CREATURE_CASTE_FLAG:IMMOBILE_LAND]
 
[CE:FORBIDDEN_CREATURE_CASTE_FLAG:MEGABEAST]
 
[CE:FORBIDDEN_CREATURE_CASTE_FLAG:SEMIMEGABEAST]
 
[CE:FORBIDDEN_CREATURE_CASTE_FLAG:TITAN]
 
[CE:FORBIDDEN_CREATURE_CASTE_FLAG:UNIQUE_DEMON]
 
[CE_ADD_TAG:NO_AGING:START:0:PEAK:0:END:5:ABRUPT:DWF_STRETCH:144]
 
</nowiki>
 
}}
 
 
Note that this interaction will not work in arena mode due to the lack of generated creatures in that mode. However, it will work if a creature performs the interaction in a loaded world that contains vault guardians.
 
 
==See Also==
 
* [[Creature examples]]
 
* [[Reaction examples]]
 
  
 
{{Category|Modding}}
 
{{Category|Modding}}
{{Category|Modding_Examples}}
 

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: