News:

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

Former www.henthighschool.com

[Resources] Writing events for BK

Started by Goldo, May 19, 2022, 09:17 AM

Previous topic - Next topic

Vaan

#105
Hi guys,

First version of the mod is ready. I've added dating events, events are accessable from the options menu., Walk around for now, i'll add a button at some point. Siege events will happen more often now, after MC has 4 or more girls, if he fails there will be new kidnapping events that occur until he saves the girls.

I've done the MC house and have added events almost everywhere. Got inspired by a few other games to add "Spy" events where MC will have to use speed challenges to not get caught. If he does, event is over.

I played around with the renpy dice system to add simple "missions" like in RPG games where girls can be sent out to complete missions in exchange for gold and different kinds of experience, should they complete it. If not, they will get kidnapped which will also trigger the new kidnapping events, and it's up to MC to save them and so on. That one is still in progress, have not released it for the public version yet, there are a few details i would like to iron out before release.

House can be bought from the button in the mod menu and some of the areas will also need to be bought to access more events (eventually all areas will need to be bought\repaired to access them.)

https://mega.nz/file/rbJjQIbQ#epv61BTYCeroY5nXRGnARlZAHPayO_uW3wQYCdf9UIk

I've done a few playthroughs, haven't encountered many problems. My private version has a few extra things that i'm working on, that i will add here once i've fixed all the issues

I had another question, hopefully an easy one. Is it possible to get MC.girls using their traits?

Tried these, but so far it's still getting random girls.

$ able_girls = [g for g in MC.girls if girl.has_trait("Brave")]

$ girl = get_girls(1, free=False, p_traits=["Brave"])[0]

$ girl = get_girls(1, able_girls, p_traits=["Brave"])[0]

Also is there an easy way to remove the cap on love and fear, so that you can reach max or lowest without being affected by rank? I imagine it's within the game somewhere, but i can't find it. That one is just for me, won't try to add it to the public mod. If it's too compicated, i won't bother and leave it as it is.

Hope you enjoy the mod, i'll add a separate page for it if needed, i will probably be supporting it too, but support on the mod will be slow as i'm busy most days.


AlolanNinetales

Quote from: Vaan on Feb 18, 2024, 04:21 PMHi guys,

First version of the mod is ready. I've added dating events, events are accessable from the options menu., Walk around for now, i'll add a button at some point. Siege events will happen more often now, after MC has 4 or more girls, if he fails there will be new kidnapping events that occur until he saves the girls.

I've done the MC house and have added events almost everywhere. Got inspired by a few other games to add "Spy" events where MC will have to use speed challenges to not get caught. If he does, event is over.

I played around with the renpy dice system to add simple "missions" like in RPG games where girls can be sent out to complete missions in exchange for gold and different kinds of experience, should they complete it. If not, they will get kidnapped which will also trigger the new kidnapping events, and it's up to MC to save them and so on. That one is still in progress, have not released it for the public version yet, there are a few details i would like to iron out before release.

House can be bought from the button in the mod menu and some of the areas will also need to be bought to access more events (eventually all areas will need to be bought\repaired to access them.)

https://mega.nz/file/rbJjQIbQ#epv61BTYCeroY5nXRGnARlZAHPayO_uW3wQYCdf9UIk

I've done a few playthroughs, haven't encountered many problems. My private version has a few extra things that i'm working on, that i will add here once i've fixed all the issues

I had another question, hopefully an easy one. Is it possible to get MC.girls using their traits?

Tried these, but so far it's still getting random girls.

$ able_girls = [g for g in MC.girls if girl.has_trait("Brave")]

$ girl = get_girls(1, free=False, p_traits=["Brave"])[0]

$ girl = get_girls(1, able_girls, p_traits=["Brave"])[0]

Also is there an easy way to remove the cap on love and fear, so that you can reach max or lowest without being affected by rank? I imagine it's within the game somewhere, but i can't find it. That one is just for me, won't try to add it to the public mod. If it's too compicated, i won't bother and leave it as it is.

Hope you enjoy the mod, i'll add a separate page for it if needed, i will probably be supporting it too, but support on the mod will be slow as i'm busy most days.


Thank you good sir, will definitely check this out and am excited to play this

Vaan

#107
Hope you like it, let me know if there are any issues! The main idea of the house would be to have a list of free girls who live there (might be able to do a landlord\rent system or something in the future), but i haven't figured out how to do that yet, as i'm not good with python, i believe i will need it to be able to free and move girls to the house, but that would be a lot further down the line when i get better. It's why some of the content might not be related to the usual brothel interactions. But when i was writing the code, i had free girls in mind hah, felt like their content has opportunity to be expanded.

Forgot to remove some of my personal tags (kidnapped, spy), added new areas(tavern, showers, gym, pool, dressing room, living room, office and a few more) and also added furniture interactions (like on char, on table, on desk, on bed and so on). I've replaced those ones with the normal ones, (wet, public, beach, dirty, rest). I could potentially release downloads with the girlpacks i have that work with the extended tags at some point (have about 95 of them). This version should be cleaner:


https://mega.nz/file/7OZlRKjB#0PPSdrZwQ0AEWVecTOlkioeuM-vSvH5wMq69cnZUkWE





AlolanNinetales

I'm having trouble with giving one of my girls a custom trait while she also has a custom event. The custom event in the _events.rpy works perfectly fine however the custom trait does not work. I think the problem lies with where I am inserting the (init -2 python:) for my custom trait. Do I make another _events.rpy? Cause currently it's in the same .rpy and I think that's why it is not working. I don't want to paste the entire code in here but if someone wants to look at it I can do that. And for context, yes I also made sure her BK.ini is correct in order for her BK.ini to work.

Jman

No, if one events.rpy doesn't work, another isn't likely to work better.

Kind of hard to say what's wrong with this little information, but since the trait dictionary is built only after starting the game, something in an init block isn't going to be able to access it. 

Posting at least the trait-relevant code snippet would help pinpoint your issue.
And with strange aeons even death may die...

AlolanNinetales

This is what it looks like in my _events.rpy:
init -2 python:

    def custom_trait_TifaLockhart(girl): ## Remember to change "add_my_custom_trait" to something unique, and then add it to your BK.ini under init_function (in the [background story] category)

    # This code is executed when your girl is being created (for her first appearance in the slavemarket or in the city)
    # The trait is added to whatever other traits she spawns with
    # If keep_init is false in her BK.ini, then it'll only apply to an original version of her
      
        global gold_traits, pos_traits, neg_traits
        global trait_dict

        # Define your trait here
        my_trait =  Trait("Bartender", verb="be", effects=[Effect("boost", "income", 0.01, scales_with = "rank"), Effect("increase satisfaction", "waitress", 2),Effect("increase satisfaction", "service", 2), Effect("change", "valuation", +300)], archetype="The Model", base_description = "Beautiful, charming, and renown for her harwork, customers come for the sole reason to be served by her.")
      
        # Adding the trait to trait_dict will make it a trait that other girls can spawn with & quests/contracts can request
        add_to_dictionary = False
      
        try: # If your trait has a name that already exists in the dictionary, we can keep things simple and add it immediately (even if it has been added to the dictionary by a mod such as Trait King)
      
            girl.add_trait(trait_dict[my_trait.name])
      
        except:

            if add_to_dictionary:
                gold_traits += [my_trait] # change this to gold_traits, pos_traits or neg_traits depending on how strong your trait is
                trait_dict[my_trait.name] = my_trait
                girl.add_trait(trait_dict[my_trait.name])
            else:
                girl.add_trait(my_trait)
          
        return


This is what the code looks like in the girl's BK.ini
[background story]

## If provided, this function will be called when a girl with this template is created, after randomization.
## It must take 'girl' as an argument. It must not interrupt game flow (python only, no ren'py calls or jumps).
## Write the function in an init block in _events.rpy or another custom .rpy file.
init_function = "custom_trait_TifaLockhart" ; provide a custom function name that is called after girl creation (between quotes)

Jman

You also need this, unless your girl is set to generate as original.
[cloning options]
...
keep_init = True
And with strange aeons even death may die...

AlolanNinetales

Quote from: Jman on Aug 10, 2024, 07:20 AMYou also need this, unless your girl is set to generate as original.
[cloning options]
...
keep_init = True
She is set to original

Jman

Well, I get a girl with this script and .ini snippet to generate with 'Bartender', so something else must be wrong. Can you upload your full _BK.ini and _events.rpy files somewhere?

Also, you're using 0.3, right?
And with strange aeons even death may die...

AlolanNinetales

https://mega.nz/folder/dtBVCQ4R#9ZAnM1MjU2mrnVDPN3gHpQ I couldn't paste the code here cause of the text limit so here's a link to the actual BK.ini and _events.rpy

Also I am using 0.2, so that may be a problem.

Jman

You have two entries for 'init_function'. The appropriately named 'my_dumb_function' is the one that wins. :D
And with strange aeons even death may die...

AlolanNinetales

Quote from: Jman on Aug 10, 2024, 09:06 AMYou have two entries for 'init_function'. The appropriately named 'my_dumb_function' is the one that wins. :D
LMAO I'm so stupid thank you so much  ;D

sjeongjin

the reveal was so much better than i had expected. Woke me up just enough to keep tagging for a few more hours lol.
Link to packs:
https://www.mediafire.com/folder/ztc2nv6y2ml7h/BK+girl+packs
If you want to support my reckless spending to make better packs donate here. Or just buy me a coffee or energy drink so I can keep tagging beyond my human limitations.
https://ko-fi.com/sjeongjin

AlolanNinetales

Hey everyone, this is not necessarily an event, but I wanted to write a special custom trait for my Sailor scout girl packs where they would all share the same custom trait, but the trait would get "stronger" with the more sailor scouts you own. For example, if you only own one sailor scout, then there are no bonuses and the trait is useless, but if you own 2; then the bisexual satisfaction for both girls increases by 1, and then 3 girls increase satisfaction for all girls by 2, and so on until you have all 5 and you get essentially an exodia of buffs for all the girls. Is this possible to do? and If so how much of an undertaking would that be; I'm not to experienced with writing code and have made custom traits for a lot of my girls but mostly all of them are pretty simple. Thanks for the help!

Jman

#119
Hmm, the more user-friendly way would be to try to use 'custom_scale'... except I see no hooks for that to get the scaling from a trait.

Otherwise, one way I can see it done is to use 'night_label' to count your Sailor Scouts each night and then add/remove relevant traits. It'd be kinda clumsy, and won't work well for traits that are used during the day. And you probably need more than one function name to avoid namespace conflicts, but Ren'Py will complain about that on its own. And some deconfliction so you don't add the same trait twice or more.


Honestly, I'd ask Goldo for custom scaling traits first.


You probably need to check that e.g. two Usagis don't stack with each other, maybe you want them all to be original, too? And also, do other people's Sailors apply, e.g. Leortha's?
And with strange aeons even death may die...