Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

The Debug mod will generally help if you  are editing files because it will provide error messages rather than crashing. It's best to edit script files with a decent text editor (like Notepad++ or Sublime Text 3) as Windows Notepad will cause errors if you add any new lines(it uses old windows newlines instead of universal or linux standards). The scripts are written in gdscript which is similar to Python so if you need to learn the programming basics then I recommend an online interactive Python tutorial. Gdscript uses whitespace formatting so using spaces instead of tabs or having the wrong number can easily crash a script.

I realize that your were just posting a quick example, but note that something like "if isencountersamesex = true" will cause errors because "=" means "assignment" and "==" means "equals".

The sex system 'AI' is already designed such that slaves have preferences for which sex they will choose as a partner. Slaves with "Homosexual" prefer the same sex, so males prefer males and female/futa prefer female/futa. Slaves with "Bisexual" have no preference in the sex of their partner. Slaves without either of those two traits are considered to be heterosexual and thus prefer male to female or the reverse. Changing any of those same sex conditions from "true" to "false" would result in a reversal of preferences, thus heterosexual slaves would act homosexual or homosexual would act heterosexual.

If you wanted to change how your slaves select by sex, then the line after the condition is the one you want to change.

if isencountersamesex([chosen], [i], chosen) && chosen.person.traits.has('Bisexual') == false && chosen.person.traits.has('Homosexual') == false:
    value = max(value/5,1)

For instance, changing the 5 to a 20 would basically cause heterosexual slaves to be 4 times less likely to select a same sex partner, or changing "max(value/5,1)" to 0.01 would mean that regardless of their past interactions a heterosexual slave is unlikely to pick a same sex partner unless there are no other options.

Otherwise you could add a condition to universally boost the likelihood that slaves choose the player as their partner, like this:

if i.person == globals.player:
    value *= 10

Note that code posted on this website automatically has the leading tabs converted to spaces so it will cause errors if you copy it into your script without changing them back.