HentHighSchool Development Forum

Game Development => Brothel King => Topic started by: darthdestroyeis on Jul 03, 2022, 08:30 PM

Title: Modding Question
Post by: darthdestroyeis on Jul 03, 2022, 08:30 PM
Over time, I've been working on some UI sizing / location overhauls to make the game better fit a 1080p / 1440p screen. To do this though, I have to update multiple game files, which get wiped out every time a new update is posted. I would like to make my changes available to the community, but don't want to have to redo it every time an update drops. To this effect, is there any way to turn these changes into a mod, so that I don't have to redo these changes any time a new game update drops?

Example of Original layout vs Updated

Original: https://i.ibb.co/8P0wWHK/Og-Ui-Example.png (https://i.ibb.co/8P0wWHK/Og-Ui-Example.png)
Updated: https://i.ibb.co/1f44cyh/Updated-Ui-Example.png (https://i.ibb.co/1f44cyh/Updated-Ui-Example.png)
Title: Re: Modding Question
Post by: Leortha on Jul 03, 2022, 11:35 PM
Those two image links point to the same place.
Title: Re: Modding Question
Post by: darthdestroyeis on Jul 04, 2022, 12:22 AM
@Leortha should be fixed now. Thanks!
Title: Re: Modding Question
Post by: DougTheC on Jul 04, 2022, 07:15 AM
Quote from: darthdestroyeis on Jul 03, 2022, 08:30 PMOver time, I've been working on some UI sizing / location overhauls to make the game better fit a 1080p / 1440p screen. To do this though, I have to update multiple game files, which get wiped out every time a new update is posted. I would like to make my changes available to the community, but don't want to have to redo it every time an update drops. To this effect, is there any way to turn these changes into a mod, so that I don't have to redo these changes any time a new game update drops?

Example of Original layout vs Updated

Original: https://i.ibb.co/8P0wWHK/Og-Ui-Example.png (https://i.ibb.co/8P0wWHK/Og-Ui-Example.png)
Updated: https://i.ibb.co/1f44cyh/Updated-Ui-Example.png (https://i.ibb.co/1f44cyh/Updated-Ui-Example.png)

You may be able to get your effect by adding an entirely new .rpy file, and putting in your changes in a block with a larger init value. Won't be able to do things like redefine labels or functions.

You could even try using the same init value in an added file alphabetically after changed file, like "original_filename_a_MyMod.rpy" after  "original_filename.rpy". More risky, but maybe necessary if other files use variables at same init level.

Then copy this file into any new release/patch, revising if needed.
Title: Re: Modding Question
Post by: neronero on Jul 04, 2022, 09:01 AM
Better widescreen support sounds like a great addition to the game which Goldo is also eager to implement.

For the short term, more patches are very unlikely:
Quote from: Goldo on Jul 01, 2022, 05:11 PMThis is the last 0.2 patch, for real - next up will be the test version for 0.3 (still some time away).

For version 0.3 and beyond, best to share your changes with Goldo so he can (hopefully) incorporate them directly into the game.
Title: Re: Modding Question
Post by: Goldo on Jul 05, 2022, 04:59 PM
Yes, neronero is right, I'm all for including them in vanilla. Although I would like to point out that in the past some people have suggested changes that fit their particular screen but didn't scale properly to other resolutions. So it will require some testing to make sure the changes are robust, but if it is the case, it could be added to 0.3.
Title: Re: Modding Question
Post by: darthdestroyeis on Jul 06, 2022, 03:04 AM
Sounds good Goldo. I usually work towards 1080p sizing since that's most common these days. Will work on porting my adjustments over to the newer files and will send em to ya once I have a few UI sections done
Title: Re: Modding Question
Post by: Goldo on Jul 08, 2022, 03:16 PM
Quote from: darthdestroyeis on Jul 06, 2022, 03:04 AMSounds good Goldo. I usually work towards 1080p sizing since that's most common these days. Will work on porting my adjustments over to the newer files and will send em to ya once I have a few UI sections done

Thank you. If possible try to comment your changes (or the beginning/end of sections you change), so that I can more easily identify them.
Title: Re: Modding Question
Post by: Yasaki74 on Oct 04, 2023, 12:16 PM
Quote from: Goldo on Jul 08, 2022, 03:16 PM
Quote from: darthdestroyeis on Jul 06, 2022, 03:04 AMSounds good Goldo. I usually work towards 1080p sizing since that's most common these days. Will work on porting my adjustments over to the newer files and will send em to ya once I have a few UI sections done

Thank you. If possible try to comment your changes (or the beginning/end of sections you change), so that I can more easily identify them.
self.MC_relationship_level = 0 # 0: stranger, 1: friend, 2: love interest, 3: girlfriend, 4: lover, 5: job offerImma do what's called a pro gamer move
self.MC_relationship_level = 0 # 0: stranger, 1: friend, 2: love interest, 3: girlfriend, 4: lover, 5: job offer, 6: Marriage
Title: Re: Modding Question
Post by: AlolanNinetales on Dec 20, 2023, 10:18 AM
Idk if this is the write place to ask this but I have been changing the images in the BrothelKing>game>events to images that I prefer and obviously keeping the original names of the images. However sometimes the images do not show up properly and i will get the "image not found" error image. For example, postergirls1.jpg was changed to an image that I preferred but now only pops up as that error image. But, other images like treasure_pink(1).jpg was changed and does work properly. Anyone know how to fix?
Title: Re: Modding Question
Post by: Goldo on Dec 21, 2023, 03:23 PM
Quote from: AlolanNinetales on Dec 20, 2023, 10:18 AMIdk if this is the write place to ask this but I have been changing the images in the BrothelKing>game>events to images that I prefer and obviously keeping the original names of the images. However sometimes the images do not show up properly and i will get the "image not found" error image. For example, postergirls1.jpg was changed to an image that I preferred but now only pops up as that error image. But, other images like treasure_pink(1).jpg was changed and does work properly. Anyone know how to fix?

Hello, the proper way to do this is to edit BKsettings.rpy around line 375 and add/remove the picture names you want or don't want. You will see there that the game expects 'poster girls1.jpg' and not 'postergirls1.jpg'.
Title: Re: Modding Question
Post by: AlolanNinetales on Dec 22, 2023, 07:07 AM
Quote from: Goldo on Dec 21, 2023, 03:23 PM
Quote from: AlolanNinetales on Dec 20, 2023, 10:18 AMIdk if this is the write place to ask this but I have been changing the images in the BrothelKing>game>events to images that I prefer and obviously keeping the original names of the images. However sometimes the images do not show up properly and i will get the "image not found" error image. For example, postergirls1.jpg was changed to an image that I preferred but now only pops up as that error image. But, other images like treasure_pink(1).jpg was changed and does work properly. Anyone know how to fix?
Thank you! sorry am kinda new to all of this. Also is there anyway to change the code a little to basically that there is more than one harem.jpg pictures displayed? for example in my events folder I would have harem1.jpg, harem2.jpg harem3.jpg and it would rotate between all of those  pictures after every night service.

Hello, the proper way to do this is to edit BKsettings.rpy around line 375 and add/remove the picture names you want or don't want. You will see there that the game expects 'poster girls1.jpg' and not 'postergirls1.jpg'.
Title: Re: Modding Question
Post by: Goldo on Dec 22, 2023, 10:46 AM
Quote from: AlolanNinetales on Dec 22, 2023, 07:07 AMThank you! sorry am kinda new to all of this. Also is there anyway to change the code a little to basically that there is more than one harem.jpg pictures displayed? for example in my events folder I would have harem1.jpg, harem2.jpg harem3.jpg and it would rotate between all of those  pictures after every night service.

Sure. Look for this line in BKsettings.rpy and edit it:
    no_girls_pics = ["harem.webp",]
Title: Re: Modding Question
Post by: Yasaki74 on Jan 27, 2024, 03:48 PM
@Goldo
screen show_event(event_pic, x = None, y = None, proportional = True, bg = c_ui_darkblue, ys = 0.8): # event_pic MUST be an object

    tag show_screen

    if event_pic:
        on "show" action Function(unlock_pic, event_pic.path) # This is how the game tracks that this particular picture has been seen.

    if x:
        $ x = xres(x)
    if y:
        $ y = yres(y)

    zorder 0

    frame:
        background bg
        xalign 0.0
        yalign 0.0
        xsize x
        ysize y
        xmargin 0
        ymargin 0
        xpadding 0
        ypadding 0
        xfill True
        yfill True

        if event_pic:
            add event_pic.get(x, y, proportional) xalign 0.5 yalign 0.0

            if debug_mode:
                frame background c_ui_dark:
                    has vbox
                    text "Attempt: " + str(game.last_pic["attempts"]) size res_font(14)
                    text "Search tags: " + and_text(game.last_pic["tags"]) size res_font(14)
                    text "AND tags: " + and_text(game.last_pic["and_tags"]) size res_font(14)
                    text "AND NOT tags: " + and_text(game.last_pic["not_tags"]) size res_font(14)
I did find a way to create another custom_label *yay*, though I was kinda curious about this code, I don't know where's the event_pic come from, I can't seem to find it anywhere. I found it through visual studio going from functions to BKinteractions to BKscreens and that's where I'm stucked
my goal here was to display different images using the tags and idk if this could be modify in some way?
Title: Re: Modding Question
Post by: Yasaki74 on Jan 28, 2024, 03:41 PM
https://imgur.com/tACH7tE
ok I've found where the image come from I think? though idk how this part work, would you mind explaining this part to me?
I was hoping to change the girl profile when a girl change clothing

no need to explain the farm or slave market part but maybe the free part :3
Title: Re: Modding Question
Post by: Goldo on Feb 02, 2024, 09:02 AM
Quote from: Yasaki74 on Jan 28, 2024, 03:41 PMhttps://imgur.com/tACH7tE
ok I've found where the image come from I think? though idk how this part work, would you mind explaining this part to me?
I was hoping to change the girl profile when a girl change clothing

no need to explain the farm or slave market part but maybe the free part :3

I'm sorry but can you recap your original question? Even looking through your comments' history I couldn't quite figure it out.

profile is an attribute of the Girl class, if you want to implement a clothing system your best bet is to change the girl.profile picture every time there is a change of clothes.
Title: Re: Modding Question
Post by: nneezz on Apr 18, 2024, 05:06 PM
I tried to bump up the game resolution to 2048 and found that the side image overlaps the text. Anyone know how to fix this?

Spoiler
(https://i.ibb.co/QC0Nwp8/test.jpg) (https://ibb.co/9VPT5cw)
[close]
Title: Re: Modding Question
Post by: Goldo on Apr 22, 2024, 03:22 PM
Quote from: nneezz on Apr 18, 2024, 05:06 PMI tried to bump up the game resolution to 2048 and found that the side image overlaps the text. Anyone know how to fix this?

Spoiler
(https://i.ibb.co/QC0Nwp8/test.jpg) (https://ibb.co/9VPT5cw)
[close]

You need to fiddle with the 'Say' screen in screens.rpy, looking around these lines:
    # If there's a side image, display it above the text.

    if side_image: # This is for Girl.char objects
        fixed xsize res_portrait_size ysize res_portrait_size xalign 0.0 yalign 1.0:
            add side_image xalign 0.5 yalign 0.0

    else:
        add SideImage() xalign 0.0 yalign 1.0

This will take a bit of Ren'py knowledge. Nevertheless, it's unlikely to be your only problem at such a large resolution, so you should be prepared to do a bit more customization of screens if you want to keep it up.
Title: Re: Modding Question
Post by: nneezz on Apr 24, 2024, 12:50 AM
Quote from: Goldo on Apr 22, 2024, 03:22 PMYou need to fiddle with the 'Say' screen in screens.rpy, looking around these lines:

Thank you, Goldo. I looked in to that but can only change the side image not the area around it so I ended up with changing the dialogue box margin instead (options.rpy -> style.window.left_margin). Not the best workaround but the game is playable.

It turned out 2048 is not even enough so I went with 3072 ;D. Surprisingly just changing xres yres function and the base resolution the game adjusted its size really well. I'd say like 80% of the original stuff is zoomed correctly. Hopefully there'll be a resolution selector in the next version.
Title: Re: Modding Question
Post by: Goldo on Apr 24, 2024, 09:29 PM
Quote from: nneezz on Apr 24, 2024, 12:50 AM
Quote from: Goldo on Apr 22, 2024, 03:22 PMYou need to fiddle with the 'Say' screen in screens.rpy, looking around these lines:

Thank you, Goldo. I looked in to that but can only change the side image not the area around it so I ended up with changing the dialogue box margin instead (options.rpy -> style.window.left_margin). Not the best workaround but the game is playable.

It turned out 2048 is not even enough so I went with 3072 ;D. Surprisingly just changing xres yres function and the base resolution the game adjusted its size really well. I'd say like 80% of the original stuff is zoomed correctly. Hopefully there'll be a resolution selector in the next version.

If you can make a side list of other screens and windows that do not display correctly at higher resolutions as you go, that would be helpful for me to iron things out in the next version.
Title: Re: Modding Question
Post by: nneezz on Apr 26, 2024, 08:02 AM
Sure. I'll try to fix them as I play too.