Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Memory Eraser Mod  (Read 247 times)

SuaveChinchillaMan

  • Bay Watcher
    • View Profile
Memory Eraser Mod
« on: November 19, 2024, 05:51:23 am »

Hey, so I've got a modding quandry: Is there any way for syndromes, or any other effect to erase a creatures memories once it comes into effect, so that the creature doesn't hold a drug? Basically, so you can have something like a mind control spell, or a mutant virus that transforms or affects the creature, and also makes it no longer want to attack whatever had attack it in the past? Or could this only be don with weird DFHack/ lua script fuckery?
Logged

Tachytaenius

  • Bay Watcher
    • View Profile
Re: Memory Eraser Mod
« Reply #1 on: November 19, 2024, 12:33:14 pm »

Definitely-- as far as I'm aware-- the realm of DFHack and Lua. But that's a good thing to work in! Just say "DFHack required" on your mod and put scripts inside the mod zip as DFHack lets you (the modding guide shows you how).
You can set a function to run when a unit is infected with a syndrome. That function can do whatever you want to the unit/histfig, like clearing vectors related to memories (which you can see with the gui/gm-editor script). See onSyndrome here: https://docs.dfhack.org/en/latest/docs/dev/Lua%20API.html#list-of-events
And see the guide I wrote with myk a while ago: https://docs.dfhack.org/en/50.14-r1/docs/guides/modding-guide.html
And of course, try the DFHack discord to learn specifics. In fact, that's what I'd really encourage you to do. It's not really doable to just explain everything you could possibly need in a forum post, at least for me. All that is unless for some reason DFHack is outside the realm of things you want to work in?
Logged
"Even if they are natural laws, I cannot allow it!"

SuaveChinchillaMan

  • Bay Watcher
    • View Profile
Re: Memory Eraser Mod
« Reply #2 on: November 19, 2024, 04:01:17 pm »

Definitely-- as far as I'm aware-- the realm of DFHack and Lua. But that's a good thing to work in! Just say "DFHack required" on your mod and put scripts inside the mod zip as DFHack lets you (the modding guide shows you how).
You can set a function to run when a unit is infected with a syndrome. That function can do whatever you want to the unit/histfig, like clearing vectors related to memories (which you can see with the gui/gm-editor script). See onSyndrome here: https://docs.dfhack.org/en/latest/docs/dev/Lua%20API.html#list-of-events
And see the guide I wrote with myk a while ago: https://docs.dfhack.org/en/50.14-r1/docs/guides/modding-guide.html
And of course, try the DFHack discord to learn specifics. In fact, that's what I'd really encourage you to do. It's not really doable to just explain everything you could possibly need in a forum post, at least for me. All that is unless for some reason DFHack is outside the realm of things you want to work in?

Underrated reply.
Logged

joostheger

  • Bay Watcher
    • View Profile
Re: Memory Eraser Mod
« Reply #3 on: November 20, 2024, 03:25:50 am »

You could try something affecting it's mental attributes. There is an attribute called 'Memory'. using syndromes you can affect stuff like this.
https://dwarffortresswiki.org/index.php/Attribute#Soul_attributes
https://dwarffortresswiki.org/index.php/Creature_token#MENT_ATT_RATES

Maybe if you set the creatures memory-capacity to 0, it might forget everything it knows. Worth a try.

https://dwarffortresswiki.org/index.php/Syndrome#CE_MENT_ATT_CHANGE
Logged

Tachytaenius

  • Bay Watcher
    • View Profile
Re: Memory Eraser Mod
« Reply #4 on: November 20, 2024, 03:52:36 am »

You could try something affecting it's mental attributes. There is an attribute called 'Memory'. using syndromes you can affect stuff like this.
https://dwarffortresswiki.org/index.php/Attribute#Soul_attributes
https://dwarffortresswiki.org/index.php/Creature_token#MENT_ATT_RATES

Maybe if you set the creatures memory-capacity to 0, it might forget everything it knows. Worth a try.

https://dwarffortresswiki.org/index.php/Syndrome#CE_MENT_ATT_CHANGE

Doubtful that will work—I had a hermit scholar whose attributes I didn't control. I believe her memory went to zero (or at least near zero) after a few centuries but I could still see she was having thoughts and all that. Worth a try regardless.
Besides, how will you make them forget poetic forms, relationships, scholarly knowledge, etc?
« Last Edit: November 20, 2024, 03:56:52 am by Tachytaenius »
Logged
"Even if they are natural laws, I cannot allow it!"

SuaveChinchillaMan

  • Bay Watcher
    • View Profile
Re: Memory Eraser Mod
« Reply #5 on: November 20, 2024, 11:54:35 am »

You could try something affecting it's mental attributes. There is an attribute called 'Memory'. using syndromes you can affect stuff like this.
https://dwarffortresswiki.org/index.php/Attribute#Soul_attributes
https://dwarffortresswiki.org/index.php/Creature_token#MENT_ATT_RATES

Maybe if you set the creatures memory-capacity to 0, it might forget everything it knows. Worth a try.

https://dwarffortresswiki.org/index.php/Syndrome#CE_MENT_ATT_CHANGE

I will give it a shot! Although, I will say, that I was under the impression that "memories" were purely a way of creatures to remember certain emotional thoughts they have had in the past, and have little to do with whether a creature has "tagged" another creature as having attacked it at somepoint in the past, and therefore permanently being an enemy.
Logged

SuaveChinchillaMan

  • Bay Watcher
    • View Profile
Re: Memory Eraser Mod
« Reply #6 on: Today at 03:57:26 pm »

You could try something affecting it's mental attributes. There is an attribute called 'Memory'. using syndromes you can affect stuff like this.
https://dwarffortresswiki.org/index.php/Attribute#Soul_attributes
https://dwarffortresswiki.org/index.php/Creature_token#MENT_ATT_RATES

Maybe if you set the creatures memory-capacity to 0, it might forget everything it knows. Worth a try.

https://dwarffortresswiki.org/index.php/Syndrome#CE_MENT_ATT_CHANGE

So, modifying their memory value to zero doesn't
t work,  I don't think. I've messed around with it quite a bit.
Yeah, affecting memory doesn't really do anything. So far, I haven't had too much luck, although if you can interupt the current combat actions of all the combatants sometime using dfhack and typing

gui/gm-edit world.activities.all

And editting the conflict levels for all nearby conflicts to -1 or 0 will sometimes work.

Doubtful that will work—I had a hermit scholar whose attributes I didn't control. I believe her memory went to zero (or at least near zero) after a few centuries but I could still see she was having thoughts and all that. Worth a try regardless.
Besides, how will you make them forget poetic forms, relationships, scholarly knowledge, etc?
« Last Edit: Today at 07:02:25 pm by SuaveChinchillaMan »
Logged

SuaveChinchillaMan

  • Bay Watcher
    • View Profile
Re: Memory Eraser Mod
« Reply #7 on: Today at 07:04:04 pm »

So, messing around with how much memory someone has doesn't really help much. I've tried quite a bit, and it doesn't seem to keep them from continueing to attack someone, or to forget they were attacked later.
Logged