Skip to main content

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

Strive for Power

Fantasy Slave Management/RPG Erotic Game · By Strive4Power

Learning Deviant trait by editing game files

A topic by RandomFap created Aug 04, 2021 Views: 2,695 Replies: 6
Viewing posts 1 to 3

Hello,
I am aware that the deviant trait cannot be learned in current versions if I understand what I read in this forum.

However in sexuals.gd I can find:

        if action.tags.find("degrading") >= 0 && slave.traits.find("Deviant") < 0 && (rand_range(0,1) >= 0.8 || slave.effects.has('entranced') == true):

            slave.add_trait("Deviant")

            counter += 1

So there might be a way to get the deviant trait by adding the "degrading" tag to some action tags.

Anyone know which file to edit for that?

Thanks in advance!

One problem with that line of reasoning, sexuals.gd is no longer used by the game and as of v1.0d no other file in the game even references that file.

The sex system is currently centered in newsexsystem.gd and the action scripts are found in the ".../files/scripts/actions/" folder. You would need to add the appropriate code and tags.

Thank you, knowing where to look at exactly allowed to find a way to have it naturally, even though it could be implemented way better. I use those mods so maybe not everything here is accurate.

I use those mods:

https://itch.io/t/1167355/bugfix-for-10d-v4a

https://itch.io/t/984434/randomportraits-and-portrait-pack-editor-for-the-10-version

https://itch.io/t/1085124/chastity-belt-mod-v13e-for-strive-v10d (only expanded sex to make it work with leo)

https://itch.io/t/1099697/leos-mod-for-strive-v10

In the  file newsexsystem.gd I take inspiration from issamesexencounter and create a function:

func isbestiality(givers, takers, actor = null):
    if givers.empty() || takers.empty():
        return false
    var giversunique = givers[0].person.unique
    var takersunique = takers[0].person.unique
    if givers.has(actor):
        return takersunique in ['dog','horse']
    elif takers.has(actor):
        return giversunique in ['dog','horse']
    return false
I also add a field bestiality in actionshad variable:

# var actionshad = {addtraits = [], removetraits = [], samesex = 0, samesexorgasms = 0, oppositesex = 0, oppositesexorgasms = 0, punishments = 0, group = 0}
var actionshad = {addtraits = [], removetraits = [], samesex = 0, samesexorgasms = 0, oppositesex = 0, oppositesexorgasms = 0, punishments = 0, group = 0, bestiality = 0}
Then somewhere in the code add two lines after the samesexencounter counter update:

if sceneref.isencountersamesex(lastaction.givers, lastaction.takers, self) == true:
        actionshad.samesexorgasms += 1
    else:
        actionshad.oppositesexorgasms += 1
# Adds bestiality points for potential "Deviant" gain
if sceneref.isbestiality(lastaction.givers, lastaction.takers, self) == true:
        actionshad.bestiality += 1
Also here:

    for i in givers + takers:
        if isencountersamesex(givers,takers,i) == true:
            i.actionshad.samesex += 1
        else:
            i.actionshad.oppositesex += 1
        if isbestiality(givers,takers,i) == true:
            i.actionshad.bestiality += 1
and somewhere else in the code add the trigger to add traits:

        if i.actionshad.group*0.01 > randf():
            i.person.trait_remove("Monogamous")
            i.person.add_trait("Fickle")
        # new code to add Deviant trait
        if i.actionshad.bestiality*0.01 > randf():
            i.person.add_trait("Deviant")
And I loaded a game, started an orgy with dogs/horses to get lots of counters, and managed to unlock the trait in-game.

Obviously, this workaround does not replace an actual implementation with flavor text, in-game consequences and stuff but it should be "safe" (as not modifying the game substantially).

Now the only issue, which I do not know the origin/cause (but was present in my version pre-modification) is that the save files are bloated with "dogs" "horses" of random races for siblings/family relationship even though I never got a baby in that save.

In "relativesdata":

      "1243": {
        "children": [],
        "father": -1,
        "halfsiblings": [],
        "id": "1243",
        "mother": -1,
        "name": "Dog 1 Campbell",
        "race": "Halfkin Wolf",
        "sex": "male",
        "siblings": [],
        "state": "normal"
      },
      "1244": {
        "children": [],
        "father": -1,
        "halfsiblings": [],
        "id": "1244",
        "mother": -1,
        "name": "Dog 2 Leon",
        "race": "Gnome",
        "sex": "male",
        "siblings": [],
        "state": "normal"
      },
      "1245": {
        "children": [],
        "father": -1,
        "halfsiblings": [],
        "id": "1245",
        "mother": -1,
        "name": "Dog 3 Leawis",
        "race": "Centaur",
        "sex": "male",
        "siblings": [],
        "state": "normal"
      },
      "1246": {
        "children": [],
        "father": -1,
        "halfsiblings": [],
        "id": "1246",
        "mother": -1,
        "name": "Horse 1 Ray",
        "race": "Centaur",
        "sex": "male",
        "siblings": [],
        "state": "normal"
      },
      "1247": {
        "children": [],
        "father": -1,
        "halfsiblings": [],
        "id": "1247",
        "mother": -1,
        "name": "Horse 2",
        "race": "Scylla",
        "sex": "male",
        "siblings": [],
        "state": "normal"
      },
      "1248": {
        "children": [],
        "father": -1,
        "halfsiblings": [],
        "id": "1248",
        "mother": -1,
        "name": "Horse 3",
        "race": "Harpy",
        "sex": "male",
        "siblings": [],
        "state": "normal"
      },
and so on. Not sure what's the deal.

The relative's data for those dogs and horses is empty of any relation, so it was not a pregnancy that caused it. Rather in the vanilla game sexdescriptions.gd calls getrelativename(), which has the side effect of creating entries in relativesdata for people who do not have entries already. Cleaning up the hidden data has been a relatively recent goal of mine, so there is still likely lots of such data.

(2 edits)

Wow good luck man... Feels like you'll need it.

EDIT: Thanks to your info I managed to do things. I cannot clean the data except manually (there's also data for non animals that is useless!) but I can aboid creating extra useless data.

I found a workaround by limiting the calls to createrelativesdata, first modifying getrelativename:

func getrelativename(person, person2):
    var result = null
    var data1 
    var data2
    if !globals.state.relativesdata.has(person.id) || !globals.state.relativesdata.has(person2.id):
        return null
    else:
        data1 = globals.state.relativesdata[person.id]
        data2 = globals.state.relativesdata[person2.id]
    #if globals.state.relativesdata.has(person.id):
    #    data1 = globals.state.relativesdata[person.id]
    #else:
    #    createrelativesdata(person)
    #    data1 = globals.state.relativesdata[person.id]
    #if globals.state.relativesdata.has(person2.id):
    #    data2 = globals.state.relativesdata[person2.id]
    #else:
    #    createrelativesdata(person2)
    #    data2 = globals.state.relativesdata[person2.id]
    
    #print(data1, data2)
    for i in ['mother','father']:
        if str(data1[i]) == str(data2.id):
            result = '$parent'
        elif str(data2[i]) == str(data1.id):
            result = '$son'
    for i in [data1, data2]:
        if i.siblings.has(data1.id) || i.siblings.has(data2.id):
            result = '$sibling'
    if result != null:
        result = person2.dictionary(result)
    return result

But createrelativesdata is also called in some places of globals.gd: it makes sense for impregnation. But in some other places, it doesn't.

This function tends to create data for a false return. I just return false without creating data instead.

func checkifrelatives(person, person2):
    var result = false
    var data1 
    var data2
    if !globals.state.relativesdata.has(person.id) || !globals.state.relativesdata.has(person2.id):
        return false
    else:
        data1 = globals.state.relativesdata[person.id]
        data2 = globals.state.relativesdata[person2.id]
    #if globals.state.relativesdata.has(person.id):
    #    data1 = globals.state.relativesdata[person.id]
    #else:
    #    createrelativesdata(person)
    #    data1 = globals.state.relativesdata[person.id]
    #if globals.state.relativesdata.has(person2.id):
    #    data2 = globals.state.relativesdata[person2.id]
    #else:
    #    createrelativesdata(person2)
    #    data2 = globals.state.relativesdata[person2.id]
    for i in ['mother','father']:
        if str(data1[i]) == str(data2.id) || str(data2[i]) == str(data1.id):
            result = true
    for i in [data1, data2]:
        if i.siblings.has(data1.id) || i.siblings.has(data2.id):
            result = true
    
    
    return result

After testing, it seems to work! There is just some issue I noticed: sibilings and step siblings are bugged, and sometimes get errors (comparisons of string names with -1). Unsure if this is prior to modifications or after, but I found some fix to it.

First modify the function connectrelatives, which seems to be the culprit:

func connectrelatives(person1, person2, way):
    if person1 == null || person2 == null || person1.id == person2.id:
        return
    if !globals.state.relativesdata.has(person1.id):
        createrelativesdata(person1)
    if !globals.state.relativesdata.has(person2.id):
        createrelativesdata(person2)
    if way in ['mother','father']:
        var entry = globals.state.relativesdata[person1.id]
        for child in entry.children:
            connectrelatives(person2, globals.state.relativesdata[child], 'sibling')
        entry.children.append(person2.id)
        entry = globals.state.relativesdata[person2.id]
        entry[way] = person1.id
        if typeof(person1) != TYPE_DICTIONARY && typeof(person2) != TYPE_DICTIONARY:
            addrelations(person1, person2, 200)
    elif way == 'sibling':
        var entry = globals.state.relativesdata[person1.id]
        var entry2 = globals.state.relativesdata[person2.id]
        # if one parent is -1 and the other a string_id, it will throw an error! Need to ensure strings
        var good_type_mom = (typeof(entry.mother) == typeof(entry2.mother)) && (typeof(entry.mother) == typeof(person1.id))
        var good_type_dad = (typeof(entry.father) == typeof(entry2.father)) && (typeof(entry.father) == typeof(person1.id))
        var good_types = good_type_mom && good_type_dad
        if good_types and ((entry.mother == entry2.mother) && (entry.father == entry2.father)):
            if !entry.siblings.has(entry2.id):
                entry.siblings.append(entry2.id)
            if !entry2.siblings.has(entry.id):
                entry2.siblings.append(entry.id)
        elif (good_type_mom && (entry.mother == entry2.mother)) || (good_type_dad && (entry.father == entry2.father)):
            if !entry.halfsiblings.has(entry2.id):
                entry.halfsiblings.append(entry2.id)
            if !entry2.halfsiblings.has(entry.id):
                entry2.halfsiblings.append(entry.id)

And then the problem in its calls, when using impregnation. Change the end of the function impregnation (still in globals.gd):

    #calls to connectrelatives is bugged for siblings
    #problem seems to be at the identification of mother AND father simultaneously
    #as connectrelatives do not assign both parents simultaneously
    createrelativesdata(baby)
    globals.state.relativesdata[baby.id]['mother'] = mother.id
    if realfather != -1:
        globals.state.relativesdata[baby.id]['father'] = father.id
        connectrelatives(father, baby, 'father')
    connectrelatives(mother, baby, 'mother')
    mother.preg.baby = baby.id
    mother.preg.duration = 1
    
    mother.metrics.preg += 1
    globals.state.babylist.append(baby)

And this seemed to resolve my issues. Hope it helps other people.

can you link what text editor you use im having a hell of a time trying to edit the saves with notepad ++

If you are talking about save files, this one is good enough https://jsoneditoronline.org/