Hi everyone,
I thought it would be nice to give a little example of what you can do with expwnents autosyndrome, besides applying syndromes directly to people. This alone is huge, but it can do even more. The script can run dfhack commands from a reaction. This means your dwarves can control dfhack.
Here is a small example: Running 'siren' from a reaction. I made a little building, called the Alarm Siren. It needs a mechanism to be build, any dwarf can run the reaction, which is called: Sound the alarm. When this is done, dfhack will automatically run the siren script. What it does? Siren Script Readme: Wakes up sleeping units, cancels breaks and stops parties either everywhere, or in the burrows given as arguments. In return, adds bad thoughts about noise, tiredness and lack of protection. Also, the units with interrupted breaks will go on break again a lot sooner. The script is intended for emergencies, e.g. when a siege appears, and all your military is partying.
This is how it looks ingame:
[PERMITTED_BUILDING:ALARM]
[PERMITTED_REACTION:SIREN]
[INORGANIC:SIREN]
[USE_MATERIAL_TEMPLATE:STONE_VAPOR_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:bug26]
[STATE_NAME_ADJ:LIQUID:bug26]
[STATE_NAME_ADJ:GAS:Alarm Sound]
[SYNDROME]
[SYN_CLASS:\COMMAND] autosyndrome command begins here
[SYN_CLASS:siren]
[SYN_NAME:siren]
[SYN_CONTACT]
[SYN_INHALED]
[SYN_AFFECTED_CREATURE:DWARF:ALL][SYN_AFFECTED_CREATURE:KOBOLD_CAMP:ALL]
[CE_SPEED_CHANGE:SPEED_PERC:100:START:0:END:1]
[DISPLAY_COLOR:4:4:1][TILE:'*']
[MELTING_POINT:900]
[BOILING_POINT:905]
[SOLID_DENSITY:55520]
[MATERIAL_VALUE:1]
[REACTION:SIREN]
[NAME:Sound the alarm]
[BUILDING:ALARM:CUSTOM_A]
[PRODUCT:100:1:BOULDER:NONE:INORGANIC:SIREN]
[BUILDING_WORKSHOP:ALARM]
[NAME:Alarm Siren]
[NAME_COLOR:4:0:1]
[BUILD_LABOR:MECHANIC]
[BUILD_KEY:CUSTOM_ALT_N]
[DIM:3:2]
[WORK_LOCATION:2:2]
[BLOCK:1:0:0:0]
[BLOCK:2:0:0:0]
[TILE:0:1:32:32:43]
[TILE:0:2:43:149:32]
[COLOR:0:1:0:0:0:0:0:0:7:0:1]
[COLOR:0:2:7:0:1:7:0:1:0:0:0]
[TILE:1:1:32:43:43]
[TILE:1:2:222:149:32]
[COLOR:1:1:0:0:0:7:0:1:7:0:1]
[COLOR:1:2:7:0:1:7:0:1:0:0:0]
[TILE:2:1:43:43:43]
[TILE:2:2:222:149:43]
[COLOR:2:1:7:0:1:7:0:1:7:0:1]
[COLOR:2:2:7:0:1:7:0:1:7:0:1]
[TILE:3:1:43:33:43]
[TILE:3:2:222:162:221]
[COLOR:3:1:7:0:1:7:0:1:7:0:1]
[COLOR:3:2:7:0:1:7:0:1:7:0:1]
[BUILD_ITEM:1:TRAPPARTS:NONE:NONE:NONE][CAN_USE_ARTIFACT]
Edit*: The STONE_VAPOR_TEMPLATE is a simple stone template copy that boils away on 8000 urist and has a fixed temperature of 8100 urist.
And this is it. Any script can be called. Following things have to be considered when using this:
- You need to create a boiling rock that is below or equal to 9000 Urist.
- You need the \COMMAND as the first syn_class.
- You need the wanted script as the second syn_class.
- If you have two words, for example "weather rain", you have to make two syn_classes. One called "weather" and a second one "rain"
- You can add as many scripts to one material as you want, but only one command on each syndrome.
- If you want two commands, simply add two syndromes to the material, using two \COMMAND syn_classes.
Hope this helps people using this awesome feature. I can already think of many uses, especially religious and magic-related. Ceremony of True-Sight = reveal, Pray to Armok to smite your opponents = killrace goblin, Invoke elven nature magic = grow/regrass, Activate weather control device = weather rain.
Useful links:
DFHACK READMEExpwnents How-To Autosyndrome PostAutosyndrome Source Code on GithubIf anyone has suggetions on how to further use this, please feel free to post them here.
Edit: Just wanted to add that you need dfhack r3 for this, and that everything posted here is of course open source. If you want to use it in a mod, just copy it.