HentHighSchool Development Forum

Game Development => HHS+ => HHS+ Development => Topic started by: ElPresidenete on Nov 27, 2023, 11:44 AM

Title: Solving image dispalys logic at the ShowImage level?
Post by: ElPresidenete on Nov 27, 2023, 11:44 AM
Every event, if you want to make it more generic, needs a complex web of checks for displaying the right image for various gender combos.

Wouldn't a far more efficient way be to have the logic in a new ShowImageFromDirectoyFiltered function?

- all images for an action/event in one folder. All images tagged with a proper tag that describes giver/reciver (FutaOnMale, FemaleOnFuta, FemaleOnFemale, etc...)
- the image function would take in 2 person as parameters and based on that ONLY show a radnom image that has the right tag

Person 1 is Futa, Person 2 is female, thus only images with a FutaOnFemale tag would be shown.

This would make 2 person events much easier to make and the events would be much cleaner and smaller.
Old events could then be switched to the new system over time.
The trick is adding the special tags to the images.
Title: Re: Solving image dispalys logic at the ShowImage level?
Post by: barteke22 on Nov 27, 2023, 03:52 PM
If by function you mean a VEE Op (engine code), instead of a Function (FunctionLibrary), then 'not really'.

The engine has 0 concept for how GenSex works, since the whole thing is a scenario construct (VEE).
And anything more generic would just end up being wrapped in a Function, like GenSex being a wrapper around the HaveSex Op.


If you mean a FunctionLibrary event, then there's already one that can do everything you've described and more.

FunctionLibrary\PCGeneralSex\ShowActionImageProvider can be pointed to any folder that follows the PCGeneralSex structure and naming conventions.
Which are described in Docs and modding guides, and support non-PC sex (it's what's used by all of AskForSex).
Title: Re: Solving image dispalys logic at the ShowImage level?
Post by: ElPresidenete on Nov 28, 2023, 10:22 AM
Would have been nice if I knew that earlier.

Does it also update relationships data and person stats, or do I have to call other functions after it? I nohter words, do I have ot call HandleSexEffects after it?
Title: Re: Solving image dispalys logic at the ShowImage level?
Post by: ElPresidenete on Nov 30, 2023, 11:22 AM
So if I'm understanging this, the Image root folder MUST be either PcGenSex or Special?

I'm tryying to put in different string constants as action(image) path, but it all comes back as red???
Title: Re: Solving image dispalys logic at the ShowImage level?
Post by: TBBle on Nov 30, 2023, 01:32 PM
Quote from: ElPresidenete on Nov 30, 2023, 11:22 AMSo if I'm understanging this, the Image root folder MUST be either PcGenSex or Special?

I'm tryying to put in different string constants as action(image) path, but it all comes back as red???

No, by code inspection, the image root folder can be anything. It's relative to the school base path, so for example when 69'ing (mutual oral sex, Action 15 or 16, GiveReceive 3), the Action Path passed into ShowActionImageProvider will be Images\EventPictures\PCGeneralSex\Oral_69 and the folders under that path are structured by GenderA\GenderB as described in Docs/GenSex Image & Character Packs.txt.
Title: Re: Solving image dispalys logic at the ShowImage level?
Post by: ElPresidenete on Nov 30, 2023, 02:06 PM
Mods\RandomFixes\Images\bondage_sex\ride - nope
\Mods\RandomFixes\Images\bondage_sex\ride - nope
\Images\bondage_sex\ride - nope
Images\bondage_sex\ride - nope
\bondage_sex\ride - nope
bondage_sex\ride - nope


in my case... nothing passes. everything show red.


So the FULL path is:
D:\MY FILES\[Full] HHS+1.10.5.7-release\Schools\NormalSchool\Mods\RandomFixes\Images\bondage_sex\ride   (inside are Fem, FemFuta, Male, etc.. folders)
Title: Re: Solving image dispalys logic at the ShowImage level?
Post by: TBBle on Nov 30, 2023, 03:31 PM
I added this (https://imgur.com/a/gRjR3MV) hacky call to the nude photo button in the bathroom, and with a futa MC in a new game with your Random Fixes 2 mod installed, I get a futa-futa image each time I click. There's two images being chosen between, one each of the sub riding or being ridden.

(https://i.imgur.com/4EzzyjZ.png)

So it does work, and is mod-aware, but beyond that, we'd need to see the actual inputs you're using to help find the issue. The Action Path I used is "Images\bondage_sex\ride".
Title: Re: Solving image dispalys logic at the ShowImage level?
Post by: ElPresidenete on Nov 30, 2023, 04:12 PM
ffs...I was using a string constant, not stringvariable
Title: Re: Solving image dispalys logic at the ShowImage level?
Post by: TBBle on Nov 30, 2023, 11:17 PM
Weird, I would have expected that to work too. I understood that String Constants are just String Variables that have a picker and appear in red if they don't recognise the string, but otherwise should just work.
Title: Re: Solving image dispalys logic at the ShowImage level?
Post by: ElPresidenete on Dec 01, 2023, 08:02 AM
They DO appear red if I use constant and green if I just use variable. But since the event in question isn't triggering..

Added a few minor tweaks (gloryhold and slave discovery - named AnneteSlave - script) and some images to the RandomFixes2

I'm getting a weird error in SwimmingEncounters. I check if peopel are found in location and update a bool for males/females/futas on the Try phase...
and in the Execure a branch should trigger ONLY if hte bool is true (so a futa event woudl triger ONLY if a futa was actually found)..

EDIT: Oh fuck. I left the default value and it checks if >= 0, not > 0. FFS. Updated.
Title: Re: Solving image dispalys logic at the ShowImage level?
Post by: ElPresidenete on Dec 01, 2023, 08:41 AM
I still didn't get the answer if ShowActionImageProvider handles the after sex logic (stats, relationship).
Seem like it does, since it takes in some variables, but I'm not seeing amount anywhere.
Title: Re: Solving image dispalys logic at the ShowImage level?
Post by: TBBle on Dec 01, 2023, 10:58 AM
ShowActionImageProvider uses the variables it gets as part of image selection, as it provides a bunch of tags by default based on the provided Action/GiveReceive/Consent, I believe. It doesn't apply any stat effects.

From memory, stat and relationship changes are hard-coded to the existing GenSex logic, so adding new logic where you call ShowAction and friends directly will also require implementing your own stat effects. I recall posting about this requirement previously, so this knowledge might be out-of-date, or just misremembering. I'll find the post later, it's possible I'm confusing this with something else.

Edit: Search says I didn't make any such post, so maybe I dreamed it. (Or it was on the old forum). Anyway, FunctionLibrary/GenSexHandling/SetEffects.ve.xml is responsible for applying stat effects, and it is called from FunctionLibrary/PCGeneralSex/ShowAction.ve.xml, immediately after ShowActionImageProvider is called. So if you're calling ShowActionImageProvider, you will need to call (or possibly implement your own variant of) FunctionLibrary/GenSexHandling/SetEffects.ve.xml.
Title: Re: Solving image dispalys logic at the ShowImage level?
Post by: ElPresidenete on Dec 04, 2023, 08:00 AM
So yes, I do need to call SexEffect. Thanks. ;D