[Solved]Did something change in translation.py? TypeError :(

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
nintendotoad
Regular
Posts: 42
Joined: Sat Mar 31, 2012 2:56 pm
Location: projectexist.net
Contact:

[Solved]Did something change in translation.py? TypeError :(

#1 Post by nintendotoad »

Code: Select all

$ nvlcap = NVLCharacter(None, kind=nvl, ctc=anim.Blink("extra/arrow.png"))

Code: Select all

    nvlmc "Oddly enough, the fact that I can't leave tells me that I am either in Heaven, Hell, or inside of my own head."
    nvls "How perceptive. I suppose that you know which of those three would be the most likely."
    nnvlmc "Clearly, I haven't died yet... actually, for the sake of argument, I should include that theory."
    $ answer_add(nvla(0, nvlq(None, "In front of me is an angel, this is Heaven.", "I wasn't good enough for Heaven; this is Hell.", 
        "Too good to be Hell and too bad to be Heaven; this is my head.", "There is no one else here; this is my head.")))
    nvlmc "I think I've figured it out. All right, new question..."
    
http://pastebin.com/raw.php?i=rzd2npqE
(This also happens on 6.17.7.521)

The basic idea is that I wanted a way to quickly write out and define questions being asked in NVL mode, and this worked for a time (even if the code itself is bad). After updating today however (it's been a while since I've updated my Ren'Py installation), the function no longer works as shown in the above traceback.

Help? (Oddly enough, nvlcap does get to say "his piece" before the crash; nvlmc however, never gets to say that he's figured it out.)
Last edited by nintendotoad on Fri Aug 29, 2014 9:58 pm, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Did something change in translation.py? TypeError :(

#2 Post by PyTom »

Yes, I think this is my problem.
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
PyTom
Ren'Py Creator
Posts: 16096
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: Did something change in translation.py? TypeError :(

#3 Post by PyTom »

Actually, it looked like my problem from the traceback. But trying it in 6.18, I can't repeat it. So please put together a replication under 6.18, so I can look at it.
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

nintendotoad
Regular
Posts: 42
Joined: Sat Mar 31, 2012 2:56 pm
Location: projectexist.net
Contact:

Re: Did something change in translation.py? TypeError :(

#4 Post by nintendotoad »


User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Did something change in translation.py? TypeError :(

#5 Post by PyTom »

In retrospect, the problem is clear.

You define nvla as a function, and then redefine it to be a character. Since the functions and characters live in the same namespace, this replaces nvla. The second time it is called, it's a character, and you get a (admittedly, barely relevant) crash.

Nesting things three function calls deep isn't really good coding style, since it makes it hard to figure out which function call is causing an exception. (This is more just to give voice to a lesson I learned a long time ago, but which is something that is usually learned the hard way.) It was only when I un-nested the function that the problem became clear.

Anyway, I've gone ahead and made Character check early for this problem, so it doesn't bite people again. All's well that ends well.
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

Post Reply

Who is online

Users browsing this forum: Google [Bot]