I don't know what's wrong because it's not the actual CODE... I have the labels in a set of boys and I took each set (love interest) of labels out and ran them individually)... They worked perfectly fine. However, when I closed it and tried to reopen with all of the sets inside, it instead opens a traceback error and the first two lines has the above error instead.

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

Is there a code length limitation or something? My project is a dating sim with 12 possible love interests.... and today, it started messing up when I'm almost 50% done...

I don't think I should

Is there a way for the code to be "too long" for Ren'py?

EDIT: Here's the full traceback:

Full traceback:
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\bootstrap.py", line 265, in bootstrap
    renpy.main.main()
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\main.py", line 263, in main
    if renpy.parser.report_parse_errors():
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\parser.py", line 2093, in report_parse_errors
    renpy.display.error.report_parse_errors(full_text, error_fn)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\error.py", line 157, in report_parse_errors
    error_fn = error_fn,
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\game.py", line 323, in invoke_in_new_context
    return callable(*args, **kwargs)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\error.py", line 42, in call_exception_screen
    return renpy.ui.interact(mouse="screen", type="screen", suppress_overlay=True, suppress_underlay=True)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\ui.py", line 237, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\core.py", line 1853, in interact
    repeat, rv = self.interact_core(preloads=preloads, **kwargs)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\core.py", line 2165, in interact_core
    self.draw_screen(root_widget, fullscreen_video, (not fullscreen_video) or video_frame_drawn)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\core.py", line 1420, in draw_screen
    renpy.config.screen_height,
  File "render.pyx", line 365, in renpy.display.render.render_screen (gen\renpy.display.render.c:4568)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2033)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\layout.py", line 521, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2291)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2033)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\layout.py", line 521, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2291)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2033)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\layout.py", line 521, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2291)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2033)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\screen.py", line 295, in render
    child = renpy.display.render.render(self.child, w, h, st, at)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2291)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2033)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\layout.py", line 521, in render
    surf = render(child, width, height, cst, cat)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2291)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2033)
  File "accelerator.pyx", line 109, in renpy.display.accelerator.transform_render (gen\renpy.display.accelerator.c:1298)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2033)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\layout.py", line 889, in render
    st, at)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2291)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2033)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\layout.py", line 1552, in render
    cwidth, cheight = sizeit('c', width, height, 0, 0)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\layout.py", line 1547, in sizeit
    rend = render(pos_d[pos], width, height, st, at)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2291)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2033)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\layout.py", line 1311, in render
    surf = render(self.child, child_width, child_height, st, at)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2291)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2033)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\display\layout.py", line 683, in render
    surf = render(d, width - x, rh, cst, cat)
  File "render.pyx", line 95, in renpy.display.render.render (gen\renpy.display.render.c:2291)
  File "render.pyx", line 166, in renpy.display.render.render (gen\renpy.display.render.c:2033)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\text\text.py", line 1363, in render
    layout = Layout(self, width, height, renders)
  File "C:\Users\Jessinia\Downloads\renpy-6.15.7-sdk\renpy\text\text.py", line 593, in __init__
    textsupport.align_and_justify(lines, maxx, style.text_align, style.justify)
  File "textsupport.pyx", line 728, in renpy.text.textsupport.align_and_justify (gen\renpy.text.textsupport.c:7288)
OverflowError: value too large to convert to short

Windows-post2008Server-6.2.9200
Ren'Py 6.15.7.374
2

There are 2 answers

5
Serial On

Python is saying basically you have a number that is too large to be converted to a short

in python when a number is very large its turned into a long like this its represented with an L

>>> import math
>>> math.factorial(1000)
40238726...L

youre code isnt to long for Ren'py but you have a value in youre code thats to big to become a short

learn more about Long Integer Objects here

7
Dietrich Epp On

I downloaded the Ren'Py SDK to see what was going on.

Here is the function which throws the error, in renpy/text/textsupport.pyx:

def align_and_justify(list lines, short width, float text_align, bint justify):

You can see that the only short is the width, which is the width of the text you are putting on the screen. Somehow, a number which is larger than 32,767 got passed in as the width. Looking at the calling code in renpy/text/text.py I can see that the width can come from either the maximum width of a paragraph, or it can come from the style's minimum width. I hope this gives you a clue about where to look.


And then there is this comment you made:

Is there a code length limitation or something? My project is a dating sim with 12 possible love interests.... and today, it started messing up when I'm almost 50% done...

It sounds like you're not using version control.

Use version control!

Download Git (or Mercurial, SVN, Bazaar, Darcs, Perforce, CVS, whatever) like right now and check your project into revision control. There is no such thing as "messing up" when you are using revision control correctly, there is only "wasting time" because if you screw up you can always go back to an older version of your project, and you can even figure out which change screwed something up.


Add debugging to Ren'py

I would try adding debugging code to renpy/text/text.py, before the line which contains align_and_justify(). Here is the code I added, as well as some surrounding Ren'py code:

sw, sh = size = (maxx + self.xborder, y + self.yborder)
self.size = size

# Add these two lines
# Indentation is important, and use spaces not tabs to indent
if not (-32768 <= maxx <= 32767):
    raise ValueError('failed on text: %r' % ' '.join(s for ts, s in p))

textsupport.align_and_justify(lines, maxx, style.text_align, style.justify)

This will at least show you which paragraph in your script is triggering the error.