Argh, my little mod for The Earth Strike Back looks doomed. Although I can get the beasties to spawn when the right mineral is mined, I can't seem to juggle the OPPOSED_TO_LIFE tag properly. And the spawned unit isn't acting properly either.
The process begins when an unlucky miner hits some "living stone" (which has a tile visually identical to the layer in which it appears):
[INORGANIC:LIVING DOLOMITE]
[USE_MATERIAL_TEMPLATE:STONE_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:living dolomite]
[STATE_NAME_ADJ:LIQUID:stirring dolomite]
[STATE_NAME_ADJ:GAS:awakening dolomite]
[DISPLAY_COLOR:7:7:1][TILE:137][REACTION_CLASS:FLUX]
[ENVIRONMENT_SPEC:DOLOMITE:CLUSTER_ONE:100]
[ENVIRONMENT_SPEC:HIDDEN BLACK OPAL:CLUSTER_ONE:100]
[IS_STONE][SPECIAL]
[MELTING_POINT:8000]
[BOILING_POINT:9910]
[SOLID_DENSITY:2850]
[SYNDROME]
[SYN_NAME:wake dolomite]
[SYN_INHALED][SYN_INGESTED]
[SYN_AFFECTED_CREATURE:DWARF:ALL]
!CE_SPEED_CHANGE:SPEED_PERC:1:START:1000:END:1200]
[CE_BODY_TRANSFORMATION:START:50:END:1000]
[CE:CREATURE:AWAKENED_STONE:PROGENITOR]
[CE_ADD_TAG:NOT_LIVING:START:0:END:1000]
[CE_CAN_DO_INTERACTION:START:400:END:2000]
[CDI:INTERACTION:AWAKEN_DOLOMITE]
[CDI:TARGET_RANGE:A:10]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:WAIT_PERIOD:400]
[CDI:FREE_ACTION]
[CE_CAN_DO_INTERACTION:START:410:END:2200]
[CDI:INTERACTION:ROUSE_STONE]
[CDI:TARGET_RANGE:A:10]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:WAIT_PERIOD:400]
[CDI:FREE_ACTION]
[CE_CAN_DO_INTERACTION:START:0:END:2200]
[CDI:INTERACTION:OFFEND_DOLOMITE]
[CDI:TARGET_RANGE:A:10]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:WAIT_PERIOD:400]
[CDI:FREE_ACTION]
[INTERACTION:ROUSE_STONE]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:A:CORPSE]
[IT_LOCATION:CONTEXT_ITEM]
[IT_AFFECTED_CLASS:LIVING_STONE]
[IT_CANNOT_TARGET_IF_ALREADY_AFFECTED]
[IT_MANUAL_INPUT:awakened stone]
[I_EFFECT:RESURRECT]
[IE_TARGET:A]
[IE_IMMEDIATE]
[INTERACTION:AWAKEN_DOLOMITE]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:A:CORPSE]
[IT_LOCATION:CONTEXT_ITEM]
[IT_MANUAL_INPUT:creature]
[IT_AFFECTED_CLASS:LIVING_STONE]]
[I_EFFECT:ANIMATE]
[IE_TARGET:A]
[IE_IMMEDIATE]
[SYNDROME]
[SYN_NAME:awakening dolomite]
[SYN_AFFECTED_CLASS:LIVING_STONE]
[CE_IMPAIR_FUNCTION:SEV:1000:PROB:100:BP:BY_CATEGORY:BRAIN:ALL:START:0:END:900]!CE_DISPLAY_TILE:TILE:'â':0:0:1]
[CE_DISPLAY_NAME:NAME:awakened dolomite:awakened dolomites:awakened dolomite]
[CE_BODY_TRANSFORMATION:START:0]
[CE:CREATURE:AWAKENED_STONE:DOLOMITE]
[INTERACTION:OFFEND_DOLOMITE]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:A:CREATURE]
[IT_LOCATION:CONTEXT_CREATURE]
[IT_MANUAL_INPUT:self]
[IT_CANNOT_HAVE_SYNDROME_CLASS:DOLOMITE_TRIBUTE]
[I_EFFECT:ADD_SYNDROME]
[IE_TARGET:A]
[IE_IMMEDIATE]
[SYNDROME]
[CE_CAN_DO_INTERACTION:START:415:END:2000]
[CDI:INTERACTION:ANGER_DOLOMITE]
[CDI:TARGET_RANGE:A:10]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:WAIT_PERIOD:400]
[CDI:FREE_ACTION]
To counter this risk, the earth is dotted with nice clusters of valuable "hidden gems":
[INORGANIC:HIDDEN BLACK OPAL] Mimics dolomite.
[USE_MATERIAL_TEMPLATE:STONE_TEMPLATE]
[TILE:137][IS_GEM:hidden black opal:STP:OVERWRITE_SOLID]
[TILE_COLOR:7:7:1][MATERIAL_VALUE:40]
[BUILD_COLOR:0:7:1][BASIC_COLOR:0:1]
[ENVIRONMENT_SPEC:DOLOMITE:CLUSTER_SMALL:100]
[SOLID_DENSITY:2115] Common to opals. Range is 1980 - 2250
[STATE_COLOR:ALL_SOLID:BLACK]
What is
supposed to happen is that a typical miner gets an OPPOSED_TO_LIFE tag, transforms into a "progenitor" that drops a bodypart, the bodypart is animated and then resurrected (inheriting the OPPOSED_TO_LIFE), and the miner transforms back.
An alternate is if the Dwarf previously went to a Tribute workshop and sacrificed an appropriate gem. This gives a permanent syndrome that makes the Dwarf immune to the syndrome that creates the OPPOSED_TO_LIFE tag. So, the Awakened Stone should not inherit OPPOSED_TO_LIFE and therefore be friendly.
[INORGANIC:TESB_DOLOMITE_FAVOR]
[USE_MATERIAL_TEMPLATE:STONE_TEMPLATE]
[STATE_NAME_ADJ:ALL:dolomite favor]
[DISPLAY_COLOR:1:1:1][TILE:'*'][ITEM_SYMBOL:'*'][STATE_COLOR:ALL:AZURE]
[IS_STONE][SPECIAL]
[MELTING_POINT:8000]
[BOILING_POINT:9910]
[SOLID_DENSITY:2430]
[SYNDROME]
[SYN_NAME:dolomite favor]
[SYN_INHALED][SYN_INGESTED]
[SYN_AFFECTED_CREATURE:DWARF:ALL]
[SYN_CLASS:DOLOMITE_TRIBUTE]
[CE_MATERIAL_FORCE_MULTIPLIER:MAT_MULT:INORGANIC:DOLOMITE:1:2:START:0]
[BUILDING_WORKSHOP:TRIBUTE_DOLOMITE]
[NAME:Tribute to Dolomite]
[NAME_COLOR:7:0:1]
[DIM:3:3]
[WORK_LOCATION:2:2]
[BUILD_LABOR:MASON]
[BLOCK:1:1:0:1]
[BLOCK:2:0:0:0]
[BLOCK:3:1:0:1]
[TILE:0:1:7:',':7]
[TILE:0:2:39:96:'.']
[TILE:0:3:7:',':7]
[COLOR:0:1:7:7:1:7:7:1:7:7:1]
[COLOR:0:2:7:7:1:7:7:1:7:7:1]
[COLOR:0:3:7:7:1:7:7:1:7:7:1]
[TILE:1:1:'O':',':7]
[TILE:1:2:39:7:'.']
[TILE:1:3:7:',':7]
[COLOR:1:1:7:7:1:7:7:1:7:7:1]
[COLOR:1:2:7:7:1:7:7:1:7:7:1]
[COLOR:1:3:7:7:1:7:7:1:7:7:1]
[TILE:2:1:'O':',':'O']
[TILE:2:2:39:'O':'.']
[TILE:2:3:7:',':7]
[COLOR:2:1:7:7:1:7:7:1:7:7:1]
[COLOR:2:2:7:7:1:7:7:1:7:7:1]
[COLOR:2:3:7:7:1:7:7:1:7:7:1]
[TILE:3:1:'O':',':'O']
[TILE:3:2:39:'O':'.']
[TILE:3:3:7:',':'O']
[COLOR:3:1:7:7:1:7:7:1:7:7:1]
[COLOR:3:2:7:7:1:7:7:1:7:7:1]
[COLOR:3:3:7:7:1:7:7:1:7:7:1]
[TILE:4:1:'O':',':'O']
[TILE:4:2:39:'O':'.']
[TILE:4:3:'O':'.':'O']
[COLOR:4:1:7:7:1:7:7:1:7:7:1]
[COLOR:4:2:7:7:1:7:7:1:7:7:1]
[COLOR:4:3:7:7:1:7:7:1:7:7:1]
[TILE:5:1:'O':'.':'O']
[TILE:5:2:'.':239:'.']
[TILE:5:3:'O':'.':'O']
[COLOR:5:1:7:7:1:7:7:1:7:7:1]
[COLOR:5:2:7:7:1:7:7:1:7:7:1]
[COLOR:5:3:7:7:1:7:7:1:7:7:1]
[BUILD_ITEM:3:BLOCKS:NONE:INORGANIC:DOLOMITE]
[REACTION:TRIBUTE_TO_DOLOMITE]
[NAME:sacrifice large gem]
[BUILDING:TRIBUTE_DOLOMITE:CUSTOM_L]
[REAGENT:sacrifice:1:GEM:NONE:NONE:NONE]
[PRODUCT:100:1:BOULDER:NONE:INORGANIC:TESB_DOLOMITE_FAVOR]
[SKILL:MINING]
[REACTION:TRIBUTE_TO_DOLOMITE2]
[NAME:sacrifice hidden black opal gem]
[BUILDING:TRIBUTE_DOLOMITE:CUSTOM_H]
[REAGENT:sacrifice:1:SMALLGEM:NONE:INORGANIC:HIDDEN BLACK OPAL]
[PRODUCT:100:1:BOULDER:NONE:INORGANIC:TESB_DOLOMITE_FAVOR]
[SKILL:MINING]
What
actually happens is that any friendly creature nearby gets in a fight with the progenitor, and the Awakened Stone is always listed as a "Friendly" creature in the "other" column... and proceeds to pick a fight with whatever is nearby. I haven't optimized the timing of the transformations yet, but that shouldn't be the issue.
So I've got three problems. One is that the OPPOSED_TO_LIFE tag doesn't end up where it belongs; Two is that it doesn't matter because the spawned unit is always in civ -1 and acts hostile while claiming to be friendly; and Three is that the syndromes don't take effect 100% of the time, which is most troubling for that expensive Tribute. If the Awakened Stones are just going to be another hostile animal species, I might as well put them in the caverns and dispense with the mining incidents and the Tribute. That is not
remotely as interesting as a mod.
In a moment of weakness I downloaded the Spawnunit script for DFHack to see if that would help, and it just generates errors (tried Putnam's and Warmist's versions). Putnam's gives "attempt to index field 'random' (a nil value)" Warmist's gives "Cannot write field unit.T_body.infect_level: not found."
Apparently the earth doesn't want to strike back