0

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
Rex Nihilo
  • 604
  • 2
  • 7
  • 16
pyopyon
  • 21
  • 1
  • 3

2 Answers2

3

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.

Dietrich Epp
  • 205,541
  • 37
  • 345
  • 415
  • I went into the text support page and even though I see the line, I have no idea what to do to change it.... Honestly;; I've never altered anything outside of the script pages, so I don't know what I'm doing and I don't want to mess up anything... In addition, I downloaded Git but..... I don't know how to use it orz;; I'm new to the world of coding, so I apologize for being so basic. Please help. – pyopyon Aug 28 '13 at 21:57
  • If you upload your project somewhere I could take a look at it. To me, it sounds like this should result in a bug report against Ren'py. As for Git — [Git: Your New Best Friend](http://www.sitepoint.com/version-control-git/) – Dietrich Epp Aug 29 '13 at 01:54
  • Ahh, the thing is, when it's doing it's little traceback page error, it won't let me make it available for distribution so I'm not quite sure how I should send it... Should I send the script.rpy file alone?;; And thank you as far as the Git Guide! Much appreciated. Alternatively, where do I send the bug report? – pyopyon Aug 29 '13 at 03:55
  • That's probably enough. – Dietrich Epp Aug 29 '13 at 03:56
  • If it's under 512K you can use pastebin.com. – Dietrich Epp Aug 29 '13 at 03:57
  • Here's the paste bin of my script. http://pastebin.com/aeGPeiq5 Thank you! – pyopyon Aug 29 '13 at 05:02
  • I'm not able to figure it out from the script. I've written some debugging code you can insert into Ren'py, which might help you track down the problem. Otherwise you can try zipping up your project folder and uploading it somewhere (e.g. Dropbox) so that you can get better help -- the Ren'py forums or IRC channel are probably good options. – Dietrich Epp Aug 29 '13 at 05:47
1

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

Community
  • 1
  • 1
Serial
  • 7,925
  • 13
  • 52
  • 71
  • Thank you! How do I figure out which number it is so that I can make the number smaller? To clarify, I'm actually working with Ren'py, which I know has a lot of simplified terms, so I apologize if I'm being unclear. – pyopyon Aug 27 '13 at 03:40
  • Try looking at the Traceback of youre error and see which line it came from thats most likely where the program is trying to convert the long to a short – Serial Aug 27 '13 at 03:49
  • I'm... not quite sure how to decipher it, so I'm placing the full traceback in the original post, if that's okay;; – pyopyon Aug 27 '13 at 03:53
  • hmmmmm thats interesting im not sure im not familiar with renPy – Serial Aug 27 '13 at 03:54
  • Google isn't either, unfortunately, haha! Thank you anyway... I guess I'll keep hovering to see if anyone else knows cause I can't continue with this error blocking the way;; – pyopyon Aug 27 '13 at 04:25