Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Absolutely incredible code, thank you very much.

I have one small question/suggestion if you don't mind, though. The current code make characters talk as the text appears on screen, however, some players really like to speed up the text so it appears inmeditely, giving the feeling that the character only move their mouth for an instant.

Is there a way or do you think it would be possible to apply the flapping depending of the number of characters in text instead of the speed the text appears on screen? That way it would always feel as if the player is talking through the entire sentence instead of finishing as soon as the text ends.

Thanks again for the great work and sorry for bothering.

Hi Keinart, your suggestion is very possible. You can measure the character count of the printed dialog line with len(_last_say_what). From there I came up with an approach that supports both the original and your suggestion via a switch that looks at player settings. 

Newly added code is marked in green, blue shows edits.

- New function (you can put it anywhere) is_csp_instant_or_fast  looks at the csp the player has chosen in their preferences. 180 is just some cut-off number for what I consider fast.

- If it's 'normal csp': goes with the old way of telling when the lipflap animation should end. See the edited line in function speaker_callback.

- If it's 'fast csp': ends the animation based on dialog length. See function live2d_lip_flapping. Change the 20 value to what looks good for your animation cycle. I added this same number as a buffer to len(_last_say_what) to guarantee at last some animation even if the text is short.

This is even better than anything I could have even imagine, mixing the best from both worlds. It's even really easy to edit and adapt by just changing the numbers until it fits perfectly. Thank you very much, even more considering how fast you got it. Have an amazing new year and I'll make sure to add your name to the credits once it's out (still a long time for that, sadly).

Thanks!

No problem, it was one of these issued I noticed early on, but I considered all my projects finished because I can't afford maintaining them. It's nice to do a little problem solving once in a while and I'm glad it helped you out. 

Happy new year to you as well and good luck with developing your game!

Just noticed a typo: csp is supposed to be named cps, but it was a quick and dirty code to test if it conceptually worked. Copy-pasted the wrong name everywhere... will fix that comment later.