Hey Stella! Reiterating the question from the Discord, how would I go about implementing Smart Barks for a character whose character key is a variable? Thanks in advance!
So there's a few approaches I would consider here:
Approach 1: Duplicate the dictionary for the character and the aliases the character has. This is lazy, but as long as none of the aliases overlap with other characters, (eg. Multiple people with a name that is exactly "???") it will work.
Approach 2: If the character name is an input, if the name variable is created before the dictionary, it should be usable as the key to the dictionary whenever it is called. This is what you'd want to do if you have a situation where the character's name is customizable.
Approach 3: The hard but probably right way: You'd need to extend smart barks by creating a secondary dictionary.
So you'd have 1 dictionary that would be (psuedocode)
A dictionary named nicknames
KEY(The name used)->VALUE(What the character is referred to in the original Smart Barks dictionary)
Fred-> Fred
Frederick - > Fred
Freddy - > Fred
??? -> Fred
Jim -> Jim
James -> Jim
Jimothy -> Jim
Jimbob-> Jim
???? -> Jim
Then you'd need to insert a dictionary lookup into the original smart barks code, so that it references that dictionary, and then sends the value into the original set up. The end result is that whether you use Fred or Frederick or Freddy, it will return Fred instead from the other dictionary. Same for Jim.
I can probably include this functionality in the future, if you're patient. I'm currently absorbed in a number of other projects and planned on coming back to this after May
>Came here with suggestions, see there's a speaker event coming in the summer.
YAY! :D Anyway, a couple suggestions (if they're implementable).
1) Is it possible to add {#nothing} tags as possible keywords? That way we can tie the playing of the sound bite to something that won't show up in the text.
2) Is it possible to have possible keywords include special characters? (Like ?).
Hey there! Until the fund raising is over on the 30th, you can grab it for free via the demo download attached to it. A bit of quirkiness with Itch. The "demo" download isn't actually a demo, it's the full thing. It will have a more normal way of getting it once it's over.
Can I get them to work even when the game is played in different language?
Unfortunately, barks are not being played when trying to play in other languages. For example, the default 'None' language is set to English, but when I try playing the game in Portuguese, barks are not called due to the 'what' value not being in 'None' English. Can it be done so that the ones used for English can be played no matter which translation is used so I don't need to create a different one for each language?
My project is quite big, and I would like to avoid defining all Phrase Keys for every Character in every language.
Hey there! At present, if what is being sent to the text box isn't defined in the dictionary, then it won't play a voice file. The language setting isn't factored in at all, only what is being sent to display. In your case, it's a bit of a double edged sword, as you could use that to implement dubbed lines if you also had different voice actors for different languages, but as you correctly guessed, you would need to define keys for each language.
That said, it's a feature I could add to the list once the next goal is hit.
There seems to be some issues with the code. It conflicts with the Extend command and Side-Images for some reason.
I'm sorry, but an uncaught exception occurred. While running game code: File "game/story/st_00_prologue.rpy", line 29, in script extend "?{w=1.5}" File "game/screens/MVNSB.rpy", line 18, in SB_say if who.name in character_voice_lines: AttributeError: '_Extend' object has no attribute 'name' -- Full Traceback ------------------------------------------------------------ Full traceback: File "game/story/st_00_prologue.rpy", line 29, in script extend "?{w=1.5}" File "F:\renpy-8.3.0-sdkarm\renpy\ast.py", line 2572, in execute Say.execute(self) File "F:\renpy-8.3.0-sdkarm\renpy\ast.py", line 615, in execute renpy.exports.say(who, what, *args, **kwargs) File "game/screens/MVNSB.rpy", line 18, in SB_say if who.name in character_voice_lines: AttributeError: '_Extend' object has no attribute 'name' Windows-10-10.0.19045 AMD64 Ren'Py 8.3.0.24082114 JPDE1 - REFRAIN DEMO_A 1.0 Wed Oct 23 22:17:17 2024
I'm sorry, but an uncaught exception occurred. While running game code: File "game/story/st_00_prologue.rpy", line 70, in script pi_x shock "(So...{w=0.5} So many people...{w=0.5} My stars and garters, I didn't think so many people could be in the same place all at once!)" File "game/screens/MVNSB.rpy", line 35, in SB_say return renpy.store.say(who, what, *args, **kwargs) File "renpy/common/00library.rpy", line 321, in say who(what, interact=interact, *args, **kwargs) Exception: Say has image attributes ('shock',), but there's no image tag associated with the speaking character. -- Full Traceback ------------------------------------------------------------ Full traceback: File "game/story/st_00_prologue.rpy", line 70, in script pi_x shock "(So...{w=0.5} So many people...{w=0.5} My stars and garters, I didn't think so many people could be in the same place all at once!)" File "F:\renpy-8.3.0-sdkarm\renpy\ast.py", line 2572, in execute Say.execute(self) File "F:\renpy-8.3.0-sdkarm\renpy\ast.py", line 615, in execute renpy.exports.say(who, what, *args, **kwargs) File "game/screens/MVNSB.rpy", line 35, in SB_say return renpy.store.say(who, what, *args, **kwargs) File "renpy/common/00library.rpy", line 321, in say who(what, interact=interact, *args, **kwargs) File "F:\renpy-8.3.0-sdkarm\renpy\character.py", line 1389, in __call__ old_attr_state = self.handle_say_attributes(False, interact) File "F:\renpy-8.3.0-sdkarm\renpy\character.py", line 1208, in handle_say_attributes if self.resolve_say_attributes(predicting, attrs): File "F:\renpy-8.3.0-sdkarm\renpy\character.py", line 1134, in resolve_say_attributes raise Exception("Say has image attributes %r, but there's no image tag associated with the speaking character." % (attrs,)) Exception: Say has image attributes ('shock',), but there's no image tag associated with the speaking character. Windows-10-10.0.19045 AMD64 Ren'Py 8.3.0.24082114 JPDE1 - REFRAIN DEMO_A 1.0 Wed Oct 23 22:17:56 2024
← Return to asset pack
Comments
Log in with itch.io to leave a comment.
Hey Stella! Reiterating the question from the Discord, how would I go about implementing Smart Barks for a character whose character key is a variable? Thanks in advance!
So there's a few approaches I would consider here:
Approach 1: Duplicate the dictionary for the character and the aliases the character has. This is lazy, but as long as none of the aliases overlap with other characters, (eg. Multiple people with a name that is exactly "???") it will work.
Approach 2: If the character name is an input, if the name variable is created before the dictionary, it should be usable as the key to the dictionary whenever it is called. This is what you'd want to do if you have a situation where the character's name is customizable.
Approach 3: The hard but probably right way: You'd need to extend smart barks by creating a secondary dictionary.
So you'd have 1 dictionary that would be (psuedocode)
A dictionary named nicknames
KEY(The name used)->VALUE(What the character is referred to in the original Smart Barks dictionary)
Fred-> Fred
Frederick - > Fred
Freddy - > Fred
??? -> Fred
Jim -> Jim
James -> Jim
Jimothy -> Jim
Jimbob-> Jim
???? -> Jim
Then you'd need to insert a dictionary lookup into the original smart barks code, so that it references that dictionary, and then sends the value into the original set up. The end result is that whether you use Fred or Frederick or Freddy, it will return Fred instead from the other dictionary. Same for Jim.
I can probably include this functionality in the future, if you're patient. I'm currently absorbed in a number of other projects and planned on coming back to this after May
>Came here with suggestions, see there's a speaker event coming in the summer.
YAY! :D Anyway, a couple suggestions (if they're implementable).
1) Is it possible to add {#nothing} tags as possible keywords? That way we can tie the playing of the sound bite to something that won't show up in the text.
2) Is it possible to have possible keywords include special characters? (Like ?).
Hi, it says the pack should be free, but it doesn't actually give me an option to download? Is this correct?
Hey there! Until the fund raising is over on the 30th, you can grab it for free via the demo download attached to it. A bit of quirkiness with Itch. The "demo" download isn't actually a demo, it's the full thing. It will have a more normal way of getting it once it's over.
Can I get them to work even when the game is played in different language?
Unfortunately, barks are not being played when trying to play in other languages. For example, the default 'None' language is set to English, but when I try playing the game in Portuguese, barks are not called due to the 'what' value not being in 'None' English. Can it be done so that the ones used for English can be played no matter which translation is used so I don't need to create a different one for each language?
My project is quite big, and I would like to avoid defining all Phrase Keys for every Character in every language.
Hey there! At present, if what is being sent to the text box isn't defined in the dictionary, then it won't play a voice file. The language setting isn't factored in at all, only what is being sent to display. In your case, it's a bit of a double edged sword, as you could use that to implement dubbed lines if you also had different voice actors for different languages, but as you correctly guessed, you would need to define keys for each language.
That said, it's a feature I could add to the list once the next goal is hit.
This looks neat!
There seems to be some issues with the code. It conflicts with the Extend command and Side-Images for some reason.
I'm sorry, but an uncaught exception occurred. While running game code: File "game/story/st_00_prologue.rpy", line 29, in script extend "?{w=1.5}" File "game/screens/MVNSB.rpy", line 18, in SB_say if who.name in character_voice_lines: AttributeError: '_Extend' object has no attribute 'name' -- Full Traceback ------------------------------------------------------------ Full traceback: File "game/story/st_00_prologue.rpy", line 29, in script extend "?{w=1.5}" File "F:\renpy-8.3.0-sdkarm\renpy\ast.py", line 2572, in execute Say.execute(self) File "F:\renpy-8.3.0-sdkarm\renpy\ast.py", line 615, in execute renpy.exports.say(who, what, *args, **kwargs) File "game/screens/MVNSB.rpy", line 18, in SB_say if who.name in character_voice_lines: AttributeError: '_Extend' object has no attribute 'name' Windows-10-10.0.19045 AMD64 Ren'Py 8.3.0.24082114 JPDE1 - REFRAIN DEMO_A 1.0 Wed Oct 23 22:17:17 2024
I'm sorry, but an uncaught exception occurred. While running game code: File "game/story/st_00_prologue.rpy", line 70, in script pi_x shock "(So...{w=0.5} So many people...{w=0.5} My stars and garters, I didn't think so many people could be in the same place all at once!)" File "game/screens/MVNSB.rpy", line 35, in SB_say return renpy.store.say(who, what, *args, **kwargs) File "renpy/common/00library.rpy", line 321, in say who(what, interact=interact, *args, **kwargs) Exception: Say has image attributes ('shock',), but there's no image tag associated with the speaking character. -- Full Traceback ------------------------------------------------------------ Full traceback: File "game/story/st_00_prologue.rpy", line 70, in script pi_x shock "(So...{w=0.5} So many people...{w=0.5} My stars and garters, I didn't think so many people could be in the same place all at once!)" File "F:\renpy-8.3.0-sdkarm\renpy\ast.py", line 2572, in execute Say.execute(self) File "F:\renpy-8.3.0-sdkarm\renpy\ast.py", line 615, in execute renpy.exports.say(who, what, *args, **kwargs) File "game/screens/MVNSB.rpy", line 35, in SB_say return renpy.store.say(who, what, *args, **kwargs) File "renpy/common/00library.rpy", line 321, in say who(what, interact=interact, *args, **kwargs) File "F:\renpy-8.3.0-sdkarm\renpy\character.py", line 1389, in __call__ old_attr_state = self.handle_say_attributes(False, interact) File "F:\renpy-8.3.0-sdkarm\renpy\character.py", line 1208, in handle_say_attributes if self.resolve_say_attributes(predicting, attrs): File "F:\renpy-8.3.0-sdkarm\renpy\character.py", line 1134, in resolve_say_attributes raise Exception("Say has image attributes %r, but there's no image tag associated with the speaking character." % (attrs,)) Exception: Say has image attributes ('shock',), but there's no image tag associated with the speaking character. Windows-10-10.0.19045 AMD64 Ren'Py 8.3.0.24082114 JPDE1 - REFRAIN DEMO_A 1.0 Wed Oct 23 22:17:56 202410/26/24 Edit: This is fixed!
- Extends should now be (properly) supported
- Extend statements will be evaluated for their new content, allowing you to trigger different barks off of subsequent extends.
I'll take a peek at it and see if I can reproduce it. Is it only with extends and side images together?
So far yes. I had another team member help test it and with simple dialogue statements, it's all good, works as intended.
I'm pretty sure I found the issue. If I'm right, I'll get an update out ideally sometime this weekend. Sorry about that, and thanks for filling me in!
Glad to hear it! Happy to have helped.
Should be all fixed up now. The new version is up as of right now. You only need to update your MVNSB.rpy file.
Thank you so much! Can't wait to put it to good use ^^
This is so cool, what the heck? Congrats for releasing the pack!
*barks through keywords* ...oh this is *good*.