[Solved] Uncalled eval prompting nvl-mode crashes?

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
OldGoateye
Newbie
Posts: 14
Joined: Fri Oct 09, 2015 4:31 am
Contact:

[Solved] Uncalled eval prompting nvl-mode crashes?

#1 Post by OldGoateye » Mon Feb 08, 2016 4:33 am

Hello!

I recently updated Ren'Py, after not noticing that there was a Ren'Py update button included in the launcher. I - have no excuses, but I am somewhat regretting it.
You see, the game that I have been working on quietly for quite some time just started spitting up the following -
Indeed, every work I've done that includes nvl-mode 'narrators' seems to be dying from uncalled eval()!

No clue what was updated(?) to mess around with the old way novel-mode was called (if that is indeed the problem).
I'm not worried about losing anything; I've got backups of my backups and can always just re-install older versions of Ren'Py if I understand.

Things I have tried:

* Deleting/re-unzipping Ren'Py
* Updating to Nightly
* Forcing Recompile
* Leaving strings empty ("")
* Changing the dynamic narrators from None to "None"

Status: Solved! I feel I had a reason for using Dynamic nvl-mode narrators, but I can't recall for life of me remember what it was so out with the bathwater it goes.
For those with similar issues, either change the DynamicCharacter from None to "None" or more easily, just remove their Dynamic nature in the first place.
Thanks PyTom, mobychan and korova!

Will update as possible. Please note that the text called has been changed and Downtempo is a working title, but what can you do. :lol:
Hopefully this helps you help me, or anyone else with a similar problem. I have looked for nvl-mode/novel-mode crashes in the search function, and had no luck.
Thanks for your time!

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 161, in script
    narrator "This is sample text."
TypeError: eval() arg 1 must be a string or code object

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

Full traceback:
  File "game/script.rpy", line 161, in script
    narrator "This is sample text."
  File "C:\Visual Novels\renpy-6.99.8-sdk\renpy\ast.py", line 603, in execute
    renpy.exports.say(who, what, interact=self.interact)
  File "C:\Visual Novels\renpy-6.99.8-sdk\renpy\exports.py", line 1121, in say
    who(what, interact=interact)
  File "C:\Visual Novels\renpy-6.99.8-sdk\renpy\character.py", line 798, in __call__
    who = renpy.python.py_eval(who)
  File "C:\Visual Novels\renpy-6.99.8-sdk\renpy\python.py", line 1490, in py_eval
    return py_eval_bytecode(code, globals, locals)
  File "C:\Visual Novels\renpy-6.99.8-sdk\renpy\python.py", line 1485, in py_eval_bytecode
    return eval(bytecode, globals, locals)
TypeError: eval() arg 1 must be a string or code object

Windows-7-6.1.7601-SP1
Ren'Py 6.99.8.959
Downtempo
Last edited by OldGoateye on Wed Feb 10, 2016 1:20 am, edited 2 times in total.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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: [Bug][Traceback] Uncalled eval prompting nvl-mode crashe

#2 Post by PyTom » Tue Feb 09, 2016 1:31 am

Hm... Try hitting "Force Compile". Other than that, can you show what you did for narrators?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

OldGoateye
Newbie
Posts: 14
Joined: Fri Oct 09, 2015 4:31 am
Contact:

Re: [Bug][Traceback] Uncalled eval prompting nvl-mode crashe

#3 Post by OldGoateye » Tue Feb 09, 2016 2:54 am

Sure thing, here you go!
I tried Force Compiling, no luck; I've got a worrying feeling it's because I've defined multiple nvl-mode dynamic narrators...
Having gotten used to being able to do so, I got careless and added all of four, as it made keeping track of things easier for me, aha.
Now - I would love to figure out what's causing the setup not to work out, but it's certainly not a high-priority problem; if a thought strikes you though, I shall certainly appreciate it!
Here is the code:

Code: Select all

#Chara Declarations, Line 79
define narrator = DynamicCharacter(None, kind=nvl, what_color="#000000")
define narrator2 = DynamicCharacter(None, kind=nvl, what_color="#517F8F")
define narrator3 = DynamicCharacter(None, kind=nvl, what_color="#B50B16")
define narrator4 = DynamicCharacter(None, kind=nvl, what_color="#2B7519")
There are other characters, but those should be all the kind=nvl speakers.
There aren't any other items sharing the narrator (narrator2, etc) strings in the code.

User avatar
mobychan
Veteran
Posts: 275
Joined: Fri Apr 24, 2015 6:31 am
Projects: The Chosen - Sakura Pink & Gentian Blue
Organization: Foresoft
Location: Germany
Contact:

Re: [Bug][Traceback] Uncalled eval prompting nvl-mode crashe

#4 Post by mobychan » Tue Feb 09, 2016 2:59 am

Just a wild guess, but did you try replacing None in your narrator definitions with an empty string? ("")

OldGoateye
Newbie
Posts: 14
Joined: Fri Oct 09, 2015 4:31 am
Contact:

Re: [Bug][Traceback] Uncalled eval prompting nvl-mode crashe

#5 Post by OldGoateye » Tue Feb 09, 2016 3:10 am

Hallo again! :mrgreen: Thanks for the advice! They were all None at the moment, and editing them to a blank string ("") didn't work, but you did give me something that ended up... Kind of solving it?
I edited this:

Code: Select all

define narrator = DynamicCharacter(None, kind=nvl, what_color="#000000")
Into:

Code: Select all

define narrator = DynamicCharacter("None", kind=nvl, what_color="#000000")
And it worked as fine as before. I've no clue why, but since it's nvl-mode the name doesn't even show up, so it'll work as a stopgap for now while I figure out what caused the inconsistency.
I'm going to test it with other narrators to see if defining them all as "None" will solve the issue, and if so I'll edit the top post to mention that as a possible solution!

User avatar
korova
Veteran
Posts: 217
Joined: Sat Jun 27, 2009 5:15 pm
Completed: Ivy, Chocolate, Time, Clair Obscur
Projects: Writing exercises, The House [Nano18]
Tumblr: korova08
itch: korova
Location: Normandie, France
Contact:

Re: [Bug][Traceback] Uncalled eval prompting nvl-mode crashe

#6 Post by korova » Tue Feb 09, 2016 6:38 am

Why do you use a DynamicCharacter rather than regular Character ?

OldGoateye
Newbie
Posts: 14
Joined: Fri Oct 09, 2015 4:31 am
Contact:

Re: [Bug][Traceback] Uncalled eval prompting nvl-mode crashe

#7 Post by OldGoateye » Tue Feb 09, 2016 11:12 am

I -

Huh, that's a very good question. :shock: I must have had a reason when I made that call, and I think it was related to how I thought text colourization worked at the time...
I've been working on this so long I completely glanced past them being dynamic nvl-mode speakers, possibly because it worked with a hitch earlier.
But - come to think of it, that could be it, couldn't it?
... Wow.

I'll test it when I get back from work, but if that's the case, how embarrassing.
Still - better to have a good clue of what is what, and that'd give me an idea of what to look for as the cause.
Thanks, korova!

Post Reply

Who is online

Users browsing this forum: No registered users