Skip to main content

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

So custom characters. It sounds like you've coded a deluxe version. I can understand why you skipped the existing image coding and instead created your own method to display images (based on lust). I guess if I was going to do custom characters I'd have one place where the custom slaves had a small chance of being found (captives, bandits, or slave guild) and then load in a custom slave from file when needed, using their custom stats and images. Players could then share files containing their custom characters.

If someone wanted to see your version you could offer it with file replacement (copying your files over the active Strive files) rather than modding.

My version is still pretty stiff. I add custom characters to existing list of premade characters (Cali, Maple etc.) in gallery.gd. For their images they all have their own assigned folder, where filenames are identical. This can of course be done however one wants, I just like to have my stuff in folders. I also tweaked it a little bit, pictures used in mansion main screen are now triggered by loyalty, while pictures in dating screen are triggered by lust. This is in mansion.gd under func updateSlaveListNode:

    var customportrait = ''
    var customfull = ''
    if person.unique in [Your eligible characters listed in here]:
         if person.loyal >= 70:
             customportrait = "res://files/images/custom/" + person.unique + "/portrait2.png"
             customfull = "res://files/images/custom/" + person.unique + "/body2.png"
         else:
             customportrait = "res://files/images/custom/" + person.unique + "/portrait1.png"
             customfull = "res://files/images/custom/" + person.unique + "/body1.png"
         person.imageportrait = customportrait
         person.imagefull = customfull

I have to add characters to this list in case they don't all have multiple images. I'm not much of an artist myself, so I have to use whatever I can find. There's similar portion in dating.gd under func doaction:

    var customportrait = ''
    var customfull = ''
    if person.unique in [Your eligible characters listed in here]:
         if person.lust >= 90:
             customportrait = "res://files/images/custom/" + person.unique + "/portrait3d.png"
             customfull = "res://files/images/custom/" + person.unique + "/dating3.png"
         elif person.lust >= 60:
             customportrait = "res://files/images/custom/" + person.unique + "/portrait2d.png"
             customfull = "res://files/images/custom/" + person.unique + "/dating2.png"
         else:
             customportrait = "res://files/images/custom/" + person.unique + "/portrait1d.png"
             customfull = "res://files/images/custom/" + person.unique + "/dating1.png"
         $textfield/slaveportrait.set_texture(globals.loadimage(customportrait))
         $fullbody.set_texture(globals.loadimage(customfull))
    updatelist()

So, there's nothing really fancy in here. But at least it's quite tidy, bringing the characters in game is a mess. I added some new stuff in globals.gd:

var custompool = [Your custom characters listed in here]
var customchar 
var customtaken = [] 
var guildpool = []
func customslave(origins = 'slave'):
     customchar = globals.randomfromarray(custompool)
     for guild in guildslaves:
         var slaves = guildslaves[guild]
         for i in slaves:
             guildpool.append(i.unique)
     for i in globals.slaves:
         customtaken.append(i.unique)
     if customchar in customtaken || customchar in guildpool:
         guildpool.clear()
         return null
     else:
         return gallery.create(customchar)

When a new slave is brought in game, func newslave is used. In those situations I've added a rand_range check to see whether a custom character is introduced instead. I didn't put the random check in here because I wanted the random chance to be different in every situation. This code picks a character from list and then checks if said character is already in game, either in player's possession or in a slaver guild. If character is not yet in game, it's brought in, otherwise null is returned and original line is used. However, if custom character is already in game, the process is not repeated because I wanted the chances for new custom characters to be lower if there already are some in game.

Oh, and in original code, word "portrait" was typoed as "portait" in some parts. Instead of correcting that, some parts of original code were written to work with typo version, while others used the correct version. I couldn't get my code to work until I noticed it. This pissed me off beyond belief, so I went through all the files and fixed it. I highly recommend this to be done before doing anything related to portraits.

Also, keeping custom characters in separate files is a great idea that didn't even cross my mind. In fact, I think I came up with a way to keep custom characters in their own files, under a designated folder. It would make handling them much easier and they could even be easily shared one by one with other players. You'd still need to manually add the .unique values to those lists, but some proper coder could surely find a solution for that too. I need to take a look at this when I have some spare time.

Deleted 3 years ago
(1 edit)

I'm still working through this but I'll point out something it took me a long time (probably over a year) of modding to realise as it's different from more rigid languages. You can add extra data elements to dictionaries, these elements will persist through load and save, and existing Strive code is unaffected by these elements. This means you can do something like

var person = CreateCustomCharacter(name)
If !globals.state.has('customcreations') : globals.state.customcreations = []
globals.state.customcreations.append[person.unique]

As it stands, I think your custom slaves can be killed and still return later. I can see why you just did a check on the current lists though as tracking the status of these slaves throughout the code will be troublesome.

You're right, if a custom slave dies they could be brought back. This is because I've switched permadeath off when I've first started playing and then completely forgotten the whole setting even exists, thus being totally unaware they could even die... Thanks for pointing that out, it needs to be fixed.

(1 edit)

I think you will need this line when importing a bodyguard custom slave. Assassins have their bonus hard coded in combat.gd.

 if person.effects.has('bodyguardeffect'): person.add_effect(globals.effectdict.bodyguardeffect, true)

I think I might skip out on the whole problems of slave origins/exits and make the custom images a renaming and reimaging feature. This way will be less fun but the player then self manages reappearance and similar issues. Slave renaming would be a good feature to add anyway as it is missing from the game (nicknames and amnesia potion aside). Custom characters occuring randomly in the game could be added as step two.

Most significant problem with my code is that I've never properly studied this system or even Python, I just started twiddling with the code for my own amusement by tweaking variables and it all started snowballing, resulting in a web of features where everything is more or less tangled together. To make matters worse, I didn't even mark my own lines to separate them from original code. That's why my "creations" aren't exactly shareable, at least easily. But hopefully any of this gave even some useful ideas.

I started much the same way. I'm a lapsed software developer who had started in ancient languages like COBOL with fixed data storage so although I knew C as well I was essentially treating GD script as extended basic.

Thanks for your post. The more I think about this the more I see this as a portrait extension plus a custom slave finder, two good ideas in one.