Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Strive for Power

Fantasy Slave Management/RPG Erotic Game · By Strive4Power

Sexy-time text and end-of-day reports

A topic by Throbby created Nov 03, 2021 Views: 2,277 Replies: 4
Viewing posts 1 to 4

Am I weird for thinking that there should be a way to save your orgy sessions as a .txt file, or get copies of your daily reports?  Every once in a while, Strive actually churns out a scene that's pretty good, and it would be nice to save it for... reference?  And I just want to be able to look at what's going on day-to-day without losing access to my reports every time I load a game.

Just wondering if anybody else had similar thoughts.  Or an interest in making something that could save that stuff.

Cheers!

(1 edit)

I can't say that I've had any particular interest in the sex interaction text. Though your not the first to mention saving and restoring the daily reports, it was never added because it seemed like it would bloat the save file and could be tedious to implement. The text is rather easy to find and access, but there are no convenience functions for saving text to a file. The script files are plain text and can be edited with any decent text editor, though without the appropriate skills in coding that won't help much. Also, the Debug mod is extremely helpful if you edit scripts since it provides descriptive errors instead of simple crashes.

The file operations can be found in globals.gd. The sex text is found in "get_node("Panel/sceneeffects").text" of newsexsystem.gd, and the last function of the interaction is "func endencounter():". The daily reports are found in "text0.text", "text1.text", and "text2.text" of Mansion.gd, though only in the function "func _on_end_pressed():"

The simplest approach would add a function like this to globals.gd (but note that this site converts the leading tabs to spaces so you would have to convert them back):

func saveText(path, text):
    var file = File.new()
    var retCode = file.open(path, File.WRITE)
    if retCode == OK:
        file.store_line(text)
        file.close()
    else:
        printErrorCode("Writing file " + path, retCode)

Then whenever you want to save the text you add a line like one of these :

    globals.saveText("user://sexText.txt", get_node("Panel/sceneeffects").text)
    globals.saveText("user://dailyReport0.txt", text0.text)

The end of a function is a safe place to add it and it will need a tab. That will put the text into a text file in user data, near the save files. Each time it is saved it will replace the contents of that file.

That seems... not overly complex!

So, lemme see if I have this straight.  The globals.gd file is what sets the game parameters, the save files have the data for all the slaves and items and player.  But where are temporary things; my clumsy perusal of the save file doesn't seem to turn up a value for, say, the number of interactions left in the current day.  There's another thread on here that talks about changing the number of turns in an interaction, or increasing the base number of meet or sex interactions, but I'd like to know where all the moving parts are.

F'rinstance.  I see, in the save file, that there are still entries for slaves who have been released or sold; they don't have any of the detailed data that the current slaves do, though; all the stuff that shows up under "statistics" seems to be gone.  So say two people, A and B, had a sex interaction, and then B was sold.  The data for A in the save file will still include B in the "orgasmpartners" list, say; if I'm editing and delete that bit, would the game notice?  Would it notice even if B were still present, and then the data for A and B no longer matched?  Are those interactions saved anywhere else?

And if I find where the remaining interactions are counted, and decide to add a dozen extra meet actions, but my daily allotment should be three, will that break the game?

Now I'm all curious about everything!

Also, to show the profound depths of my ignorance, what do you mean when you say, "...safe place to add it and it will need a tab?"  'Cause I'm totally willing to try and muck about with globals.gd, but I want some vague idea of what I'm about to do...  :P

(1 edit)

globals.gd is a strange file that is used for far too many things simply because it can be accessed from any other file. Its primary usage is as a data hub that provides links to most of the other files where items and people are handled. Its secondary usage is a easy to access storage for data and functions that should actually be located somewhere else. It does handle loading and saving various files. I'm not sure if it can be said to set the game parameters, because that phrase is rather ambiguous and I don't feel that it matches the complexity of Strive's code.

The save file uses the JSON format and using an editor capable of handling that format will make things much more clear. I tend to use https://jsoneditoronline.org/. The save file has an object called "state" from class "progress", which stores most of the data. That includes "nonsexactions" and "sexactions", which are the remaining number of interactions available to to the player.  The game does not perform any kind of checks on these values so feel free to abuse them if you want; however, note that changing the type of these values to something besides a simple numeric type will break the game. The number of turns in an interaction are not saved but stored in variables.gd, and those values are best edited using the Constants mod, which comes with the game and ensures that the types of the values are not changed.

The game intentionally keeps some data about slaves even after they are gone, and unintentionally keeps other data (sometimes for slaves you have never had). There have been some improvements to that in the Bugfix mod, but refining that has only happened recently. I try not to spend too much time cleaning up things that aren't broken. Sex partners track ids simply to prevent double counting people, and the rest of the time the game just uses the length of the list. There's no reason for the sex partner lists to care about the current state of any of the slaves as it is simply a record of the past. The places where the current state of the slaves matters is the "relations" and "relativesdata", though both systems are designed to more or less deal with spontaneous disappearances.

Strive uses the gdscript language as part of the Godot Engine. This language uses whitespace(generally just tabs and new lines, but spaces are considered by the engine) to format most of the code so it expects code to be tabbed to specific levels in the appropriate places. Generally the code should only increase the level of tabbing after lines that end with a colon(":"). This increase in tabbing marks that code as being inside the section of code started by the line with the colon, and a line that reduces the level of tabbing marks the end of a section. Note, most code must be inside the appropriate section, so it cannot have zero tabs. The end of a function is the last line within the tabbing section created by the function's colon. Example("#" marks any text after it on that line to be a comment, or notes rather than code):

func example1(arg1):
    var roses = "red"
    var violets = "blue" # last line of function
    # safe place to add
func example2():
    # safe place to add outside of condition
    if "red" != "blue":
        print(null)
        # safe place to add inside of condition above
    # not a safe place to add, unless this line starts a new section for next line
        print("done") # last line of function
    # safe place to add

If you wish to learn more about coding in order to mess about on your own without breaking stuff as often, then I recommend taking an online tutorial for the basics of Python, which is very similar to gdscript. https://www.w3schools.com/python/python_syntax.asp

Thank you!  You are a font of knowledge, and I appreciate the help!