Hi all,
While working on my game, I wanted the ability to have my characters blink to bring more life into the characters. I couldn't find a really easy solution, so I thought I'd see if ChatGPT was as smart to make it for me. It took a lot of testing and educating ChatGPT, but ultimately I got it working. And best of all, it's stunningly easy.
How to get this working as a developer:
* Place this zzz_eyeblink.rpy script in your Ren'Py game folder
* You need to have 2 images. One regular version and one exactly the same version but with the character with eyes closed. (pro tip: Use photoshop / Adobe Firefly for this. Create a lasso to select the eyes and use the generative fill prompt 'eyes closed'.
* The version with the eyes closed needs to have the same name as the 1st image, just add '-closed'. For instance, if your image is called 'mc_kitchen.png', the version with eyes closed needs to be named 'mc_kitchen-closed.png'
* If an image does not have a '-closed' version, it will just display the regular image.
* Don't forget not to use (too many) spaces in your image, that might screw it up. Just go with _, like 'mc_bedroom_night_asleep.png' and then 'mc_bedroom_night_asleep-closed.png'
That's it!
The script has a few variables you can set:
# Tunables
ABL_MIN_WAIT = 4.0 (minimum number of seconds to wait between blinks)
ABL_MAX_WAIT = 10.0 (maximum number of seconds to wait between blinks)
ABL_CLOSE_DUR = 0.02 (how long will the eyes closed image be displayed, in this case 0,02 seconds)
ABL_DOUBLE_PROB = 0.35 (the percentage of probability that the character will double blink, in this case 35%)
Have fun!
While working on my game, I wanted the ability to have my characters blink to bring more life into the characters. I couldn't find a really easy solution, so I thought I'd see if ChatGPT was as smart to make it for me. It took a lot of testing and educating ChatGPT, but ultimately I got it working. And best of all, it's stunningly easy.
How to get this working as a developer:
* Place this zzz_eyeblink.rpy script in your Ren'Py game folder
* You need to have 2 images. One regular version and one exactly the same version but with the character with eyes closed. (pro tip: Use photoshop / Adobe Firefly for this. Create a lasso to select the eyes and use the generative fill prompt 'eyes closed'.
* The version with the eyes closed needs to have the same name as the 1st image, just add '-closed'. For instance, if your image is called 'mc_kitchen.png', the version with eyes closed needs to be named 'mc_kitchen-closed.png'
* If an image does not have a '-closed' version, it will just display the regular image.
* Don't forget not to use (too many) spaces in your image, that might screw it up. Just go with _, like 'mc_bedroom_night_asleep.png' and then 'mc_bedroom_night_asleep-closed.png'
That's it!
The script has a few variables you can set:
# Tunables
ABL_MIN_WAIT = 4.0 (minimum number of seconds to wait between blinks)
ABL_MAX_WAIT = 10.0 (maximum number of seconds to wait between blinks)
ABL_CLOSE_DUR = 0.02 (how long will the eyes closed image be displayed, in this case 0,02 seconds)
ABL_DOUBLE_PROB = 0.35 (the percentage of probability that the character will double blink, in this case 35%)
Have fun!
Last edited: