key sends to the next line o_O

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Theodosius
Newbie
Posts: 9
Joined: Fri Oct 07, 2016 8:24 pm
Contact:

key sends to the next line o_O

#1 Post by Theodosius »

Hi! I'm trying to implement the cursor mechanics from the point&click quests.
Now i use this code:

Code: Select all

def cur1():
        global ccc
        if ccc == 1:
            ccc = 2
            setattr(config, "mouse", {"default": [("cursor/2.png", 0, 0)]})
        elif ccc == 2:
            ccc = 3
            setattr(config, "mouse", {"default": [("cursor/3.png", 0, 0)]})
        elif ccc == 3:
            ccc = 4
            setattr(config, "mouse", {"default": [("cursor/4.png", 0, 0)]})
        elif ccc == 4:
            ccc = 5
            setattr(config, "mouse", {"default": [("cursor/5.png", 0, 0)]})
        elif ccc == 5:
            ccc = 1
            setattr(config, "mouse", {"default": [("cursor/1.png", 0, 0)]})
        return (ccc)

    config.underlay.append(renpy.Keymap(p=cur1))
it works, the cursor changes when the key is pressed.... BUT when i use it, game sends me to the next line like after LMB o_O
If i use this function in menu, game crashes with error "list index out of range". How to avoid this?

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: key sends to the next line o_O

#2 Post by IrinaLazareva »

Theodosius wrote:BUT when i use it, game sends me to the next line like after LMB o_O
delete line:

Code: Select all

        return (ccc)
Theodosius wrote:If i use this function in menu, game crashes with error "list index out of range". How to avoid this?

Code: Select all

..... action Function(cur1)

Theodosius
Newbie
Posts: 9
Joined: Fri Oct 07, 2016 8:24 pm
Contact:

Re: key sends to the next line o_O

#3 Post by Theodosius »

Thanks!

Post Reply

Who is online

Users browsing this forum: Google [Bot], voluorem, W3C [Validator]