Kenshi
Layken's Slave-murder fix
29 Comments
Nox 28 Feb @ 7:08pm 
Is there no way to do cohesive code modding in Kenshi?

I feel like the root fix would be to change the slaver loot script to avoid death items.
Three-legged Wolf  [author] 22 May, 2023 @ 4:26am 
@weißes Licht unfortunately no. The Ai Script for enslavement loots both armor and items from inventory. To make this mod possible I had to bypass that script.
weißes Licht 21 May, 2023 @ 7:06pm 
there is no way that make slaver take the armors, without take the inventory??
Three-legged Wolf  [author] 16 Jun, 2022 @ 2:42pm 
@z.drone indeed. You play with Genesis I take it? In vanilla kenshi, npc's tend to run around with far less food as I remember it. But yeah, it does feel stupid at times. If you do find out another way of dealing with the problem, please do let me/us know :p.
SlothOfDoom 15 Jun, 2022 @ 8:04pm 
@Three-legged Wolf It just doesn't look or feel like slavery if they leave armors on and inventories full of med kits and/or food items that are for good reason meant to leave characters in a hunger state, slow, and vulnerable.
Three-legged Wolf  [author] 15 Jun, 2022 @ 3:17pm 
@z.drone I don't fully understand why you are looking for an alternate solution to the problem, since this very mod allready fixes it. Are you somehow bothered by the fact slavers don't loot inventories completely, for some reason? Just curious.
Three-legged Wolf  [author] 15 Jun, 2022 @ 3:15pm 
@z.drone well aside from this very mod? not that I know of. This "enslavement-causes-slaves-to-die" problem has plagued death-item mods since the very beginning, and as far as I'm aware, I'm the only one who found a viable solution. The other solution would be to closely monitor and cherry-pick which NPC's get the death-item (which is kind of annoying and a very long process). But no, you can not make your solution work. There is no possible scenario that I can think of where u'd be able to fit a death-item into an equipment slot. Modders basically applied the "kill on loot" from looting downed animals, to humanoid NPC's. As such the death item can not be equipped. In theory, you could make the death-item into an armor-piece if the FCS allows it (don't think it will), but even then, it'd be a piece of armor in an NPC's inventory that would get looted by slavers anyway.
SlothOfDoom 15 Jun, 2022 @ 2:14pm 
@Three-legged Wolf Ahh yeah. I didn't realize it had to be armor item. Is there a way to resolve the conflict in the belt slot to allow death items? Cuz that would solve the problem of slavers killing all the prisoners.
Three-legged Wolf  [author] 9 Jun, 2022 @ 6:10am 
@z.drone the reason it crashes, if I had to make an educated guess, is because only equipment-type items are allowed in belt slot. Only armor can be placed in belt-slot, if the execute-item is armor, it can't be a death-item, and if it is to be a death-item, it can't be armor. Your solution can not work because both types are mutually exclusive. I would guess that your game crashes at the exact moment it tries to resolve this paradox by "equipping a non-equipment item" upon new NPC spawning. I hope I made sense ^^. But in short; Death-items must be an item inside inventory.
SlothOfDoom 9 Jun, 2022 @ 5:04am 
@Three-legged Wolf I tried fixing exactly what this mod is meant to. The item I'm talking about is the "execute" item added by "Execute Enemy" listed in your very own DISCLAIMER. You can change it to the belt slot in the fcs. I figured that would work since slavers don't loot items from that slot. I got it to work but the game crashes after a few minutes whenever I make the change. Idk why.
Three-legged Wolf  [author] 8 Jun, 2022 @ 2:31am 
@z.drone ... you tried fixing what? By making what a belt item? Sorry I have no idea what you are talking about. This mod doesn't add any items to kenshi on it's own. This mod is nothing but a single AI edit. If you explain what you meant, I might be able to help.
SlothOfDoom 7 Jun, 2022 @ 10:01pm 
I tried fixing it myself by making it a belt item but for some reason it crashes the game when you do that.
Three-legged Wolf  [author] 29 Dec, 2021 @ 3:48pm 
@Skyarc Thanks :) If you were to open it up with the modkit, you'd see it's actually a single edit. It was simply a matter of getting the right idea at the right time ^^.
白樱满修殿 29 Dec, 2021 @ 11:58am 
nice mod
Three-legged Wolf  [author] 15 Jun, 2021 @ 9:43pm 
@NortheastBlackwood no worries :) damage is a funny thing in kenshi-code-magic. The only non-physics damage I can think of (ea. not resulting from a blow) is some sort of damage-over-time effect. It's used by vanilla kenshi multiple times: acid swimming/rain, being eaten alive, and peeler-machine... asfaik they're all kind of the same thing, and maybe it could be manipulated to do 200dmg/sec instead of 1dmg/sec, but even if that were possible, I can't begin to fathom how you would apply it upon knock-out-attack... For all it's malleable code and mod-ability, some parts are very tightly hard-coded. Maybe some code-guru could find a way, but not lil' old me ;)
NortheastBlackwood 15 Jun, 2021 @ 2:09pm 
@T-L W yes, exactly like knockouts. Except instead, the stealth + assassinate skill applies to lowering health to 0, applying massive damage, something like that. I don't code (I've learned by now that I will not be good at it), but I'd have thought the existing language for instantaneous unconscious could be manipulated for health reduction instead. From what you're saying and the fact that it's not appeared for years, I'm guessing there's a solid technical reason for it; It's unlikely I'm the only one who's thought of taking that approach.

Thank you for taking the time to respond and I'm sorry I didn't - I only just saw the teeny message icon today.
Three-legged Wolf  [author] 9 Jun, 2021 @ 7:31pm 
@NortheastBlackwood You mean, like a "execute upon action" kinda thing, similar to how knockouts work? but rather killing the npc instead? To be honnest I've never heard of such a thing being attempted. Even something as simple as executing NPC's without looting a kill item... The reason the "loot-to-kill" system works isn't thanks to modder's ingenuity, it's hard baked into the game engine, namely looting raw meat/leather from an animal, kills it on the spot. So modders applied that to humanoids. So... if what you ask is possible, it would be well beyond my capabilities to make it happen :) I'd hazard to gues, it could be attempted by creating some way of dealing massive damage to the head or torso... but even that seems unlikely to be achieved.
NortheastBlackwood 9 Jun, 2021 @ 1:04pm 
Hi Wolf. Thank you for keeping up work to try to fill this hole in the game... Since you seem on top of things, I just want to ask if you've seen a mod which accomplishes this via a menu option, a la LOOT, STEALTH KO, etc....
Thanks again.
Kafkatrap 29 May, 2021 @ 5:34pm 
Cool, thanks!
Three-legged Wolf  [author] 29 May, 2021 @ 3:08pm 
@Kafkatrap asfaik the UBER cannibalism mod is just another "death-item mod", simply makes the kill-item to be raw meat, so I'm 99% sure this will work with that mod. And it'll prevent slavers from looting the meat off captured slaves, preventing them from being killed in the process.
Three-legged Wolf  [author] 20 Apr, 2021 @ 7:53am 
@Happy glad it's working out

@Asneakyfatcat the way I made this work is by short-circuiting the way the in-game script handles slave captures, I actually made the enemy AI go from step 1 to step 4, which makes the AI skip the looting part, as far as I can tell there is no way of differentiating armor and inventory. I tried to make it work by using the guard imprisonnement Ai scrip but then the captured NPC's wouldn't become slaves.

@Sunalore sorry for the late reply, this mod isn't a "execute" mod, you have to download any one of them here on the steam workshop. My mod will work with any one of those mods, but on it's own, it won't actually fix anything.
Sunalore & 知子 7 Apr, 2021 @ 1:57pm 
So, i just subscribe and put this mod below original mod? Or just use this version?
Asneakyfatcat 5 Apr, 2021 @ 7:53pm 
Why can't they also loot armor? As long as the inventory isn't looted it should work right?
Dante 26 Feb, 2021 @ 7:42pm 
This works perfect thx no dead slaves anymore :lunar2019grinningpig:
Three-legged Wolf  [author] 28 Dec, 2020 @ 3:00pm 
You're welcome :)
Helmotz 26 Dec, 2020 @ 7:29am 
I see, thanks for the reply
Three-legged Wolf  [author] 25 Dec, 2020 @ 7:43pm 
sorry for late reply, urgent matters required my attention elsewhere... aka. Cyberpunk 2077 came out :). Regardless, I don't think what you suggest is possible. The "kill-item" added by the various mods use a hardcoded function from the game. Basically when you loot skins/teeth/meat from an animal... it dies (thank god). The mods attribute that same mechanic to human NPC's. The belt slot is an equipment slot designed to hold a piece of equipment, and as such it can't be a kill item (as far as I'm aware)
Helmotz 13 Dec, 2020 @ 3:22pm 
Would it be possible to put the death item in the belt slot, then make the slavers not take the belt slots items ?
I'd be cleaner since it would have it's nice little box for most npcs and since it's a 1 tile item you could still equip lanterns on your characters.
I don't know if it's possible though, If it were I guess someone would have made it already :/