News:

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

Former www.henthighschool.com

[Resources] Trait King mod

Started by neronero, May 16, 2022, 08:26 PM

Previous topic - Next topic

vadi92

Quote from: smashpatty on Jul 05, 2024, 07:58 PMOn a fresh game, after installing the mod, i go to the "?" section and click on "[traitking] activate "

. Then i get this error.

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/BKmain.rpy", line 955, in script call
    $ result = ui.interact()
  File "game/BKhelp.rpy", line 61, in script call
    call expression target_label from _call_expression
  File "game/Mods/Trait King/Trait King.rpy", line 1514, in script
    if traitking_activated == True:
  File "game/Mods/Trait King/Trait King.rpy", line 1514, in <module>
    if traitking_activated == True:
NameError: name 'traitking_activated' is not defined

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

Full traceback:
  File "game/BKmain.rpy", line 955, in script call
    $ result = ui.interact()
  File "game/BKhelp.rpy", line 61, in script call
    call expression target_label from _call_expression
  File "game/Mods/Trait King/Trait King.rpy", line 1514, in script
    if traitking_activated == True:
  File "renpy/ast.py", line 1898, in execute
    if renpy.python.py_eval(condition):
  File "renpy/python.py", line 2276, in py_eval
    return py_eval_bytecode(code, globals, locals)
  File "renpy/python.py", line 2269, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "game/Mods/Trait King/Trait King.rpy", line 1514, in <module>
    if traitking_activated == True:
NameError: name 'traitking_activated' is not defined

Windows-10-10.0.22621
Ren'Py 7.4.11.2266
Brothel King 0.2 v220711
Sat Jul  6 01:25:33 2024

Should i click on the activate option or is it automatically activated ?

the trait king mod i have is "Traitking_0.21" , I downloaded it from this forum.


Also kings way mod works perfectly for me , are both the same ? as i have the option to add traits using kings way mod.
My reply on F95.

That line whats causing you the error is just an experiment on @neronero part from way back then (when the old forum was still active). But it was completly forgotten since nobody cared about it.

Goldo

I forgot where I was having that discussion a while ago but I might as well put it here: after going back and forth with a few solutions to the problem of adding traits in BK from mods or girlpacks, I have come up with a set-up I like in the upcoming test version.

Basically it will add a 'register_trait()' function that can be called at any time (init or in-game) and add or update a trait. And a new attribute will be added to the Trait class called 'public', which when set to True (by default) will mean that all girls can randomly get this trait, and if False, it will only be available through _BK.ini or hard-coding.

This should make adding new traits a lot easier for girlpack makers and modders. Cheers.
Maker of BK. Looking for the latest patch for BK 0.2? The link doesn't change, so bookmark it!

YUprime

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/BKmain.rpy", line 116, in script
    $ result = ui.interact()
  File "game/BKmain.rpy", line 116, in <module>
    $ result = ui.interact()
  File "game/BKscreens.rpy", line 451, in execute
    screen girls(girls, context = "girls"): # context can be girls, slavemarket, farm
  File "game/BKscreens.rpy", line 451, in execute
    screen girls(girls, context = "girls"): # context can be girls, slavemarket, farm
  File "game/BKscreens.rpy", line 467, in execute
    if hovered_girl and hovered_girl in girls:
  File "game/BKscreens.rpy", line 468, in execute
    use girl_stats(hovered_girl, context=context)
  File "game/BKscreens.rpy", line 1417, in execute
    screen girl_stats(girl, context = "girls"): # context can be girls, slavemarket, farm, free, postings, contracts, capture, powers
  File "game/BKscreens.rpy", line 1417, in execute
    screen girl_stats(girl, context = "girls"): # context can be girls, slavemarket, farm, free, postings, contracts, capture, powers
  File "game/BKscreens.rpy", line 1423, in execute
    if girl:
  File "game/BKscreens.rpy", line 1424, in execute
    frame:
  File "game/BKscreens.rpy", line 1440, in execute
    vbox:
  File "game/BKscreens.rpy", line 1898, in execute
    viewport:
  File "game/BKscreens.rpy", line 1907, in execute
    if context != "free" or girl.MC_relationship_level >= 3:
  File "game/BKscreens.rpy", line 1908, in execute
    hbox spacing 0 box_wrap True:
  File "game/BKscreens.rpy", line 1909, in execute
    for trait in girl.traits:
  File "game/BKscreens.rpy", line 1913, in execute
    textbutton trait_name_dict[trait.name]:
  File "game/BKscreens.rpy", line 1913, in <module>
    textbutton trait_name_dict[trait.name]:
KeyError: 'Mind Fucked'

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

Full traceback:
  File "game/BKmain.rpy", line 116, in script
    $ result = ui.interact()
  File "E:\BaiduNetdisk\Brothel_King-pc3.0\renpy\ast.py", line 1138, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "E:\BaiduNetdisk\Brothel_King-pc3.0\renpy\python.py", line 1122, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "game/BKmain.rpy", line 116, in <module>
    $ result = ui.interact()
  File "E:\BaiduNetdisk\Brothel_King-pc3.0\renpy\ui.py", line 299, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "E:\BaiduNetdisk\Brothel_King-pc3.0\renpy\display\core.py", line 3579, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, pause_modal=pause_modal, **kwargs) # type: ignore
  File "E:\BaiduNetdisk\Brothel_King-pc3.0\renpy\display\core.py", line 4052, in interact_core
    root_widget.visit_all(lambda d : d.per_interact())
  File "E:\BaiduNetdisk\Brothel_King-pc3.0\renpy\display\core.py", line 681, in visit_all
    d.visit_all(callback, seen)
  File "E:\BaiduNetdisk\Brothel_King-pc3.0\renpy\display\core.py", line 681, in visit_all
    d.visit_all(callback, seen)
  File "E:\BaiduNetdisk\Brothel_King-pc3.0\renpy\display\core.py", line 681, in visit_all
    d.visit_all(callback, seen)
  File "E:\BaiduNetdisk\Brothel_King-pc3.0\renpy\display\screen.py", line 476, in visit_all
    callback(self)
  File "E:\BaiduNetdisk\Brothel_King-pc3.0\renpy\display\core.py", line 4052, in <lambda>
    root_widget.visit_all(lambda d : d.per_interact())
  File "E:\BaiduNetdisk\Brothel_King-pc3.0\renpy\display\screen.py", line 487, in per_interact
    self.update()
  File "E:\BaiduNetdisk\Brothel_King-pc3.0\renpy\display\screen.py", line 680, in update
    self.screen.function(**self.scope)
  File "game/BKscreens.rpy", line 451, in execute
    screen girls(girls, context = "girls"): # context can be girls, slavemarket, farm
  File "game/BKscreens.rpy", line 451, in execute
    screen girls(girls, context = "girls"): # context can be girls, slavemarket, farm
  File "game/BKscreens.rpy", line 467, in execute
    if hovered_girl and hovered_girl in girls:
  File "game/BKscreens.rpy", line 468, in execute
    use girl_stats(hovered_girl, context=context)
  File "game/BKscreens.rpy", line 1417, in execute
    screen girl_stats(girl, context = "girls"): # context can be girls, slavemarket, farm, free, postings, contracts, capture, powers
  File "game/BKscreens.rpy", line 1417, in execute
    screen girl_stats(girl, context = "girls"): # context can be girls, slavemarket, farm, free, postings, contracts, capture, powers
  File "game/BKscreens.rpy", line 1423, in execute
    if girl:
  File "game/BKscreens.rpy", line 1424, in execute
    frame:
  File "game/BKscreens.rpy", line 1440, in execute
    vbox:
  File "game/BKscreens.rpy", line 1898, in execute
    viewport:
  File "game/BKscreens.rpy", line 1907, in execute
    if context != "free" or girl.MC_relationship_level >= 3:
  File "game/BKscreens.rpy", line 1908, in execute
    hbox spacing 0 box_wrap True:
  File "game/BKscreens.rpy", line 1909, in execute
    for trait in girl.traits:
  File "game/BKscreens.rpy", line 1913, in execute
    textbutton trait_name_dict[trait.name]:
  File "game/BKscreens.rpy", line 1913, in <module>
    textbutton trait_name_dict[trait.name]:
KeyError: 'Mind Fucked'

Windows-10-10.0.19041 AMD64
Ren'Py 8.1.1.23060707
Brothel King 0.3t v230923
Wed Jul 17 17:00:30 2024

when i in market to see a girl that happened,about 2/3 girls lead to this bug,and the rest can be buy normally

Jman

I suspect the rest don't have TK-exclusive traits.

Is TK actually active (console 'traitking_activated' without the quotes)? Have you activated it more than once?
And with strange aeons even death may die...

DarkFire

I have this error on game start with the new version:

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/Mods/Trait King/Trait King.rpy", line 373, in script
    python:
  File "game/Mods/Trait King/Trait King.rpy", line 1500, in <module>
    refresh_available_locations()
  File "game/BKfunctions.rpy", line 571, in refresh_available_locations
    loc_list = game.get_available_locations()
  File "game/BKclasses.rpy", line 290, in get_available_locations
    if d.rank <= district.rank:
NameError: name 'district' is not defined

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

Full traceback:
  File "game/Mods/Trait King/Trait King.rpy", line 373, in script
    python:
  File "C:\Users\Dani\Desktop\Juegos\Brothel_King-0.3t\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:\Users\Dani\Desktop\Juegos\Brothel_King-0.3t\Brothel_King-pc\renpy\python.py", line 1178, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "game/Mods/Trait King/Trait King.rpy", line 1500, in <module>
    refresh_available_locations()
  File "game/BKfunctions.rpy", line 571, in refresh_available_locations
    loc_list = game.get_available_locations()
  File "game/BKclasses.rpy", line 290, in get_available_locations
    if d.rank <= district.rank:
NameError: name 'district' is not defined

Windows-10-10.0.19045 AMD64
Ren'Py 8.2.0.24012702
Bro King 0.3t v240825
Tue Aug 27 00:18:24 2024

neroneroTopic starter

#80
Quote from: neronero on May 16, 2022, 08:26 PM[ Download ] (for BK 0.3 Gameplay Test)
Updated link here for new version of BK 0.3t
This is just a small fix to make the old version work. Hopefully nothing else is broken ;D

NOTE: I've decided to move TKevents.rpy to the mod folder: "game/Mods/Trait King/".
If you've tried running an older version of Trait King on the new release of 0.3t, remember to remove TKevents.rpy and TKevents.rpyc from the "game" folder.


edit: scratch that, old version should work now after the latest patch for BK 0.3t :P

I'll try to work towards a new version with more significant updates soon-ish.
My Girl Packs: [ link ] - Trait King mod: [ link ]

PANDA129

So if I want CN translation-version work , just add the dictionary in the same place? Or add them in a new place?

Can I test it in the old version?(last version before 2024-8-24 ) New mod fits it?

Wish I can share your holy light to CN lands! 8)

neroneroTopic starter

Quote from: PANDA129 on Aug 28, 2024, 04:50 PMSo if I want CN translation-version work , just add the dictionary in the same place? Or add them in a new place?

Can I test it in the old version?(last version before 2024-8-24 ) New mod fits it?

Wish I can share your holy light to CN lands! 8)
Yes the 0.3 version will also work on the previous test release.

A few things to keep in mind:

- When translating the base_description of traits, keep in mind that this sentence may be used in dialogues during events. Eg: "You want to know what's special about this girl? Well... [trait.base_description]"
- Most negative traits can evolve, so if you change their name in traitking_neg_traits, you must also make that change in traitking_neg_evolved and traitking_neg_evolved_desc
- Same with TKevents.rpy, it contains references to trait names that should change along with the actual traits.

Other than that it's just a matter of translating lots of dialogue strings I think.
My Girl Packs: [ link ] - Trait King mod: [ link ]

asdf

#83
For BK v0.3t:
I'm sorry if this is already a known/addressed issue, but I'm finding that the first week's girls get generated before the Trait King mod gets activated when starting a new game (so this appears to only be a problem for the first week though). Behaviours of note:

  • On starting a new game, girls with Trait King original traits in their "_BK.ini" cause the error message (no crash):
    Error parsing girls/<name>/_BK.ini
    <Original trait> is not a valid trait.
    Check the correct use of brackets and quotes.
    when starting a new game. I had used the `_BK.ini` files without issue with BK v0.2 + Trait King mod.
  • Week 1 girls' traits are missing their base descriptions when you hover over them in the Slave Market
  • Week 1 girls don't have any original traits - even if they're specified as "always" and using "keep_traits = True" in their "_BK.ini"

I was wondering if I might have just touched something wrong, or if it's a repeatable error for other people as well.

Jman

#84
I think it's a side effect of Goldo moving mod init past basic game init, since that was a little bit unfriendly to other mods. Before that, the new 0.3t allowed neronero to dispense with girl regeneration, but since now girls are generated after TK initialises, 'day 1' girls need to be changed out again.


Not sure what can be done about TK traits specified in the .ini, though. Without Goldo reshuffling or otherwise fool-proofing game init again, that is.
And with strange aeons even death may die...

Minxin

您好,这边是目前0.3t汉化团队的成员之一。
之前成员提到过想汉化Trait King这个MOD。
目前我们把模组文件里会出现的文本都添加上了__()以及_()。
所有出现的文本,包括特质的描述都使用了__()。
特质名称则使用使用了_()。
并且测试能正常翻译。

我们这边想把修改过后的文件提供给您。
以便日后您模组更新之后,我们不用做太多修改能够继续沿用中文汉化。 :D


Hello, this is one of the members of the current 0.3t Chineseization team.
One of the members previously mentioned wanting to Chineseize the Trait King mod.
Currently we have added __() as well as _() to all the text that will appear in the mod file.
All occurrences of text, including descriptions of traits, use __().
Trait names use _().
And the test translates properly.

We would like to provide you the modified file.
So that when you update your module later, we don't need to do too much modification to continue to use the Chinese localization. :D


这是我们修改过的MOD。
This is our modified mod.
https://mega.nz/file/lZBSiLKY#pbdkFNTqwJfQRxvAfSTl3xuHewWdLoIeZIKaYvMM4Gs


这是我们用修改过的MOD生成的翻译文件。
This is the translation file we generated with the modified mod.
https://mega.nz/file/JURGnZAb#c3YTGll8dsnao0UoarEJNrGG6S-p5Wy0aI6ycuXhGds
《青楼之王》以及《标签工具》的中文翻译: https://github.com/XyMinxin/Brothel-King-Chinese-Translate

neroneroTopic starter

#86
Quote from: asdf on Sep 07, 2024, 12:32 PMFor BK v0.3t:
I'm sorry if this is already a known/addressed issue, but I'm finding that the first week's girls get generated before the Trait King mod gets activated when starting a new game (so this appears to only be a problem for the first week though). Behaviours of note:
I briefly posted a new version (v0.22) for BK 0.3t here because the load order of mods changed, and refreshing the girls week 1 was no longer required in that version. But in the current version of BK 0.3t, the load order changed some more and now the old version works as intended again. So if you currently want to try Trait King, you need to go back to the v0.21 version if you downloaded the v0.22 version.

[ Download ] (for BK 0.3 Gameplay Test)

Sorry for the confusion  ;D
v0.22 was only posted here for a few minutes before I noticed that a new BK 0.3t patch made it obsolete, so I didn't think a lot of people would be affected.

edit: I see my mistake now, I edited the update post, but the first post was still linking to 0.22 T__T

Quote from: Minxin on Sep 07, 2024, 05:52 PMWe would like to provide you the modified file.
So that when you update your module later, we don't need to do too much modification to continue to use the Chinese localization. :D
Thanks! I'll make sure to add the translation brackets to future versions.
My Girl Packs: [ link ] - Trait King mod: [ link ]

Jman

#87
TK-specific traits still spam you with error messages for at startup. Probably something only Goldo can fix, though.
And with strange aeons even death may die...

Goldo

Quote from: Jman on Sep 08, 2024, 06:11 PMTK-specific traits still spam you with error messages for at startup. Probably something only Goldo can fix, though.

Possible solutions include:
- Moving mod init back up in the load order: Almost guaranteed to cause other issues, and I'm not even sure it's desirable since having mods trigger before calendar updates will remove some freedom to alter things from mods.
- Adding specific hooks for TK: Seems like a band-aid and will not work for other mods affecting traits.
- Disabling checks on trait names entirely: Risky since before I implemented this, it was a common source of errors.
- Postpone checks on trait names until after mods are initiated: Annoying to implement but seems like the best course of action.

I'm thinking of other solutions (maybe I should allow mods to set-up a function that runs early?), so I'll sit on it for a few days. Thoughts welcome.
Maker of BK. Looking for the latest patch for BK 0.2? The link doesn't change, so bookmark it!

Jman

A special mod function for early-activation-actions sounds like the most general solution.
And with strange aeons even death may die...