Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: My kenshi mod is broken, can anyone help? [RESOLVED]  (Read 2739 times)

squamous

  • Bay Watcher
    • View Profile
My kenshi mod is broken, can anyone help? [RESOLVED]
« on: April 29, 2021, 09:57:15 pm »

 https://dffd.bay12games.com/file.php?id=14292

So I have a mod that turns DF into kenshi, had it for awhile. It's also been consistently plagued by a CTD which was inconsistent and I could never really pinpoint. However, I have recently through pure coincidence managed to isolate what I think is the source of the crash.

To test it for yourself, simply go to the arena and spawn scorchlander, greenlander, shek, or cannibal NPCs. continue to spawn them, maybe a dozen times or more. Eventually, it WILL result in a CTD. I honestly have no clue why this is happening, I have never experienced a bug like this before and I am at a total loss. I am also sure its an entirely inconsequential goof on my part that'll make me look like an idiot when it's pointed out to me but I really just would like any pointers towards a solution.
« Last Edit: June 08, 2021, 01:26:59 am by squamous »
Logged
I make huge and comprehensive overhaul mods, consider supporting me on Patreon so I can do this full-time:
https://www.patreon.com/themodsmith
Have questions? Need to report bugs? Post them in the discord:  https://discord.gg/dGzGr5svS2

Atkana

  • Bay Watcher
  • [CURIOUSBEAST]
    • View Profile
Re: My kenshi mod is broken, can anyone help?
« Reply #1 on: May 15, 2021, 03:38:32 am »

I've been slowly mulling this over / investigating and I think I might have a guess. The two noteworthy things to mention are that:
  • They work fine when alongside the vanilla raws
  • Their ability to learn is what's causing the problems (other can learn creatures like bogeymen also experience the crashes). Remove that, and they work just fine.
Following on from that, the only randomised things that intelligent creatures get over unintelligent creatures are values, needs, and preferences. I wonder if there are some hardcoded assumptions about certain material forms/types always being present, with the crash being caused when the game attempts to assign a preference of that sort that the mod is lacking. It would explain why adding in vanilla raws helps (they add the missing elements), why it only crashes with can learn creatures (they're the only ones that get preferences), and only randomly (only a % chance of getting particular sorts of preferences).
I don't really have the inclination to sift through the entire mod to check that everything's in order, so I can't really test to see if this is definitely the cause or not. You're likely to be much more knowledgeable about what's in the mod, anyways :P. You can see a list of all the sorts of preferences on the wiki if you want to investigate.

squamous

  • Bay Watcher
    • View Profile
Re: My kenshi mod is broken, can anyone help?
« Reply #2 on: May 22, 2021, 10:15:05 pm »

I've been slowly mulling this over / investigating and I think I might have a guess. The two noteworthy things to mention are that:
  • They work fine when alongside the vanilla raws
  • Their ability to learn is what's causing the problems (other can learn creatures like bogeymen also experience the crashes). Remove that, and they work just fine.
Following on from that, the only randomised things that intelligent creatures get over unintelligent creatures are values, needs, and preferences. I wonder if there are some hardcoded assumptions about certain material forms/types always being present, with the crash being caused when the game attempts to assign a preference of that sort that the mod is lacking. It would explain why adding in vanilla raws helps (they add the missing elements), why it only crashes with can learn creatures (they're the only ones that get preferences), and only randomly (only a % chance of getting particular sorts of preferences).
I don't really have the inclination to sift through the entire mod to check that everything's in order, so I can't really test to see if this is definitely the cause or not. You're likely to be much more knowledgeable about what's in the mod, anyways :P. You can see a list of all the sorts of preferences on the wiki if you want to investigate.

That's insanely weird, but I'll start checking it out thanks.
Logged
I make huge and comprehensive overhaul mods, consider supporting me on Patreon so I can do this full-time:
https://www.patreon.com/themodsmith
Have questions? Need to report bugs? Post them in the discord:  https://discord.gg/dGzGr5svS2

squamous

  • Bay Watcher
    • View Profile
Re: My kenshi mod is broken, can anyone help?
« Reply #3 on: June 08, 2021, 01:26:39 am »

I have solved this issue.

Essentially, a mod needs to have all the different types of items which a CAN_LEARN race can prefer. In my case, the mod didn't have any shields at all, so the game crashed when spawning someone who was supposed to like shields, this is hardcoded apparently. So, now shields exist in the mod, but won't be used. This will prevent the crashes I hope.
Logged
I make huge and comprehensive overhaul mods, consider supporting me on Patreon so I can do this full-time:
https://www.patreon.com/themodsmith
Have questions? Need to report bugs? Post them in the discord:  https://discord.gg/dGzGr5svS2

Asin

  • Bay Watcher
  • A short and sturdy creature fond of modding.
    • View Profile
Re: My kenshi mod is broken, can anyone help? [RESOLVED]
« Reply #4 on: June 19, 2021, 07:45:59 pm »

so new tip for modders: make things that might not even be in the setting, just because DF might flip out if it's missing something?
« Last Edit: June 19, 2021, 08:57:13 pm by Asin »
Logged

squamous

  • Bay Watcher
    • View Profile
Re: My kenshi mod is broken, can anyone help? [RESOLVED]
« Reply #5 on: July 01, 2021, 05:55:40 pm »

so new tip for modders: make things that might not even be in the setting, just because DF might flip out if it's missing something?

So it would seem.
Logged
I make huge and comprehensive overhaul mods, consider supporting me on Patreon so I can do this full-time:
https://www.patreon.com/themodsmith
Have questions? Need to report bugs? Post them in the discord:  https://discord.gg/dGzGr5svS2