Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Strive for Power

Fantasy Slave Management/RPG Erotic Game · By Strive4Power

Improved Random Portraits v1.0

A topic by Kyler2 created Aug 20, 2018 Views: 162,926 Replies: 170
Viewing posts 34 to 47 of 47 · Previous page · First page
Deleted 2 years ago
(1 edit)

    # Filter on Gender
    filteringPortraits = []
    for p in validPortraits:
        if p.genders.has(person.sex):
            filteringPortraits.append(p) #Add portrait that has required sex
    if portraitSettings.debug: print('Filtered on gender %s, resulted in %d portraits.' % [person.sex, filteringPortraits.size()])
    if !filteringPortraits.empty():
        if (filteringPortraits.size() < portraitSettings.minMatch):
            return
        validPortraits.clear()
        validPortraits = filteringPortraits

It's quite a small change in randomportraits.gd.  (If you get some indent compile errors, as I did, use spaces instead of indents).

There is no option in my mod to only check for race, that's maybe one of the game's options for its own simplistic random portrait code, which this mod completely replaces.

I think you could achieve this by changing minMatch to -1 ?  This would affect more than just the gender filtering though.  Right now, for race or gender, if the matches are below minMatch, it aborts.  If it's not, but the result is empty, then it ignores that filter.  so if these conditions are met:

  • minMatch setting set to 0
  • No matching portraits for gender

Then instead of aborting like it would with a minMatch, it will discard the filtering on gender.  It'll filter on it, see that the result is empty, and continue with the prior list.  It'll however apply this to Races too, so if it filters on race and gets 0, it'll revert to using all portraits, then trying to filter on gender,  if that's also 0, it'll continue with all portraits (or a set of portraits for a race if you had one).


I think a more ideal way to handle this would be to have settings for whether it aborts or ignores the filter when below minMatch for race, gender, and age.

I haven't been playing the game as much lately and thus not too active on the mod. Not sure if/when that might change.

What file would i have to edit (If its even possible) to make the mod work with "dark elf" rather than "darkelf"

portrait.gd

Line 21, you'd want to change like this I think, haven't tested.

filterRegex.compile('(?!dark ?)elf')

This will make sure it doesn't match just "elf" on files named "Dark Elf"

then later on you'd want to change line 26 like this, so it'll support both with and without spaces.

if file.findn(race.replace(' ','')) >= 0 || file.findn(race >= 0:

Entire file,  and again i didn't test these but should roughly work.

https://pastebin.com/raw/tZ2N9MJt

thanks for the hel, but it hasn't worked. could 'we' make fix on dark instead of dark elf?

Hi @Kyler2 there is a bug in hair color code.

for color in ['auburn', 'black', 'black_gray', 'black_white', 'blond', 'blue', 'brown', 'gray', 'green', 'jelly', 'orange', 'orange_white', 'purple', 'red', 'white']:
filterRegex.compile(color.replace(' ','') + "(?!skin)")
if filterRegex.search(file):
hairColors.append(color)

this code doesn't work with tags that your app uses because it uses capital letters. I fixed it for myself by converting string to lower in this line:
if filterRegex.search(file.to_lower()):

Also would be cool if tits and ass code had something like this in the end:
if titSizes.empty(): titSizes += ['small','flat','masculine','average','large','big','huge']
so that when none of the sizes are picked it would match any of them

Is there any way to add a tag for slave appearance such as unsavory, cute, average ext

Is this compatable with 5.24/5.24a?

I don't believe so. Most mods need to be somewhat heavily reworked to be compatible with the latest version.

Seems to be working fine

Just noticed this in portrait.gd

# Avoid matching DarkElf for Elf
filterRegex.compile('(?!dark)elf')
if filterRegex.search(file.to_lower()):
races.append(race)

I think it should be (?<!dark)

Deleted 4 years ago

Indeed, it seems to be wrong.  Not sure if this will be fixed, but you have my thanks since I derived some of my code from this code.

I can't say I read back through this thread any, but I would imagine it should be taken one step further.

(?<!dark\s*)

Sorry, I don't know what it means. I just copy-paste the code from '(?<!fe)male' parts

No worries.  The < means look backwords.  The \s means black space.  Without the \s DarkElf is treated as different from Elf, but Dark Elf is not.

I've downloaded and installed the mod... I think sucessfully. However, it is't working. There's just no portraits loading.Could it be becase I'm using the launcher, and can't see the load order? 
It says to use random portraits tho....

Here's a quick guide, it may cover stuff you already know.

This mod does not include any portraits, you need to download them separately and put them in the AppData's "portraits" or "bodies" folders.

This mod should be extracted from the zip archive into the AppData's "mods" folder.  Be sure that the path fits the form of "Strive/mods/<modname>/info.txt", as it will not install correctly if there are more or less folders in the path. (If the mod is in the folder named "randomportraits1.0", then it is probably wrong.)

Once in place, mods are applied to the game through the "Mods" panel located in the game's main screen. Select the mods to be applied, then press "Apply".  The game will attempt to apply the mods, but will not inform you of any problems that occurred.  Thus, mods need to be verified manually.  This mod can generally be verified by loading a progress, select a slave, open the Customization tab, and look for the "Random Portrait" button.  If present, then the mod has successfully been applied, though it may still conflict with other mods.

Alright.... When I try to extract the mod, it shows "randomportraits1.0", and I can not really find the info.txt box.
Ah, I am also using Windows 10, by the way. Sorry if this has nothing to do with it

"info.txt" is a file located inside mods that provides an explanation of the mod.  If you have "randomportraits1.0", then you have too many folders.  Look inside that folder, you will find the folder "randomportraits", and inside that folder you will find "info.txt".  You need to remove the contents of "randomportraits1.0" and put them into the AppData's "mods" folder.  That way AppData will have a path containing "Strive/mods/randomportraits/info.txt".

Alright, I think I understand. Hopefully it'll work

I am having the same problem but I have already extracted from the randomportraits1.0 folder

That's not really any info by which I can judge your situation.  Is there a "Random Portrait" button?  Are you using any other mods?  Are you using any portrait packs?  Does manually assigning pictures work?

(2 edits)

the problem is that there are no other mods, I am absolutely sure I have downloaded it correctly, I have activated it in the mods list, but there is no random portrait button, but manually setting portraits does work

and yes I am using a few portrait packs but they are all compatible with the mod

Okay, this is good information; however, based on that the mod was most likely not installed correctly, as the presence of the random portrait button is the simplest sign that the mod has been installed.  The fact that you can select portraits manually means that there is probably no issues on that side.

You have probably seen the install instructions I gave a few posts above this, please be sure that you have followed them carefully.  I'll try to give a detailed list of things to verify.

On windows, there should be a file path "C:\Users\USERNAME\AppData\Roaming\Strive\mods\randomportraits\info.txt".  If correct, the contents of that file will display on the right side of the panel when you hover the mouse over the mod name in the mod panel.

Press the "Active Mods" button on the mod panel.  Near the top left corner of the mod panel, the text "Active Mod List" should appear as part of a transparent popup, with "randomportraits" underneath. (The visibility of this popup can be fixed by my bugfix patch on the Strive Discord, but it will not effect whether the mod works)  If the mod is not listed, then try applying the mod.

In the folder containing game files, find and open the game file "Strive\files\scripts\mainmenu.gd" with any decent text editor.  Find the line "globals.constructor.randomportrait(startSlave)", it should be just below the line "func _on_slaveconfirm_pressed():".  If that line is not present, then the mod system did not add the mod to the game files.  You may need to move the Strive game files to a new location or change the permissions of the folder to allow the game to change it's own files.  A user once had an issue with permissions due to the game being located in the standard "Program Files" folder.

(1 edit)

nevermind it is fixed now, it being hidden might have had something to do with it... but can you really blame me?

(+1)

I don't know if you're still around at all, Kyler2, but if so would you mind if I work on a patch to make this mod compatible with my own? I don't want to touch your code without permission, of course, but I do love using your mod and would like to see them be able to play nicely together.

I am having a problem that I am not sure is my fault, I cant figure out how to actually give them a random portrait

Deleted 2 years ago

I have enabled the mod but the button still isnt there

(+1)

If Kyler2 is still lurking here, I'd like to ask permission to update the randomportraits mod and the PortraitPackEditor tool. I already did it for my own use and was pleasantly surprised about how easy Kyler2 had made to tweak those. Especially by providing the source code for the editor. I'll post a thread in the mod section to check whether there is any interest anyway, but if Kyler2 has any problems with me sharing the edited versions, I'll of course keep my versions private.

(+1)

If you could please share with me the tweaked version, I cannot find a way to make it work for me. :)

I made a post with it in the mods section.

I am trying this mod now, love the way it works so far, except I bought 1 and captured one Tribal Elf, I can not set portraits or body on either of them

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

Hi, I assumed I installed the mod correctly, but pressing the random portrait button doesn't seem to do anything. Something a bit odd that i noticed was that the "randomportraits" folder has a "Constants" file in it now, after applying it in the game. Any suggestions on how I could get it to work?

(1 edit)

The only reason there would be a Constants folder in it is if the path for the Strive mod folder was set to that folder instead of ".../Strive/mods". While Strive's mod system was updated to use mods along any path in the designated mod folder, the mods themselves often use only an exact relative file path. In this case it expects "<the mod folder>/randomportraits/", but that path is not valid with the current path assigned as the Strive mod folder(edit: it's looking for ".../Strive/mods/randomportraits/randomportraits/").

With already existing characters that don't have a pfp, the game crashes when I click on them.

This issue is most likely unrelated to this mod as the changes made by this mod do not change behavior depending on if the character has a portrait image, nor does the vanilla game. Any conflicts with another mod would affect every slave regardless if they had an image.

Hi

Should this mod work in strive for conquest?  

I was linked to this mod from   https://itch.io/t/239558/body-and-portrait-packs-v29updated-2805

Body and Portrait packs v2.9(UPDATED 28.05)

thanks for any help

(1 edit)

No, there is absolutely zero chance of this working with conquest. You followed a link to this mod from another part of the Strive for Power forums not from the Conquest forums.

Side note, this is the old version of the random portraits mod, though that has no impact on your question as neither version will work for Conquest.

This is the old ver? Would you mind linking to the new ver? When I search up random portraits this is the one that comes up

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

Viewing posts 34 to 47 of 47 · Previous page · First page