News:

Please request registration email again and then check your "Spam" folder

Former www.henthighschool.com

Solving image dispalys logic at the ShowImage level?

Started by ElPresidenete, Nov 27, 2023, 11:44 AM

Previous topic - Next topic

ElPresideneteTopic starter

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.

barteke22

#1
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).

ElPresideneteTopic starter

#2
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?

ElPresideneteTopic starter

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???

TBBle

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.

ElPresideneteTopic starter

#5
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)

TBBle

I added this 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.



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".

ElPresideneteTopic starter

ffs...I was using a string constant, not stringvariable

TBBle

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.

ElPresideneteTopic starter

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.

ElPresideneteTopic starter

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.

TBBle

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.

ElPresideneteTopic starter

So yes, I do need to call SexEffect. Thanks. ;D