OverflowError: value too large to convert to short

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.
Message
Author
User avatar
Destiny-Smasher
Newbie
Posts: 13
Joined: Wed Aug 09, 2017 7:10 pm
Projects: Life is Strange: All Wounds
Tumblr: destiny-smasher.tumblr.com
Contact:

OverflowError: value too large to convert to short

#1 Post by Destiny-Smasher » Sat Jun 02, 2018 8:59 pm

I tried to search for this error but can't seem to come up with anything.
The previous thread I saw about this error had the person just boot up a newer version of Renpy and that fixed it.
I just tried installed Renpy 7, just in case, and booted from there -- it seemed to auto-detect where my files were, in case that matters -- but python.exe opens, the computer freezes up a lot, and if I leave it long enough, I get a traceback that starts with this:
I'm sorry, but an uncaught exception occurred.

After loading the script.
OverflowError: value too large to convert to short

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

Full traceback:
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\bootstrap.py", line 306, in bootstrap
renpy.main.main()
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\main.py", line 415, in main
if renpy.parser.report_parse_errors():
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\parser.py", line 2664, in report_parse_errors
renpy.display.error.report_parse_errors(full_text, error_fn)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\error.py", line 185, in report_parse_errors
error_fn=error_fn,
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\game.py", line 279, in invoke_in_new_context
return callable(*args, **kwargs)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\error.py", line 43, in call_exception_screen
return renpy.ui.interact(mouse="screen", type="screen", suppress_overlay=True, suppress_underlay=True)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\ui.py", line 287, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\core.py", line 2649, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\core.py", line 3132, in interact_core
self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\core.py", line 2055, in draw_screen
renpy.config.screen_height,
File "render.pyx", line 485, in renpy.display.render.render_screen
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 717, in render
surf = render(child, width, height, cst, cat)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 717, in render
surf = render(child, width, height, cst, cat)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 717, in render
surf = render(child, width, height, cst, cat)
(There's a lot more, but maybe that's enough to give a gist of it)

Now, in case it's relevant, I have been working off and on on this thing for over two years, adapting a prose fic and converting it to code for a VN adaptation.
Could it be that my file is just too big at this point? What would I do to mitigate that? I've barely gone about adding in media like images or sounds, so if the memory is the issue, I definitely need to figure out what to do about that.

I did release a fully functioning demo a year back and never ran into this error until more recently, after I've spent months converting all of the rest of the prose into VN code.

http://lis-allwounds.tumblr.com/Downloads
(it is a fan-sequel story to Life is Strange)

Thanks for any assistance!

User avatar
Remix
Miko-Class Veteran
Posts: 830
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I cannot draw very well)
Projects: An un-named 3d anime based trainer game
Contact:

Re: OverflowError: value too large to convert to short

#2 Post by Remix » Sat Jun 02, 2018 9:54 pm

Just off to bed here...
In the interim, could you post (or attach) the full traceback as the more pertinent stuff is often at the end (they are generally reviewed backwards btw)?

User avatar
Destiny-Smasher
Newbie
Posts: 13
Joined: Wed Aug 09, 2017 7:10 pm
Projects: Life is Strange: All Wounds
Tumblr: destiny-smasher.tumblr.com
Contact:

Re: OverflowError: value too large to convert to short

#3 Post by Destiny-Smasher » Sun Jun 03, 2018 3:06 pm

Ah, sure.
I'm sorry, but an uncaught exception occurred.

After loading the script.
OverflowError: value too large to convert to short

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

Full traceback:
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\bootstrap.py", line 306, in bootstrap
renpy.main.main()
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\main.py", line 415, in main
if renpy.parser.report_parse_errors():
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\parser.py", line 2664, in report_parse_errors
renpy.display.error.report_parse_errors(full_text, error_fn)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\error.py", line 185, in report_parse_errors
error_fn=error_fn,
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\game.py", line 279, in invoke_in_new_context
return callable(*args, **kwargs)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\error.py", line 43, in call_exception_screen
return renpy.ui.interact(mouse="screen", type="screen", suppress_overlay=True, suppress_underlay=True)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\ui.py", line 287, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\core.py", line 2649, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\core.py", line 3132, in interact_core
self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\core.py", line 2055, in draw_screen
renpy.config.screen_height,
File "render.pyx", line 485, in renpy.display.render.render_screen
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 717, in render
surf = render(child, width, height, cst, cat)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 717, in render
surf = render(child, width, height, cst, cat)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 717, in render
surf = render(child, width, height, cst, cat)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\screen.py", line 669, in render
child = renpy.display.render.render(self.child, w, h, st, at)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 717, in render
surf = render(child, width, height, cst, cat)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 1117, in render
st, at)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 1564, in render
cwidth, cheight = sizeit('c', width, height, 0, 0)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 1559, in sizeit
rend = render(pos_d[pos], width, height, st, at)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 1564, in render
cwidth, cheight = sizeit('c', width, height, 0, 0)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 1559, in sizeit
rend = render(pos_d[pos], width, height, st, at)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\viewport.py", line 262, in render
surf = renpy.display.render.render(self.child, child_width, child_height, st, at)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 919, in render
surf = render(d, width - x, rh, cst, cat)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\text\text.py", line 1837, in render
layout = Layout(self, width, height, renders, splits_from=virtual_layout)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\text\text.py", line 706, in __init__
textsupport.tweak_glyph_spacing(all_glyphs, lines, target_x - maxx, target_y - y, maxx, y) # @UndefinedVariable
File "textsupport.pyx", line 944, in renpy.text.textsupport.tweak_glyph_spacing
File "textsupport.pxd", line 75, in renpy.text.textsupport.Line.y.__set__
OverflowError: value too large to convert to short

Windows-8-6.2.9200
Ren'Py 7.0.0.196
I think renpytom on Twitter suggested it's probably that some of my lines are just too long to display?

User avatar
Remix
Miko-Class Veteran
Posts: 830
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I cannot draw very well)
Projects: An un-named 3d anime based trainer game
Contact:

Re: OverflowError: value too large to convert to short

#4 Post by Remix » Sun Jun 03, 2018 4:20 pm

Destiny-Smasher wrote:
Sun Jun 03, 2018 3:06 pm
File "textsupport.pyx", line 944, in renpy.text.textsupport.tweak_glyph_spacing
File "textsupport.pxd", line 75, in renpy.text.textsupport.Line.y.__set__
OverflowError: value too large to convert to short
I think renpytom on Twitter suggested it's probably that some of my lines are just too long to display?
It would seem likely, yes.

You can see at the end of the traceback that renpy is basically trying to compute where to place a piece of dialogue and that those calculations are going out of bounds.
As it is not something user-fixable codewise, your best bet is probably to just cut back on the amount any one character says in one paragraph.

User avatar
Destiny-Smasher
Newbie
Posts: 13
Joined: Wed Aug 09, 2017 7:10 pm
Projects: Life is Strange: All Wounds
Tumblr: destiny-smasher.tumblr.com
Contact:

Re: OverflowError: value too large to convert to short

#5 Post by Destiny-Smasher » Sun Jun 03, 2018 8:59 pm

But how can I figure out where this is occurring in the code? Or is that not possible?
This is a MASSIVE project, and I'm used to being able to use the traceback to pinpoint where the issue is, so this is weird.

Do I need to just comb through the entire thing and try to shorten longer lines? I don't know how to tell what counts as "too long" or not.

kivik
Miko-Class Veteran
Posts: 779
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: OverflowError: value too large to convert to short

#6 Post by kivik » Mon Jun 04, 2018 8:44 am

Take a look at this from a question from stackoverflow in 2013: https://stackoverflow.com/questions/184 ... verflowerr

This implies your dialogue text has to be extremely long as short has a limit of 32,767 characters - so hopefully you should be able to find that quite easily.

Since there is absolutely no way that dialogue can fit on the screen in the first place - I assume you're putting it in a viewport for scrolling text? It's a lot of text to scroll through, so from a UX point of view that's not great, and you should break it down anyway!

User avatar
Remix
Miko-Class Veteran
Posts: 830
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I cannot draw very well)
Projects: An un-named 3d anime based trainer game
Contact:

Re: OverflowError: value too large to convert to short

#7 Post by Remix » Mon Jun 04, 2018 4:06 pm

Destiny-Smasher wrote:
Sun Jun 03, 2018 8:59 pm
But how can I figure out where this is occurring in the code? Or is that not possible?
This is a MASSIVE project, and I'm used to being able to use the traceback to pinpoint where the issue is, so this is weird.

Do I need to just comb through the entire thing and try to shorten longer lines? I don't know how to tell what counts as "too long" or not.
You *could* temporarily (I do mean make a backup and revert to it afterwards) amend textsupport.pyx in Ren'Py's core files to add more to the error:

1) Open {your path to renpy}/{your renpy sdk sub folder (not the source one, must be sdk)}/renpy/text/textsupport.pyx
2) Scroll to line 941
3) Amend and save, suggest:

Code: Select all

    for l in lines:
        try:
            end = l.y + l.height

            l.y += int(dy * l.y / h)
            end += int(dy * end / h)

            l.height = end - l.y
            
        except:
            raise OverflowError, "Failed to do the sums for line '{}' using the following values {}".format(
                "".join( [ g.character for g in l.glyphs ] ),
                ", ".join( [ l.y, l.height, dy, h, end ] ) )
4) Copy the new traceback error
5) Revert to previous and save
6) Either post the new error here or (if it is obvious what is wrong) fix it and celebrate...

Note: I would not generally suggest changing any code in Ren'Py's internals, this tweak and revert is just to try to track the error

User avatar
Destiny-Smasher
Newbie
Posts: 13
Joined: Wed Aug 09, 2017 7:10 pm
Projects: Life is Strange: All Wounds
Tumblr: destiny-smasher.tumblr.com
Contact:

Re: OverflowError: value too large to convert to short

#8 Post by Destiny-Smasher » Tue Jun 05, 2018 6:55 pm

All right. I tried what you said, here's the new traceback.
I'm sorry, but an uncaught exception occurred.

After loading the script.
OverflowError: value too large to convert to short

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

Full traceback:
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\bootstrap.py", line 306, in bootstrap
renpy.main.main()
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\main.py", line 415, in main
if renpy.parser.report_parse_errors():
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\parser.py", line 2664, in report_parse_errors
renpy.display.error.report_parse_errors(full_text, error_fn)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\error.py", line 185, in report_parse_errors
error_fn=error_fn,
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\game.py", line 279, in invoke_in_new_context
return callable(*args, **kwargs)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\error.py", line 43, in call_exception_screen
return renpy.ui.interact(mouse="screen", type="screen", suppress_overlay=True, suppress_underlay=True)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\ui.py", line 287, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\core.py", line 2649, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\core.py", line 3132, in interact_core
self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\core.py", line 2055, in draw_screen
renpy.config.screen_height,
File "render.pyx", line 485, in renpy.display.render.render_screen
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 717, in render
surf = render(child, width, height, cst, cat)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 717, in render
surf = render(child, width, height, cst, cat)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 717, in render
surf = render(child, width, height, cst, cat)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\screen.py", line 669, in render
child = renpy.display.render.render(self.child, w, h, st, at)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 717, in render
surf = render(child, width, height, cst, cat)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 1117, in render
st, at)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 1564, in render
cwidth, cheight = sizeit('c', width, height, 0, 0)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 1559, in sizeit
rend = render(pos_d[pos], width, height, st, at)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 1564, in render
cwidth, cheight = sizeit('c', width, height, 0, 0)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 1559, in sizeit
rend = render(pos_d[pos], width, height, st, at)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\viewport.py", line 262, in render
surf = renpy.display.render.render(self.child, child_width, child_height, st, at)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\display\layout.py", line 919, in render
surf = render(d, width - x, rh, cst, cat)
File "render.pyx", line 145, in renpy.display.render.render
File "render.pyx", line 233, in renpy.display.render.render
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\text\text.py", line 1837, in render
layout = Layout(self, width, height, renders, splits_from=virtual_layout)
File "C:\Users\Destiny_Smasher\My Projects\Visual Novel\renpy 7\renpy-7.0.0-sdk\renpy\text\text.py", line 706, in __init__
textsupport.tweak_glyph_spacing(all_glyphs, lines, target_x - maxx, target_y - y, maxx, y) # @UndefinedVariable
File "textsupport.pyx", line 944, in renpy.text.textsupport.tweak_glyph_spacing
File "textsupport.pxd", line 75, in renpy.text.textsupport.Line.y.__set__
OverflowError: value too large to convert to short

Windows-8-6.2.9200
Ren'Py 7.0.0.196

Tue Jun 05 15:42:00 2018

User avatar
Remix
Miko-Class Veteran
Posts: 830
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I cannot draw very well)
Projects: An un-named 3d anime based trainer game
Contact:

Re: OverflowError: value too large to convert to short

#9 Post by Remix » Tue Jun 05, 2018 7:06 pm

Unfortunately that yields nothing better, the try: except: in the .pyx obviously isn't catching and squashing the error from the .pxd which sadly means there is little more advice I can offer.

kivik
Miko-Class Veteran
Posts: 779
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: OverflowError: value too large to convert to short

#10 Post by kivik » Tue Jun 05, 2018 7:24 pm

Can I ask again if you're just pasting a butt load of text into a single NVL screen? Given that you're converting a prose I'm not sure if you're just copying and pasting huge chunks of text in a single string or actually taking time to break them down?

If it's the case of copying and pasting huge chunks of text into a string then you just need to cut those huge text string out of your script and break them down. With 32,767 characters being the limit and the English language averaging at 5.1 letters per word that's roughly 6,500 words in a single string that you've got that's breaking Renpy.

If your script file is really that long that you can't just do this manually, you can use a binary approach to deducing the problem: cut your file at roughly half way point (I'm guessing you're not using too many labels) - paste the second half of the script to a separate text file and save your script. If it still breaks, half it again > paste the code at the top of your second text file. Repeat the process and you should end up with an exponentially smaller file to work with and quite feasible to find the error.

If you don't get errors after a cut, examine the last half of the script file that you pasted in your text file, if it's too much, cut the top half and put it back to your script. Rinse and repeat. You should narrow down the problem chunks fairly quickly.

User avatar
Destiny-Smasher
Newbie
Posts: 13
Joined: Wed Aug 09, 2017 7:10 pm
Projects: Life is Strange: All Wounds
Tumblr: destiny-smasher.tumblr.com
Contact:

Re: OverflowError: value too large to convert to short

#11 Post by Destiny-Smasher » Thu Jun 07, 2018 5:57 pm

Nah, I mean, I have spent HOURS and hours over the course of a year and a half formatting this whole thing to VN code.
6,000 characters is still a lot for a single line, I shouldn't have anything that long -- but it's sounding like I MUST have something, at least one instance, somewhere, that's just too long. I'm just used to Renpy telling me WHERE the issue is, so I can very quickly fix it.

I'm going to have to run through the whole thing multiple times, anyway -- I still have to add most of the choices, alternate text/scenes, images/sound.

So I guess I'll just get to it, though it sounds like it'd be more efficient to put each separate chapter as it's own script file, and use 'jump' commands to hop across them...? I guess? I have no experience with that part so far.
Attachments
sample.png

User avatar
Remix
Miko-Class Veteran
Posts: 830
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I cannot draw very well)
Projects: An un-named 3d anime based trainer game
Contact:

Re: OverflowError: value too large to convert to short

#12 Post by Remix » Thu Jun 07, 2018 6:29 pm

You might note though that the error is a result of code that is trying to calculate where in a box to place the y co-ordinate of a specific glyph so it might be a result of a division by almost zero.
Realistically though, it is probably due to a certain line containing too many characters or line breaks.

Does the game start at all or just fail immediately?

kivik
Miko-Class Veteran
Posts: 779
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: OverflowError: value too large to convert to short

#13 Post by kivik » Thu Jun 07, 2018 7:53 pm

Yeah splitting the file into chapters would be a good start. You can actually use that to help isolate the error as well: save chapter 1 as an .rpy file, the rest of them as txt files. Then try launching the game.

If it works, rename chapter 2 to .rpy file, then chapter 3 and so on - then it'll narrow down which file the problem is :)

Sounds like you're not expecting the long text to be there, so something weird must be going on. I sure hope it's not encoding issues and somehow the whole script got treated as a string - which I doubt can happen but stranger things have happened!

User avatar
Destiny-Smasher
Newbie
Posts: 13
Joined: Wed Aug 09, 2017 7:10 pm
Projects: Life is Strange: All Wounds
Tumblr: destiny-smasher.tumblr.com
Contact:

Re: OverflowError: value too large to convert to short

#14 Post by Destiny-Smasher » Fri Jun 15, 2018 8:47 pm

The VN does not start at all, freezing up, stalls RenPy for a long time, and then spits out that error.

Hm, do I need to modify every chapter to get it boot?

At the moment, I have the entirety of the story within a single .rpy file, so I guess by your logic I could re-save it as a .txt file, then create a new .rpy and just copy-paste the contents of each chapter, using that to isolate where in the script the error is?

I guess it's worth a shot, at least!

User avatar
Remix
Miko-Class Veteran
Posts: 830
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I cannot draw very well)
Projects: An un-named 3d anime based trainer game
Contact:

Re: OverflowError: value too large to convert to short

#15 Post by Remix » Sat Jun 16, 2018 6:49 am

If you do not easily track down the issue with that method and if you are willing to, you could put the text part on google drive (or zip the current game would be nicer as the chosen font and settings will play their part) and one of us could take a look.
Scanning the script for the error line could be done in a code loop, just it would be tricky to explain the best approach without first seeing the script

Post Reply

Who is online

Users browsing this forum: Doogy