Bay 12 Games Forum

Dwarf Fortress => DF Modding => Utilities and 3rd Party Applications => Topic started by: asmoug on February 12, 2019, 02:44:15 pm

Title: DFHack - how to remove werebeast curse?
Post by: asmoug on February 12, 2019, 02:44:15 pm
Hello all, I have a couple dorfs infected with a werebeast curse, and I was wondering if I could remove the curse with DFHack without having to kill them.

I've been trying a couple of things so far, but unsuccesfully:

This one can show the infected units, so supposedly the werebeast curse can be treated as a syndrome(?), and they show up like this:
Code: [Select]
sibrek mosusmor
- Mystery [permanent]
-  - Transformation [permanent] Weregoat


This is where it starts to get confusing, because I've then tried to print all syndromes (as I wasn't sure of what the syndrome name was) with this inline script (via ":lua"):
Code: [Select]
    for _,syn in ipairs(df.global.world.raws.syndromes.all) do
        print(syn.syn_name)
    end

and well, there does not seem to be such thing as a werebeast syndrome... I get lots of inebriation, titan sickness, lots of different sicknesses, but no werebeast (or mistery or weregoat or wereanything).


looking through the list of syndromes in df.syndrome.xml I've found a "BODY_TRANSFORMATION" syndrome, so I tried with
Code: [Select]
for _, unit in ipairs(df.global.world.units.active) do
    if dfhack.units.isCitizen(unit) then
        synutil.eraseSyndromes(unit, "BODY_TRANSFORMATION")
    end
end
but again, no change.


last thing I tried is the add-syndrome script. I've found the dorf ID with cprobe, then tried "add-syndrome  -target <ID> -erase -syndrome <many different attempts were made to fill this space>" but it keeps saying the syndrome name is invalid.

Help?
Title: Re: DFHack - how to remove werebeast curse?
Post by: Atomic Chicken on February 16, 2019, 01:35:22 pm
Werebeast syndromes are generated without a name, but they all come with the "WERECURSE" SYN_CLASS token. The solution is therefore very simple:
Code: [Select]
modtools/add-syndrome -eraseClass WERECURSE -target <ID>(Replace <ID> with the unit ID of your target).
Title: Re: DFHack - how to remove werebeast curse?
Post by: Saiko Kila on February 19, 2019, 07:46:36 am
Hello all, I have a couple dorfs infected with a werebeast curse, and I was wondering if I could remove the curse with DFHack without having to kill them.

The easiest way to remove curses (like vampirism or werecurse), or any other syndrome in my opinion is to use gui/gm-editor on the unit, get to the
syndromes/active/[ID1]/symptoms/[ID2]/flags and activate the "disabled" flag (change from false to true). The syndrome/curse will be cleared on the next tick by the game itself. I use it mostly with adventurer (damn mummy curses), but it works in fortress mode too.

If the unit has only one curse, then [ID1] and [ID2] are both 0, otherwise you may need to experiment a bit, look up the syndrome by ids to identify it - or just remove all syndromes.
Title: Re: DFHack - how to remove werebeast curse?
Post by: DaSwayza on October 07, 2020, 05:06:54 pm
How would you use this to add a vampire curse?
Title: Re: DFHack - how to remove werebeast curse?
Post by: lethosor on October 09, 2020, 04:53:56 pm
How would you use this to add a vampire curse?
This thread is quite old - you would likely get more visibility if you asked in the DFHack thread. (I don't know the answer myself.)
Title: Re: DFHack - how to remove werebeast curse?
Post by: ldog on August 29, 2021, 08:12:58 pm
This also still works nicely. I was able to cure a vampire following the steps provided.
Of course they died of old age right after.
Title: Re: DFHack - how to remove werebeast curse?
Post by: Grimm Spector on October 21, 2021, 04:58:04 pm
Hello all, I have a couple dorfs infected with a werebeast curse, and I was wondering if I could remove the curse with DFHack without having to kill them.

The easiest way to remove curses (like vampirism or werecurse), or any other syndrome in my opinion is to use gui/gm-editor on the unit, get to the
syndromes/active/[ID1]/symptoms/[ID2]/flags and activate the "disabled" flag (change from false to true). The syndrome/curse will be cleared on the next tick by the game itself. I use it mostly with adventurer (damn mummy curses), but it works in fortress mode too.

If the unit has only one curse, then [ID1] and [ID2] are both 0, otherwise you may need to experiment a bit, look up the syndrome by ids to identify it - or just remove all syndromes.

I have three possible mummy curses, they're listed as "Mystery [permanent]" in the show-unit-syndromes command

When I use the gui editor and go to their flags I don't see a disabled flag, I see "is_sick", "is_sick_low", and then numerically titled ones from 2 to 31. So I'm not sure how I can use this to remove the mummy curse. :-\ any advice would be super helpful, thanks.
Title: Re: DFHack - how to remove werebeast curse?
Post by: lethosor on October 21, 2021, 09:57:14 pm
When I use the gui editor and go to their flags I don't see a disabled flag, I see "is_sick", "is_sick_low", and then numerically titled ones from 2 to 31. So I'm not sure how I can use this to remove the mummy curse. :-\ any advice would be super helpful, thanks.
You're looking in the wrong place - you need to look at the flags of the symptoms, not the syndrome itself:

syndromes/active/[ID1]/symptoms/[ID2]/flags

What you are currently looking at instead is "syndromes/active/[ID1]/flags"
Title: Re: DFHack - how to remove werebeast curse?
Post by: Grimm Spector on October 21, 2021, 11:28:37 pm
When I use the gui editor and go to their flags I don't see a disabled flag, I see "is_sick", "is_sick_low", and then numerically titled ones from 2 to 31. So I'm not sure how I can use this to remove the mummy curse. :-\ any advice would be super helpful, thanks.
You're looking in the wrong place - you need to look at the flags of the symptoms, not the syndrome itself:

syndromes/active/[ID1]/symptoms/[ID2]/flags

What you are currently looking at instead is "syndromes/active/[ID1]/flags"


Ahhhh. I see, that helps. Thanks so much! So many values that I have no idea what they do.
Title: Re: DFHack - how to remove werebeast curse?
Post by: PatrikLundell on October 22, 2021, 03:46:08 am
Flags named with just a number either don't do anything, or the DFHack community hasn't figured out what they do. In many cases only the first few flags actually do anything, while the rest of them exist only because that's how memory is allocated for sets of flags, so you get unused bits.