I’m trying to make an enemy that puts the player/enemies to sleep with knockout gas. How do I make the gas apply the effect? I’m basing it on tear gas, and have found the tear gas itself in field_type.json and the Tear gas effect in effects.json, but I can’t tell how they are associated with each other, how the game knows what effect to apply when creatures step into the gas.
That’s probably hardcoded. Luckily for you, this very recently got JSON-ized.
You can see an example here https://github.com/CleverRaven/Cataclysm-DDA/pull/35618/files.
It’s no longer hard coded, some of it is quite freshly changed. A lot of it is documented in effect_types.md but that file is slightly out of date now. Let me know if I can help