Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Mostly I've been finding solutions through trial and error, and interestingly changing the gender in the save file data sticks and the character doesn't revert back. Also I just ended up removing the actions from that trait group, which was in the newsexsystem file so thank you! 

Unrelated question, but is there an easy way to make certain sex actions add a specific item to inventory?  I've been poking around a lot of files and trying to look things up, but I'm pretty much an amateur and can't seem to figure how to not break the game every time I try to add a new line. Most of what I've come up with is just editing/overwriting existing code to tweak or adjust things, but I don't know how or where I would place this.  

Character sex/gender is only updated when the character undergoes a change which would be likely to change it. These changes are pretty much all driven by the player, though using too many potions too quickly can cause random mutations.

If the game crashes anytime you add a new line, even a blank one, then your editor is adding the wrong set of newline characters (the invisible characters that cause editors to put text on a new line) whenever you press the Enter/Return key.

If you don't have programming experience with Python, then I recommend taking a free online interactive tutorial for Python. GDScript is designed as a beginner friendly version of Python with some LUA, but since Python is a primary programming language it gets some better tutorials. A few hours with a tutorial will make things a lot clearer.

For simple debugging I recommend the Debug mod: https://itch.io/t/1137280/debugmod-v10d
I tend to do most of my programming in Sublime Text 3 with Python syntax highlighting and use the Debug mod to find out what breaks.
Otherwise get the Godot Editor version 3.3. It is needed if you want to work with the GUI, though it won't be much help for making mods.

Hello again! I am back with what I hope is my final question lol! Using Godot 3 made all the difference and I've been doing a lot of Googling and experimenting and had a lot of success, but I can't seem to figure out a simple way to make the text under func initiate() play in a specific order rather than randomly each time the action is clicked. Is this a situation where there's not really an easy way to do this without changing all the code and the way it functions (like without having to change temparray to something like const)? 

(1 edit)

Quick tip, it helps if you reference a file name when referring to code so the other person doesn't need to hunt for it.

In the sex action files, the game uses 2 separate types of randomization; one is relatively easy to replace with a specific order, one is somewhat complicated to order. Changing temparray to const would have no meaningful impact on the behavior of the array, as it only prevents you from changing the type of the variable to something that is not an array; it does not prevent changes to the contents of the array. 


text += temparray[randi()%temparray.size()]

This selects a random line of text within temparray and appends it to the text return variable. To change it to a specific order, the simplest approach is to replace the random integer generator "randi()" with a persistent variable storing an incrementing integer. If we keep most of the function unchanged we get:

var count1 = 0
func initiate():
    ...
    text += temparray[count1%temparray.size()]
    count1 += 1
    ...

However,  many sex actions use multiple layers of appended text to the text return variable and reusing count1 for every layer can restrict the number of combinations of text generated if the layers have the same number of lines of text in temparray. To fix that specific case we can use conditional increments.

var count1 = 0
var count2
func initiate():
    ...
    text += temparray[count1%temparray.size()] 
    count1 += 1
    temparray.clear()
    ...
    text += temparray[count2%temparray.size()]
    if count1%temparray.size() == 0:
        count2 += 1
    ...

The second type of randomization uses specific characters to mark the beginning, separations, and end of the set of randomly selected text:

{^gently:tenderly:carefully}

The first two characters "{^" mark the beginning of the randomized text, the individual texts are separated with colons, and the end is marked with another brace. This sounds straightforward and you might be tempted convert split those three words into separate lines to be handled by a layer of temparray, but consider this line from 100caress.gd:

temparray += ["[name1] {^gently:tenderly:carefully} {^stroke:fondle:cuddle:massage}[s/1] and {^caress[es/1]:rub[s/1]} [names2] [body2]"]

This single line provides 24 unique combinations of randomized text.

The code for this process is found in func splitrand(text) of sexdescriptions.gd. If we made the incorrect assumption that there are a minimal number of cases where these random sets of text are identical, then it's possible to use dictionary to implement an incrementing integer strategy similar to above.

var dictCounting = {}
func splitrand(text):
    var pos = text.find("{^")
    while pos >= 0:
        var targetText = text.substr(pos, text.find("}", pos)+1 - pos)
        var splitText = targetText.substr(2, targetText.length()-3).split(":")
        text = text.replace(targetText, splitText[ dictCounting.get(targetText,0) % splitText.size() ])
        dictCounting[targetText] = dictCounting.get(targetText,0) + 1
        pos = text.find("{^", pos)
    return text

It's been a while since I've coded, but I'm mostly certain this would work as long as I didn't make any typos. While this is an inaccurate solution as the assumption was incorrect, it's by far the least effort solution.

If you want any more control over the ordering of text than this, then you will probably have to create an array of all possible combinations of text for each sex action and then use the incrementing integer technique to walk through them one at a time.


Edit: Please note that itch.io converted all tabs to spaces, which will wreck havoc in Godot if you try to copy and paste my code.

Thank you so much for taking the time to type all that out! And apologies for not referencing the file name, I was trying to ask in a way that would hopefully be less work to answer but ended up doing the opposite and oversimplifying.

I was just not understanding what I needed to do with randi() and using count1 worked perfectly for what I needed. Thank you!