[iOS] AttributeError: 'RevertableObject' object has no attri

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
User avatar
Atikin
Newbie
Posts: 3
Joined: Thu Jan 05, 2017 11:41 pm
Contact:

[iOS] AttributeError: 'RevertableObject' object has no attri

#1 Post by Atikin »

Traceback:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/ui_labels.rpy", line 203, in <module>
    elif renpy.context().main_menu and not coming_from_prefs_sub:
AttributeError: 'RevertableObject' object has no attribute 'main_menu'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "/private/var/mobile/Containers/Bundle/Application/FD929866-67F1-4F03-8DDC-669D0156EAD0/Kata.app/ui_labels.rpyc", line 198, in script
  File "/private/var/mobile/Containers/Bundle/Application/FD929866-67F1-4F03-8DDC-669D0156EAD0/Kata.app/base/renpy/ast.py", line 806, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "/private/var/mobile/Containers/Bundle/Application/FD929866-67F1-4F03-8DDC-669D0156EAD0/Kata.app/base/renpy/python.py", line 1461, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/ui_labels.rpy", line 203, in <module>
    elif renpy.context().main_menu and not coming_from_prefs_sub:
AttributeError: 'RevertableObject' object has no attribute 'main_menu'

Darwin-14.0.0-iPad4,1-arm64-32bit
Ren'Py 6.99.9.1168
Hello. Today I got an idea to port new version of Katawa Shoujo Alpha (with RU translate) on iOS.
I taken old .ipa of the game with Ren'Py 6.99.9.1168 and slightly modded some files to work perfectly. But now I have two problems.

First, I can't open any submenu (like settings and save, traceback also related)
image.jpg
Second problem I can deal by myself, I think.

Hope, you can help me. Also I can archive and send you my Frankenstein like .ipa or .zip

Piece of code with problem:

Code: Select all

    python:
    
        layout.navigation(None)
        if prefs_looped:
            renpy.transition(ImageDissolve(im.Tile("ui/tr-checkwipe.png"), 0.5, 8))
        elif renpy.context().main_menu and not coming_from_prefs_sub:
            renpy.transition(config.main_game_transition)
        else:
            renpy.transition(config.intra_transition)
        if renpy.context().main_menu: # We'll draw a fake main menu for style reasons, or it'll just be boring black in the mm
            ui.image(style.mm_root.background)
        coming_from_prefs_sub = False
        ui.image(style.gm_root.background)
        prefs_looped = False # or we'll have a problem the next time this menu is invoked
        ui.image("ui/bg-config.png", xalign=0.5, yalign=0.5)
P.S. There is no problems on PC version.

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: [iOS] AttributeError: 'RevertableObject' object has no a

#2 Post by PyTom »

This looks like a bug in the code, accessing an attribute that doesn't exist. You probably want to test main_menu rather than renpy.context().main_menu.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Atikin
Newbie
Posts: 3
Joined: Thu Jan 05, 2017 11:41 pm
Contact:

Re: [iOS] AttributeError: 'RevertableObject' object has no a

#3 Post by Atikin »

PyTom wrote:This looks like a bug in the code, accessing an attribute that doesn't exist. You probably want to test main_menu rather than renpy.context().main_menu.
Hi, but I simply changed "main_menu" to "_main_menu" and... That works! (I don't even know, why. Because on PC there is no exceptions)

Now there is another problem... This code:

Code: Select all

label gm_bare:

    python:
        footerstring = ''
        if (previous_language) == (None):
            previous_language = persistent.current_language
        gm_active = True
        config.skipping = None
        layout.navigation('gm_bare')
        if name_from_label(save_name):
            currentscenename = name_from_label(save_name)
            if not (playthroughflag):
                currentscenename += ((' (') + (displayStrings.game_menu_replay_indicator)) + (')')
            footerstring += ((((((displayStrings.play_time_label) + (': ')) + (time_from_seconds(renpy.get_game_runtime()))) + ('\n')) + (displayStrings.game_menu_current_scene)) + (': ')) + (currentscenename)
        nowplaying = get_music_name()
        if nowplaying:
            footerstring += ((('\n') + (displayStrings.game_menu_current_music)) + (': ')) + (nowplaying)
        ui.text(footerstring, text_align=0.5, xalign=0.5, yalign=0.97999999999999998, size=18)
        ui.interact()
causing same exception when I'm trying to open in-game menu:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/ui_labels.rpy", line 68, in <module>
    layout.navigation('gm_bare')
AttributeError: 'RevertableObject' object has no attribute 'main_menu'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "/private/var/mobile/Containers/Bundle/Application/19CE8771-DF20-40C8-8492-F81C3DBD272B/Kata.app/ui_labels.rpyc", line 62, in script
  File "/private/var/mobile/Containers/Bundle/Application/19CE8771-DF20-40C8-8492-F81C3DBD272B/Kata.app/base/renpy/ast.py", line 806, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "/private/var/mobile/Containers/Bundle/Application/19CE8771-DF20-40C8-8492-F81C3DBD272B/Kata.app/base/renpy/python.py", line 1461, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/ui_labels.rpy", line 68, in <module>
    layout.navigation('gm_bare')
  File "renpy/common/_layout/classic_navigation.rpym", line 66, in _navigation
    enabled=eval(enabled),
  File "/private/var/mobile/Containers/Bundle/Application/19CE8771-DF20-40C8-8492-F81C3DBD272B/Kata.app/base/renpy/python.py", line 1490, in py_eval
    return py_eval_bytecode(code, globals, locals)
  File "/private/var/mobile/Containers/Bundle/Application/19CE8771-DF20-40C8-8492-F81C3DBD272B/Kata.app/base/renpy/python.py", line 1485, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "<none>", line 1, in <module>
AttributeError: 'RevertableObject' object has no attribute 'main_menu'

Darwin-14.0.0-iPad4,1-arm64-32bit
Ren'Py 6.99.9.1168

Post Reply

Who is online

Users browsing this forum: No registered users