Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DFHack - how to remove werebeast curse?  (Read 15693 times)

asmoug

  • Escaped Lunatic
    • View Profile
DFHack - how to remove werebeast curse?
« 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:

  • show-unit-syndromes
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

  • printing all syndromes

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).

  • first attempt to remove the syndrome with syndrome-util

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.

  • add-syndrome

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?
Logged

Atomic Chicken

  • Bay Watcher
    • View Profile
Re: DFHack - how to remove werebeast curse?
« Reply #1 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).
Logged
As mentioned in the previous turn, the most exciting field of battle this year will be in the Arstotzkan capitol, with plenty of close-quarter fighting and siege warfare.  Arstotzka, accordingly, spent their design phase developing a high-altitude tactical bomber. 

Saiko Kila

  • Bay Watcher
  • Dwarven alchemist
    • View Profile
Re: DFHack - how to remove werebeast curse?
« Reply #2 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.
Logged

DaSwayza

  • Bay Watcher
    • View Profile
Re: DFHack - how to remove werebeast curse?
« Reply #3 on: October 07, 2020, 05:06:54 pm »

How would you use this to add a vampire curse?
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack - how to remove werebeast curse?
« Reply #4 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.)
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

ldog

  • Bay Watcher
    • View Profile
Re: DFHack - how to remove werebeast curse?
« Reply #5 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.
Logged
Quote from: Dirst
For example, if you wanted to check if a unit was eligible to be a politician or a car salesman, you'd first want to verify that there is no soul present...

Quote from: gchristopher
The more appropriate question becomes, are they awesome and dwarven enough.

Grimm Spector

  • Bay Watcher
    • View Profile
Re: DFHack - how to remove werebeast curse?
« Reply #6 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.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack - how to remove werebeast curse?
« Reply #7 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"
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Grimm Spector

  • Bay Watcher
    • View Profile
Re: DFHack - how to remove werebeast curse?
« Reply #8 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.
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack - how to remove werebeast curse?
« Reply #9 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.
Logged