Question

Quick Info: This is for the Renpy Visual Novel Game Engine (Available on Github) which is built on python.

What I want to do is change the ['dismiss'] variable of the keymap to null while a series of transitions play so the reader cant skip the scene. after the scene is over, I want to re-enable the default ['dismiss'] so that the user can continue reading the VN.

What I have so far in my script is:

$ enter_off()
##################
# Animated Intro #
##################
scene bg_sky_winter_sunny with dissolve300s
$ enter_on()

Defined in another section of the code is:

python early:
    # turns enter off
    # Also tried # config.keymap['dismiss'] = [] # Same result as below.
    def enter_off():
        config.keymap['dismiss'].remove('mouseup_1')
        config.keymap['dismiss'].remove('K_RETURN')
        config.keymap['dismiss'].remove('K_SPACE')
        config.keymap['dismiss'].remove('K_KP_ENTER')
        config.keymap['dismiss'].remove('joy_dismiss')
        return

    # turns enter on
    def enter_on():
        config.keymap['dismiss'].append('mouseup_1')
        config.keymap['dismiss'].append('K_RETURN')
        config.keymap['dismiss'].append('K_SPACE')
        config.keymap['dismiss'].append('K_KP_ENTER')
        config.keymap['dismiss'].append('joy_dismiss')
        return

    # copy of the default keymap in renpy-6.16.5-sdk\renpy\common\00keymap.rpy
    def full_kb():
        # the rest of the code is long and unnecessary for the question.

Now, the problem I'm getting is when I use the first block of code for the intro, the dismiss variable is set to null as expected, but after the intro ends and the scene changes, enter_on() does not work as expected, and either does not update the engine to include the values in dismiss or does not add the values to dismiss. I've looked basically everywhere I could think, but due to the lack of propper documentation, I cant really figure out how to get this to work.

Here are a few links to places that have some info:

Renpy Keymap Documentation: http://www.renpy.org/wiki/renpy/doc/reference/Keymap

Renpy Source Code: https://github.com/renpy/renpy

Any pointers would be awesome!

Was it helpful?

Solution

Asked on lemmasoft forums and received answer. Link here: http://lemmasoft.renai.us/forums/viewtopic.php?f=8&t=25588

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top