Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Spawn creature through reagent/material?  (Read 704 times)

Bjorn

  • Bay Watcher
    • View Profile
Spawn creature through reagent/material?
« on: October 04, 2022, 09:39:14 am »

Hey there folks, I have never modded magic or anything of that sort before, but I was wondering if it's possible to mod a power that permits you to spawn a specific creature using a specific material this material being consumed by the reaction?

I was looking at the page talking about adapting existing works to mods and I saw someone suggesting a Steven Universe mod. I don't want to make that particular mod, but I'm interested in the idea of a "constructed civilization", as in creatures that don't reproduce sexually but instead through being built. Something like a golem-like civ. I can simulate that by making them genderless (which would make each one of unknown parentage), immortal and reliant in either migrants or building others. The flow I was thinking of is:
Build a spawning workshop -> harvest gems and metal -> depending on the material used, they can build an unactivated golem body (placeholder name) -> Build a golem "core" with the gem -> they "activate it" (i.e. spawn a creature and destroy the "unnactivated golem" object and gem).

If the golem dies, it should have a gem core inside it and a body of the material it was made of. Which I imagine can be stimulated with an abundance of castes.

My major question is if you can actually spawn new creatures through specific reagents and destroy said reagents.
« Last Edit: October 04, 2022, 09:41:17 am by Bjorn »
Logged

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: Spawn creature through reagent/material?
« Reply #1 on: October 04, 2022, 03:25:07 pm »

Not directly, as reactions cannot directly induce interactions or syndromes, only produce items. You would have to have the reaction produce an item made of a material that causes a syndrome that gives the "infected" a CAN_DO_INTERACTION which summons the creature desired. For the syndrome-bearing item, you can either use a foodstuff and wait for someone to eat it, which is quite slow but reliable, or have the material boil at room temperature, and if the creature in the workshop a) doesnt immediately run off and b) takes a breath while surrounded by the cloud, theyll become infected and soon after use the interaction. If you use that method, 50-75% of reactions will fail to have any result because creatures dont breathe on every tick, so the reagents should be cheap.

So depending on which method you use, your golems must either eat or breathe. You could also do a drink, but that can be frustrated by the bug where dwarves dump the contents of a drink barrel/their mug spontaneously. (cancels drink; job item lost or destroyed, puddle of drink on the ground under them) Using the food method, if the material is cookable you also have the option to exploit that by baking it into roasts with other foodstuffs, whereupon each resulting roast carries the syndrome, multiplied by the number of roasts in the stack.

This is what I use, using the consumable food method:
Spoiler (click to show/hide)

There is a DFHack script to trigger a creature create command on reaction completion, but I dont understand lua scripting or how to implement it, and of course you would be dependent on dfhack as well then. But, i understand its much easier and faster to do it once you do figure it out. Thing is, ive also never seen anyone post a step-by-step guide on how to do that, especially for someone that isnt familiar with either dfhack or lua scripting.
Logged
I make Spellcrafts!
I have no idea where anything is. I have no idea what anything does. This is not merely a madhouse designed by a madman, but a madhouse designed by many madmen, each with an intense hatred for the previous madman's unique flavour of madness.