Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Let's talk adding an effect to an alcoholic drink, right quick  (Read 738 times)

Walkaboutout

  • Bay Watcher
    • View Profile
Let's talk adding an effect to an alcoholic drink, right quick
« on: December 19, 2016, 11:48:12 am »

I'd like to add an effect to an alcoholic drink, in game. Let's take Sunshine for example. How would I go about doing this? Does it have to be done via Syndrome? I assume so. How can the effect be made temporary?

So, let's say I'd like a drink of Sunshine to increase the healing ability of the drinker, for like 7 days or something. Is that even possible? Would it be possible to have it just heal the drinker altogether of any wounds? I don't like that approach at all, as I'd like to make it something less dramatic (such as the aforementioned temporary bolstering of the healing/recovery stat of a creature).

With the below example of code for the sunberries (which is where the details of the drink brewed from it is declared), what would I add to it, exactly?

Code: [Select]

(PLANT:BERRY_SUN)
(NAME:sun berry)(NAME_PLURAL:sun berries)(ADJ:sun berry)
(USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE)
(MATERIAL_VALUE:3)
(EDIBLE_VERMIN)
(EDIBLE_RAW)
(EDIBLE_COOKED)
(MATERIAL_REACTION_PRODUCT:DRINK_MAT:LOCAL_PLANT_MAT:DRINK)
(MATERIAL_REACTION_PRODUCT:SEED_MAT:LOCAL_PLANT_MAT:SEED)
(BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL)
(PICKED_TILE:161)(PICKED_COLOR:6:14:0)
(WET)(GOOD)
(BIOME:NOT_FREEZING)
(VALUE:3)
(USE_MATERIAL_TEMPLATE:DRINK:PLANT_ALCOHOL_TEMPLATE)
(STATE_NAME_ADJ:ALL_SOLID:frozen Sunshine)
(STATE_NAME_ADJ:LIQUID:Sunshine)
(STATE_NAME_ADJ:GAS:boiling Sunshine)
(MATERIAL_VALUE:5)
(DISPLAY_COLOR:14:0:0)
(EDIBLE_RAW)
(EDIBLE_COOKED)
(PREFIX:NONE)
(DRINK:LOCAL_PLANT_MAT:DRINK)
(SPRING)(SUMMER)(AUTUMN)(WINTER)
(FREQUENCY:100)
(CLUSTERSIZE:5)
(PREFSTRING:inner light)
(USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE)
(MATERIAL_VALUE:2)
(EDIBLE_VERMIN)
(EDIBLE_COOKED)
(SEED:sun berry seed:sun berry seeds:14:0:0:LOCAL_PLANT_MAT:SEED)
(SHRUB_TILE:6)
(DEAD_SHRUB_TILE:164)
(SHRUB_COLOR:15:14:0)
(DEAD_SHRUB_COLOR:7:7:0)

Logged

burrito25man

  • Bay Watcher
    • View Profile
Re: Let's talk adding an effect to an alcoholic drink, right quick
« Reply #1 on: December 19, 2016, 02:19:15 pm »

quite easily actually. syndromes would be the best choice for the effect you are trying to go for. The wiki spells out quite nicely how they work. What you want to do is add the syndrome under the "USE_MATERIAL_TEMPLATE:DRINK:PLANT_ALCOHOL_TEMPLATE" tag, before the "DRINK:LOCAL_PLANT_MAT:DRINK" tag.

For healing ability, you want the syndrome to increase the dwarf's Recuperation physical attribute to 5000, for amazing healing ability. To actually heal wounds like magic, you're looking at a transformation type of thing (assuming you want to do it without the help of dfhack).

The entire syndrome can potentially look like this


Spoiler (click to show/hide)


granted I havent tested it, but its a place to start. Hope that helped!
Logged
It's a slippery slope.  You start out modding, then move on to hard DFHacking, and next thing you know you're making your own games...

LUA Script: Workaround for butchering Sentients
 - http://www.bay12forums.com/smf/index.php?topic=165414.0

Walkaboutout

  • Bay Watcher
    • View Profile
Re: Let's talk adding an effect to an alcoholic drink, right quick
« Reply #2 on: December 19, 2016, 02:33:04 pm »

Immensely helpful Burrito, thank you so much! I wasn't sure quite how to define things in there, etc. Your sample, as you said, is at least what I need to get started with testing and perfecting. Any walls I find, I'll follow up with more posts here. Thanks again sir!
Logged

Walkaboutout

  • Bay Watcher
    • View Profile
Re: Let's talk adding an effect to an alcoholic drink, right quick
« Reply #3 on: December 19, 2016, 10:29:14 pm »

So, to report back, that doesn't appear to have worked.

I was testing with a 32 bit version of the latest DF so I could use Therapist to observe dwarven recuperation scores. Anyone drinking from the Sunshine didn't see an increase in their recuperation stat, sadly.

I'm messing with syntax combos on the effect and syndrome, to see if perhaps there's just an issue there. It may also be something with the (CE_PHYS_ATT_CHANGE:RECUPERATION:100:5000:START:0:END:8400)   tag as the wiki seems to be uncertain as to the numbers directly after it. One is a percentage (a percentage of what? chance to happen I assume?), and the second number, in this case the 5000, is shown with a question mark beside it on the wiki.

Perhaps the effect isn't working right? Regardless, I'll continue to experiment. If anyone has additional input, please chime in!

P.S. There's always the possibility that a temp stat change like that doesn't report via the dwarf's natural number in that attribute (looking at it through Dwarf Therapist for example), but somehow I doubt that. Though, you never know of course.
« Last Edit: December 19, 2016, 10:30:47 pm by Walkaboutout »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Let's talk adding an effect to an alcoholic drink, right quick
« Reply #4 on: December 19, 2016, 11:32:52 pm »

Recuperation from syndromes is separate from base recuperation, it's more reliable to look at dwarf description or use dfhack

The first number is a percentage boost (200 means it doubles recuperation) and the second is a flat boost (+5000 recuperation).

Walkaboutout

  • Bay Watcher
    • View Profile
Re: Let's talk adding an effect to an alcoholic drink, right quick
« Reply #5 on: December 19, 2016, 11:52:55 pm »

Thanks Putnam, greatly appreciated.

So, it's base recuperation I'm interested in of course (such as healing from a broken limb, given proper hospital care, hah!). That should relate in dwarf descriptions as it changes, right?

Also, it seems like I'm going to try and do a 300% increase....healing rate is tripled while under the effects, depending of course on their natural number, and leave the flat increase at 0. Shall see if this works!
« Last Edit: December 19, 2016, 11:56:20 pm by Walkaboutout »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Let's talk adding an effect to an alcoholic drink, right quick
« Reply #6 on: December 19, 2016, 11:55:24 pm »

It's not base recuperation you're interested in, it's effective recuperation, which is shown in dwarf descriptions as you say.

Walkaboutout

  • Bay Watcher
    • View Profile
Re: Let's talk adding an effect to an alcoholic drink, right quick
« Reply #7 on: December 19, 2016, 11:56:56 pm »

That did it! I suspect it's the percentage thing. Using 100:5000 resulted in no change in their description, etc. Changing it to 1000:0 just increased the dwarf that drank by a factor of 10 in recuperation. He went from having no notable amount in descriptions to having amazing recuperative powers. Yay! Now to follow him for a bit and ensure it disappears as intended.

Thanks again Burrito and Putnam!

(EDIT: And indeed, the effect disappeared after around 7 days. You fellas are brilliant!)
« Last Edit: December 20, 2016, 12:05:30 am by Walkaboutout »
Logged

Walkaboutout

  • Bay Watcher
    • View Profile
Re: Let's talk adding an effect to an alcoholic drink, right quick
« Reply #8 on: December 20, 2016, 12:19:59 am »

For what it's worth to anyone whose interested, it looks like perhaps my initial issue was NOT the percentage vs. flat boost portion of the CE token, but rather the

(SYN_AFFECTED_CLASS:ALL)

tag. Maybe. So, when I got it working as posted above, I had also changed the class/caste to GENERAL_POISON. I changed that class/caste back to the above, ALL, and now it seems to not work. Maybe I'm just seeing other issues, or I'm tired, who knows. But it's possible the ALL class/caste isn't working as expected for me here. Interesting to note and I'll experiment a little more, just to ensure that this is the case.

EDIT: Okay, so I just tried it and that's it. The ALL above doesn't work, but GENERAL_POISON does. So for anyone interested, here was the final syndrome setup I ended up with, which works. I use brackets of course in the raws, and not the parentheses that are below.
Code: [Select]
(SYNDROME)
(SYN_NAME:Sunshine Effect)
(SYN_AFFECTED_CLASS:GENERAL_POISON)
(SYN_INGESTED)
(SYN_NO_HOSPITAL)
(CE_PHYS_ATT_CHANGE:RECUPERATION:300:0:START:10:END:8400)
« Last Edit: December 20, 2016, 12:30:44 am by Walkaboutout »
Logged