Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Something odd happening with the impregnation function - on clicking next day button:

SCRIPT ERROR: impregnation: Invalid get index 'id' (on base: 'Nil').
          At: res://files/globals.gd:1132

Hmm, I think I know what that is from, I had looked it up when someone posted the same error in another thread. Theirs was at 1131, but I imagine that just means you have an extra line of code somewhere before that in your version of globals.gd. The error in question is most likely a result of the impregnation function not being passed a "father" person, like would happen during most of the sex jobs, or randomly to someone being a housepet or sleeping in the kennel. The random events that involve sex with a random "male" character that isn't you or a slave will also pass no father to that function.

Original impregnation would create a random generic person to be the father in those cases but the edits to how breeding slaves works broke that functionality. I have made a bunch of changes to that function and the ones that use the outputs from it myself, but haven't gotten around to testing them yet, if they work when I do test them I will post them.

Yeah, looks like it's the slave I have on escort duty that's causing that one

So I had to basically rewrite the entire breeding code... again, but I have managed to get my drow slave to breed with a kennel hound while sleeping in the kennel an produce a healthy baby halkin wolf/drow. It will take a little while for me to isolate all the changes to make that happen.

(1 edit)

Hmm not quite as bad as I thought... 

Only minor changes to constructor.gd, basically I moved the <type>_race_arrays out of the set genealogy function so that I could look at them in globals, rather than rebuilding the arrays myself. (edit: I am also using the arrays in multiple functions within constructor itself, but that is for an entirely different unfinished thing)

I added entries to races.gd for each of the animal types, a little bit of work to prevent characters generating with an animal race but not that hard, most character generation is either already filtered or used globals.allracesarray when generating characters, so I just had to prevent the animal races from being populated into that array.

For globals.gd I did the aforementioned filtering to keep animal races out of allracesarray
had to make major changes to the impregnation, race_breed_compatible, and fertilize_egg functions, 
as well as adding another array for race groups to be used with the getracebygroup function, including adding addition group filters to said function 

And lastly in every file that calls globals.impregnation without providing a father person, I had to add a new input to target either a specific race or group of races to generate a father from.

Aric if I can get my internet to cooperate I will try to send the changes on discord, if you need them. It would be quite the wall of text to post it here.