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

neronero

It doesn't seem that weird to me. Shopkeepers are also nailed in place and we're used to that.
If every girl stayed in place then that'd become a bit weird.
My Girl Packs: [ link ] - Trait King mod: [ link ]

GoldoTopic starter

Quote from: darkzerotor on Mar 25, 2023, 05:19 PM
QuoteWhat should we do for girls that are set to a specific location by their _BK.ini setting? It would be weird if they were nailed in place.
I mean for normal girl it would be weird, but if it's for specific girl like a mermaid that you just want to stay at beach location or something it would be quite normal right?

I guess, although it would slightly imbalance the game by removing the element of randomness for a particular girl, but it can be added as a _BK.ini option as well.

On the subject of _BK.ini, as I am doing some clean-up on that part of the code, are there other things you guys would like to be able to customize with it?
Maker of BK. Looking for the latest patch for BK 0.2? The link doesn't change, so bookmark it!

AlolanNinetales

I don't know if this is the right thread for this question, but I was having trouble getting part of an event to work. I basically copied boa hancock's _events code from Gold's character and just replaced some of the text for another character. It's the part of the _events where you can go and visit her room and you find the snake in her room. Except I can never seem to get to that part of the event, whenever I visit her room the same dialogue option comes up. All the code is the exact same except for some text that I changed for my own character. The code looks like this

label tifa_lockhart_interact(girl):

    # The player is limited to one visit per day

    if girl.flags["tifa_has_visited"]:
        "You have already visited [girl.fullname]'s room today."
        return

    $ MC.interactions -= 1
    $ girl.flags["tifa_has_visited"] = True

    "You decide to pay a visit to [girl.fullname]'s bedroom."

    play sound s_knocks

    show expression brothel.bedroom_type.pic_path
    with dissolve

    ## Visits go through three stages. Each stage after the first one has a 33% chance of happening

    # First stage

    if not girl.flags["tifa_visit_stage"]:
        $ girl.flags["tifa_visit_stage"] = 1

        play sound s_door

        "[girl.fullname] is getting dressed, sitting on her bed stretching her arms."

        show screen show_event(girl.profile, x=1024, y=768, bg=None)

        you "Hey, [girl.name]."

        girl.char "[MC.name]? What are you doing here?"

        you "Hmm, I was just checking on you, wondering if everything's all right with your room..."

    if brothel.get_mood_modifier(girl.rank) < 0:
            girl.char "This place is a dump. My room was much nicer back at Seventh Heaven."

            menu:
                girl.char "This place is a dump. My room was much nicer back at Seventh Heaven."
                "Apologize":
                    you "I'm sorry, I am going to improve the facilities as soon as I can..."

                    girl.char "I sure hope so. I am beginning to miss how things were before I came here."

                    $ girl.change_fear(-1)

                "Scold her":
                    you "I don't care what you think, it's still better than that shithole of a bar I saved you from. Get ready for work, and stop complaining."

                    girl.char "What... What did you say..."
 
                    $ girl.change_love(-1)

    # Second stage

    elif girl.flags["tifa_visit_stage"] == 1 and dice(6) >= 1:
        $ girl.flags["tifa_visit_stage"] = 2

        "As you approach [girl.name]'s door, you are met with the reverberating thuds as the punching bag endures a relentless barrage."

        you "I am coming in."

        play sound s_door

        show screen show_event(girl.profile, x=1024, y=768, bg=None)

        girl.char "Huh?"

        play sound s_surprise

        girl.char "You could knock you know..."

        "[girl.name] was startled to see you. She grabs a water bottle and returns to sit on her bed."   
 
        you "You sure know how to pack a punch, where did you learn to fight like that?"

        girl.char "I had a good teacher... but that's honestly besides the point. I am not as strong as I was before, just recently my gloves broke and now I feel a lot weaker."

        girl.char "It's too bad cause sometimes customers get rough and rowdy, if only I were as strong as before then it wouldn't be a problem."

        "You examine her gloves and see they are all busted up."

        you "Damn! What did you have to beat up to wear these gloves out this badly?"

        girl.char "You wouldn't believe me if I told you..."

        you "I tell you what; if you keep being a good girl, I'll see what I can do about those gloves. Take it as a token of my appreciation for your honest work."

        "As you turn around to leave, you hear her continue to fiddle with her gloves."

        you "I can tell those gloves meant a lot to her. If I can fix them I'll be irresistible."


I can never get past the first stage of the event as it always just repeats itself. Was just wondering if anyone knows How I can change the code so I can get past the 1st stage and be able to actually complete the event.

Again, I'm sorry if this is the wrong thread to be asking this but just wanted some help, new to this whole events and coding thing. Thank you for your help!

neronero

Quote from: AlolanNinetales on Jul 13, 2023, 09:31 PMif brothel.get_mood_modifier(girl.rank) < 0:
Looks like it's an indentation error with this line. Add four more spaces before it (eight in total)

The elif statement of the second stage is now linked to that unrelated if statement, while it should be linked to the first stage's if statement.
My Girl Packs: [ link ] - Trait King mod: [ link ]

AlolanNinetales

Quote from: neronero on Jul 16, 2023, 07:00 PM
Quote from: AlolanNinetales on Jul 13, 2023, 09:31 PMif brothel.get_mood_modifier(girl.rank) < 0:
Looks like it's an indentation error with this line. Add four more spaces before it (eight in total)

The elif statement of the second stage is now linked to that unrelated if statement, while it should be linked to the first stage's if statement.
Thank you this fixed it!

GMWinters

Whelp! Given Alolan was kind enough to open the flood gates, I too have an event question that's more related to 'code' than 'writing' per se...

Can anyone explain how the Dim/Bright lights effect
Effect("boost", "customer events", 0.5, scope="brothel")would be translated to a single girl? And does the effect need to be attached to something such as a trait or can it just be attached to a girl directly? (I'm goofing around with modifying the Augment Mod code)

Any just to confirm I haven't wildly misread something... "customer events" are when a customer asks a job girl to fuck, right?

GoldoTopic starter

Quote from: GMWinters on Sep 22, 2023, 08:18 PMWhelp! Given Alolan was kind enough to open the flood gates, I too have an event question that's more related to 'code' than 'writing' per se...

Can anyone explain how the Dim/Bright lights effect
Effect("boost", "customer events", 0.5, scope="brothel")would be translated to a single girl? And does the effect need to be attached to something such as a trait or can it just be attached to a girl directly? (I'm goofing around with modifying the Augment Mod code)

Any just to confirm I haven't wildly misread something... "customer events" are when a customer asks a job girl to fuck, right?

Minor spoiler about the game's mechanics:
Spoiler
The chance for a girl to have a special customer encounter is a flat 10%. With this effect, it becomes 15% which is 50% higher.
[close]
Maker of BK. Looking for the latest patch for BK 0.2? The link doesn't change, so bookmark it!

GMWinters

#67
Quote from: Goldo on Sep 24, 2023, 08:05 PMMinor spoiler about the game's mechanics:
So just to confirm:
Spoiler
Is that a 10% chance per customer for said customer to initiate an event?
or a 10% chance per night for something to happen?

Edit: Testing seems to indicate it's a per night chance.

Are modifications to that base chance additive? or multiplicative?
i.e. do two +100% chance effects result in a 30% chance or a 40% chance?
(And possibly more important, do two -50% chance effects result in 0% or 2.5%?)
[close]

And do I just drop the 'scope' parameter to make it only apply to the one girl?

GoldoTopic starter

Quote from: GMWinters on Sep 25, 2023, 12:16 PM
Quote from: Goldo on Sep 24, 2023, 08:05 PMMinor spoiler about the game's mechanics:
So just to confirm:
Spoiler
Is that a 10% chance per customer for said customer to initiate an event?
or a 10% chance per night for something to happen?

Edit: Testing seems to indicate it's a per night chance.

Are modifications to that base chance additive? or multiplicative?
i.e. do two +100% chance effects result in a 30% chance or a 40% chance?
(And possibly more important, do two -50% chance effects result in 0% or 2.5%?)
[close]

And do I just drop the 'scope' parameter to make it only apply to the one girl?

It's a roll after each interaction, so in that case once per job girl performing every night.

Boost values are always additive, so a boost of 50% and a boost of 100% combine to +150%, that is a final result of 250% of the original value.

And yes, if you don't specify the scope, it will only apply to this girl.
Maker of BK. Looking for the latest patch for BK 0.2? The link doesn't change, so bookmark it!

GMWinters

Is it possible to make trait effects vary depending on personality? Or would either the BK code or Renpy engine get angry if conditionals were included in a Trait?

If it matters, I was originally thinking of situations where a trait indicates action XYZ hurts and so applies some penalty to it, but it occurs to be that a Masochist girl might see that as a benefit not a downside and could instead get a bonus.

That then led me to wondering about something like a "living stereotype" trait or whatever where the girl isn't just a pervert/princess/bimbo, she's the pervert/princess/bimbo or whatnot with the specific effect varying by personality or some other variable. But I assume the code would have to be designed to handle that kind of input and probably isn't?


Vaan

#70
Hi guys, does anyone know if there are any good Ai out there that will help write events for BK? I honestly couldn't do much by myself and i kind of gave up. Played around and did a few simple ones like making the screen fade or adding a sound, but nothing to do with what i originally wanted haha. I tried ChatGPT, but it feels restricted, it might be able to help someone with more advanced renpy knowledge, but didn't do much for me. It can point you in the right direction, but not actually help with writing. An Ai that can possibly scan the code you give it and try to create something for you based on that code, while you edit the code after as you see fit. I feel like i will give it a second try, since i have so many ideas! But wondered if there is a simpler (and faster) way to do it.

Vaan

#71
Perhaps i came back wiser! Happy to share that my first ever (small and basic) event is finished. My ideas might not always align with the story Goldo is going for, but hopefully a lot of them will. Hopefully will bring something more complex in a week. One of my ideas will be to have an event where if a girl reaches love or fear =100 and MC is good, not neutral or evil, he will be able to release her from slavery and she will join the brothel as a normal worker. Obviously, it won't be easy for me to implement such a permanent and complex event into the story, but hopefully while i do these small ones, in time i will be able to do more complex ones that will change the story to an extend. I don't plan on touching the main story, just the stories that involve the brothel girls. Please find my first ever event below, ha!

I do have one question, will my event randomly play with the other ones or will i have to add it into the game somehow?

label vaan_start:


    $ renpy.show_screen("show_img", brothel.pic, _layer = "master")
    with fade

"That night i couldn't sleep, so i got up and walked around our brothel for a bit."


$ able_girls = [g for g in MC.girls if not (g.away or g.hurt or g.exhausted)]

if able_girls:
    $ girl = rand_choice(able_girls)
    show screen show_event(girl.get_pic("profile"), x=config.screen_width, y=int(config.screen_height*0.7))

    girl.char "Hello [MC.name], do you mind if i call you that sometimes?"
    with fade



    if girl.love < 25:

        girl.char "Not that it matters to me what i call you!"
    elif girl.love > 25:

        girl.char "It will make me happy if i can call you something other than master!"
    menu:
        extend""


        "Yes":
            if girl.love < 25:
                girl.char "Thank you!"
            elif girl.love > 25:
                girl.char "I knew it wouldn't be a problem for you! You're always so kind to me!"

        "No":
            if girl.love < 25:

                girl.char "I hate you!"
            elif girl.love > 25:

                girl.char "Awww, i guess i'll keep calling you Master then"
            if girl.is_("dom"):
                girl.char "Have it your way, for now!"


Vaan

#72
Created another one. Based it on the consitution event it's a mix from that and one of the city challenges, can't believe it actually worked. Not fully finished, but playable (works for me at least), plan to add various choices and outcomes, but will have to wait until next week. Have to figure out a way to properly get a girl's defense points into the challenges too. Once that's done, i want to find a way to make a girl's defence determine various outcomes in challenges as a "bonus". The idea being that the MC has taken one of the girls with him to the city and she will offer "bonus" support in challenge rows, depending on what her defense points are. Anyway this is what i came up with, it works for me, but you guys will probably want something more efficient

label girl_fight():
$ able_girls = [g for g in MC.girls if not (g.away or g.hurt or g.exhausted)]

if able_girls:
    $ girl = rand_choice(able_girls)
    $ ev_type = rand_choice(["constitution"])
    $ stat = girl.get_stat(ev_type)

    if stat >= 25:



        if ev_type == "constitution" and girl.energy >= 25:

            $ renpy.show_screen("show_img", brothel.pic, _layer = "master")
            with fade

            "You hear noise outside, only to find one of the girls trying to learn to fight. It's [girl.fullname]"
            show screen show_event(girl.get_pic("Profile", naked_filter=True, soft=True), x=config.screen_width, y=int(config.screen_height*0.7), bg=None)
            with dissolve
            show screen show_event(girl.get_pic("constitution", "fight", naked_filter=True, soft=True), x=config.screen_width, y=int(config.screen_height*0.7), bg=None)


            you "That's very good. You think you would be able to take me on?"





    if girl.is_("dom"):

         girl.char "You don't stand a chance against me. Leave before i beat you"

    else:

     girl.char "I am not sure, but i will give it my all!"





show screen show_event(girl.get_pic("constitution", "fight", naked_filter=True, soft=True), x=config.screen_width, y=int(config.screen_height*0.7), bg=None)
with dissolve

$ girl_def = 4 + girl.get_defense()
$ tt = show_tt("top_right")
$ chal = renpy.call_screen("challenge_menu", challenges=[("Fight her", "fight", girl_def), ("Restrict her movement", "control", girl_def)], cancel=("Give up", False))
hide screen tool
if chal == "fight":

     $ renpy.block_rollback()


call challenge(chal, district.rank+2) from _call_challenge_70 # result is stored in the _return variable
$ r = _return
if r < 0:
     you "Looks like i win, better luck next time! You have to train a lot harder to beat someone like me!"



elif r <= 2:

     girl.char "Looks like you were no match for me!"

return

neronero

#73
Quote from: Vaan on Nov 02, 2023, 08:59 PMHi guys, does anyone know if there are any good Ai out there that will help write events for BK? I honestly couldn't do much by myself and i kind of gave up. Played around and did a few simple ones like making the screen fade or adding a sound, but nothing to do with what i originally wanted haha. I tried ChatGPT, but it feels restricted, it might be able to help someone with more advanced renpy knowledge, but didn't do much for me. It can point you in the right direction, but not actually help with writing. An Ai that can possibly scan the code you give it and try to create something for you based on that code, while you edit the code after as you see fit. I feel like i will give it a second try, since i have so many ideas! But wondered if there is a simpler (and faster) way to do it.
Most AI's can help you with Python programming, but they don't seem very familiar with Ren'Py and they're oblivious about Brothel King's own custom labels and functions.

I do like to use language models to write lots of unique responses for all girl personalities, using BK's dialogue system. Having more variety there will add some replay value to the events. Take the following exchange as an example:

add_dialogue("girl spars with MC", ("generic"), "I am not sure, but i will give it my all!")
add_dialogue("girl spars with MC", ("very dom"), "Hah! You don't stand a chance against me. Leave before i beat you.")
add_dialogue("girl spars with MC", ("rebel"), "Finally! I've been waiting for an excuse to kick your ass.")
add_dialogue("girl spars with MC", ("meek"), "*whimper* P-Please don't hurt me, Master.")
(...etc, you could make a long list with all personalities)

you "That's very good. You think you would be able to take me on?"

call dialogue(girl, "girl spars with MC")

The game automatically picks a fitting response for the girl with the label "girl spars with MC". You can add as many responses as you like. If there are multiple valid options (eg: A "rebel" girl is also "very dom"), then it'll randomly pick a response from the suitable dialogue lines. And AI can be super helpful for adding lots of variety there... As long as you have a working jailbreak to negate the AI's content policies.


I think ((but I could be wrong)) it's theoretically possible to train/finetune our own language model based on Brothel King's codebase, to specifically help with Ren'Py code & events. But it requires some programming expertise and hasn't been attempted yet.
My Girl Packs: [ link ] - Trait King mod: [ link ]

Vaan

Thank you, will give it a try. I saw the dialogue system file, but honestly didn't know what it was used for. But now i think i get how to use it after writing a few events, so will give it a try!