News:

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

Former www.henthighschool.com

[Resources] Headhunter mod

Started by Jman, Jul 08, 2024, 09:22 PM

Previous topic - Next topic

JmanTopic starter

#15
Quote from: mistercb on Nov 16, 2024, 03:28 PMCould I recommend a change to the HH mod? I think the 'frequent flyer' options unlock too slowly; I was using it on cooldown trying to get the originality option but got to 100 girls in chapter 7 before eventually just downloading the debug.
It's actually because there's both a monetary and a 'girls' component. 20 girls is enough to unlock everything, but you also need to pay 50 000 gold to the HH. Not 50k total, 50k for her services. That is, the money you pay minus the base slave price.

If you only buy tourist class, you'll have a hard time racking up the big miles. :D

If you think 50K is too much, I'm willing to listen to arguments.



Also, I looked into 'Dynamo', and apparently all the ninja gal traits are now freely available to everyone. And the ninjas themselves do not necessarily have those traits, either. So HH is working as intended. It's Goldo who seems to have gone off the deep end. :P
And with strange aeons even death may die...

SometimesIsNotEnough

Got some bugs, all these are on
game.version = 0.3t v241128 and headhunter version
0.314
1. At some point girl.path changed to only contain the folder name of the girlpack instead of the path to the girlpack. This means that HH effectively ignores any mixes when comparing paths or trying to read .ini files.

2. HH doesn't set "keep traits" in the girls init_dict, so clones often just have random traits instead of what was asked for.

3. girl randomization caps the amount of positive traits a girl can have, so even if you pay for a girl with 5 positive traits you can only get 2(or more with TraitKing)

JmanTopic starter

#17
As far as I can tell, 2. is a consequence of 1. and if there are no mixes in play, all init options are read and parsed correctly.

I'll look into the mix parsing issue. Edit: Did some fixing. I hope the new 0.315 and 0.215 versions now play nice with girl mixes. Didn't test much beyond verifying it seems to work for a test pack with keep_traits on and some special traits, so feedback is welcome. /edit.


Randomisation is WAD. It was always supposed to avoid breaking your active trait limit (so, TK vs vanilla currently), thus any extra requests just mean you're getting a random selection of what you specified, not all of them. Kinda clumsy, yes, but I don't really want to code two different pricing schemes. Perhaps I should just remove the extra trait options beyond 2+1 if the limits haven't been raised?
And with strange aeons even death may die...

SometimesIsNotEnough

Quote from: Jman on Dec 01, 2024, 04:12 PMI'll look into the mix parsing issue. Edit: Did some fixing. I hope the new 0.315 and 0.215 versions now play nice with girl mixes. Didn't test much beyond verifying it seems to work for a test pack with keep_traits on and some special traits, so feedback is welcome. /edit.

New version works fine for me.

Quote from: Jman on Dec 01, 2024, 04:12 PMRandomisation is WAD. It was always supposed to avoid breaking your active trait limit (so, TK vs vanilla currently), thus any extra requests just mean you're getting a random selection of what you specified, not all of them. Kinda clumsy, yes, but I don't really want to code two different pricing schemes. Perhaps I should just remove the extra trait options beyond 2+1 if the limits haven't been raised?

I completely missed the fact that HH was supposed to respect the trait limit, would be nice if i wasn't charged for all the traits if I'm only getting some of them...

Vanilla still has the 2+1 trait limit, but TK allows up 2 gold + 3 positive for a total of 5(with 0 negative), which is what I thought you were going for with the trait menu.

JmanTopic starter

Well, I was actually going for the 6-trait limit in my old mod, which kinda included the contemporary version of TK. And I wanted to leave one slot empty for evoving new traits. I never spent too much time thinking about how well it'd fit vanilla, since I was never going to play it with vanilla. :-\


I see two solutions: 1) charge less for specifying more traits than the max - which I don't really want to do, because I don't know what vanilla economy is like. Although HH pricing is kinda whacky anyway. And 2) just cap the amount of 'buyable' traits - but that's kinda hard to do, since there's no variable to tell me what the max is (TK has variable hardcoded maximums that are selected at random). I can always just check for TK and not impose any limits for that... although then I'm going to hit negative trait limits as well...

So, yeah, I don't see a clear solution right now...


Well, I suppose I could count the traits on the girl and apply a discount at the end?
And with strange aeons even death may die...

SometimesIsNotEnough

The last option sounds like the most straightforward one to me, for what that is worth.

Funnily enough the game doesn't have a limit for negative traits, only a minimum amount. Adding more negative traits than usual wouldn't mess with anything TK isn't already breaking.

JmanTopic starter

#21
Uploaded version 0.316/0.216, which gives you some discounts for traits you ask for and don't get due to trait limits. Also added a check for repeatedly asking for the same trait, so no gaming the system for bogus sales prices. :P

Not sure if the discounts are too generous or not. For instance, if you ask for five, but only get two (presumably out of the five, but there may be other cases, e.g. .ini-specified traits), you pay only +20% (+5*25% - 3*25% (no extra charge for traits you don't get) - 3*10% (roughly half-price discount for doing the lottery)) instead of the normal +2*25%.

Especially so since you also need to pay her big bucks for the 'frequent flyer' options.



As to trait limits, there really aren't any for either positive or negative beyond what's in the trait generation algorithm. So 'trait limit' is kind of a misnomer. You can have as many on a girl as you wish - but there aren't any ways to add them in vanilla, and TK has its own systems.



Also, as a final note, custom traits that aren't part of the gold+positive+negative system don't count in the discount calculations. So you kinda get them for free and even at a discount. I'm not sure if this needs changing, but it seems 'story' traits aren't particularly well supported at the moment anyway?

And with strange aeons even death may die...

D4EH

Getting this error when clicking yes to haggle price, which in previous versions basically rerolled the girl you were being offered
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/Mods/Headhunter/Headhunter.rpy", line 1939, in script
    while hhgirl.original:
Exception: Possible infinite loop.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/Mods/Headhunter/Headhunter.rpy", line 1939, in script
    while hhgirl.original:
  File "C:\Games\F95\Brothel_King-pc\renpy\execution.py", line 61, in check_infinite_loop
    raise Exception("Possible infinite loop.")
Exception: Possible infinite loop.

JmanTopic starter

Hmmm, do you only have original girlpacks, by any chance?

Added some sanity checking to while loops and also fixed accidentally breaking pack name autocomplete (and requests by pack name in general).
And with strange aeons even death may die...

D4EH

Getting an error on startup with the newest file
```
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/Mods/Headhunter/Headhunter.rpy", line 2538: if statement expects a non-empty block.
    if len(g_list) >= 1:
                        ^

File "game/Mods/Headhunter/Headhunter.rpy", line 2542: expected statement.
    else:
        ^

Ren'Py Version: Ren'Py 8.2.0.24012702
Thu Dec  5 02:14:49 2024
```

And no, i dont have only original girlpacks

D4EH

By adding a space (I just pressed tab on vscode) to lines 2539 $ hhgirl = g_list[0]
,2540 else: and 2549 $ hhgirl = g_list[0], the game now boots, but now there's this whole separate issue, i thought it was just a formatting error, but this is way above my paygrade lol

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/Mods/Headhunter/Headhunter.rpy", line 1904, in script call
    call make_hhgirl(making_name = headhunted_name)
  File "game/Mods/Headhunter/Headhunter.rpy", line 2543, in script
    $ g_list = get_girls_hh(1, free = game.headhunter_free, init_dict = input_dict, path = get_real_girlpath(making_name), g_rank = int(headhunted_rank))
  File "game/Mods/Headhunter/Headhunter.rpy", line 2543, in <module>
    $ g_list = get_girls_hh(1, free = game.headhunter_free, init_dict = input_dict, path = get_real_girlpath(making_name), g_rank = int(headhunted_rank))
  File "game/Mods/Headhunter/Headhunter.rpy", line 294, in get_girls_hh
    if not compare_girl_paths(get_real_girlpath(girl.init_dict["path"]),get_real_girlpath(girl.path)):
  File "game/Mods/Headhunter/Headhunter.rpy", line 158, in get_real_girlpath
    path = path.split("/")[-2]
IndexError: list index out of range

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/Mods/Headhunter/Headhunter.rpy", line 1904, in script call
    call make_hhgirl(making_name = headhunted_name)
  File "game/Mods/Headhunter/Headhunter.rpy", line 2543, in script
    $ g_list = get_girls_hh(1, free = game.headhunter_free, init_dict = input_dict, path = get_real_girlpath(making_name), g_rank = int(headhunted_rank))
  File "C:\Games\F95\Brothel_King-pc\renpy\ast.py", line 823, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Games\F95\Brothel_King-pc\renpy\python.py", line 1178, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "game/Mods/Headhunter/Headhunter.rpy", line 2543, in <module>
    $ g_list = get_girls_hh(1, free = game.headhunter_free, init_dict = input_dict, path = get_real_girlpath(making_name), g_rank = int(headhunted_rank))
  File "game/Mods/Headhunter/Headhunter.rpy", line 294, in get_girls_hh
    if not compare_girl_paths(get_real_girlpath(girl.init_dict["path"]),get_real_girlpath(girl.path)):
  File "game/Mods/Headhunter/Headhunter.rpy", line 158, in get_real_girlpath
    path = path.split("/")[-2]
IndexError: list index out of range

D4EH

Alright i think i fixed the issue, i think? game doesnt throws errors anymore, and rerolling girls is working, what i did was edit how def get_real_girlpath(path): in line 154 works and then updated def get_girls_hh in line 196 to reflect the changes i made so it doesnt freak out when girlpath doesnt find shit, also changed the if not part in line 295 (which i totally did initially, and wasn't something i noticed only after fucking up.

Honestly, I don't know if me changing this stuff messed with other stuff in any way or another, it just worksTM, but i didn't find any error so i can't deny nor confirm this statement

Here's the file, https://pixeldrain.com/u/jM3GL3wG

JmanTopic starter

#27
Yeah, that was embarrassingly not-tested. :-[ Uploaded a new version with proper indentation and some more sanity checking in path verification.


The line 295 change seems to be the one that was causing you issues actually, sort of. I suppose you could also enter an empty string at the HH, too. Your 'girl.init_dict.get("path", "")' will still give a list instead of a string on failure. And I don't think Python has the Lua-style 'x or default_value' idiom.

It also seems your version of 'get_real_girlpath' doesn't work with mixes, which was most of the intention there.



About the original issue: strange, how cycling for non-originals can take so long with clones available. Perhaps you have comparatively few packs and most are already in the game? But then originals should also be in. So, not sure what the original issue was. Potato machine? :D
And with strange aeons even death may die...

D4EH

Thanks for checking things out so fast, after you pointed out that maybe a potato machine could be the cause of the issue, i tried to wait between clicks, as in waiting for the next text to appear before clicking again (After clicking yes to haggle price), and there were no errors, funny enough, i can replicate the original issue(possible infinite loop) 100% of the times by clicking too fast, strangely, with the code changes i made this doesn't happens, i can click as much as i want, and even if the app stop working the game doesn't show an error, idk how this happened, i don't even know enough python to try to understand it, but somehow the changes i made, turned the mod more potato friendly and this wasn't even my intention lol, turns out you can fix stuff by breaking it too  ;D  ;D

But yeah, your mod is working, original issue was on me having a glorified toaster as laptop, thanks for the great work and keep it up, wish you had come earlier so i wouldn't have been sweating bullets trying to figure out why it didn't work tho hahaha

JmanTopic starter

#29
I mean, your changes are already on top of the loop sanity checking, so of course while loops should work... although I don't quite understand why, since now a too long loop should get you the "No can do, cap'n. It be impossible!" message. And you're not getting that, but either an actual girl or an error or silent crash?

Are you saying you still get infinite loop errors when clicking too fast, even with the latest version? I tried, but couldn't get any. Then again, I have a moderately non-potato PC. You click 'Yes' and hover in the same spot, clicking like mad until the 'Yes' comes up again, right?

Your changes don't really touch any loops, either, so I don't quite get what's going on.



Edit: I tried removing the loop limits, but couldn't get anything by clicking too fast then, either. Too non-potato, I suppose.

On reflection, perhaps your changes worked because they shortcircuited girl generation by not requiring exact name matches and you were getting offered random gals instead of the one fitting your specifications? That could certainly cut down on looping. :)



Edit2: I also see that the previous published version your changes were based on erroneously omitted 'default' girls (not part of any custom mixes) from name-checking altogether, so that could've contributed, too. I somehow missed updating the public version with those (maintaining like 3-4 different versions of HH is kind of a pain :'( ).
And with strange aeons even death may die...