Maximum length of string ?

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
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:

Maximum length of string ?

#1 Post by korova »

I've just bumped on a strange error in Ren'py.

I have a screen to display credits in my game.

Basically, I have one screen and pass different strings to the screen to display them.

Everything always worked fine, but here is the message error I got tonight :

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/clairobscur.rpy", line 981, in script call
    call credits_scrolling
  File "game/clairobscur.rpy", line 995, in script call
    call credits_generaux
  File "game/credits.rpy", line 16, in script
    pause
  File "renpy/common/000statements.rpy", line 363, in execute_pause
    renpy.pause()
Exception: Open text tag at end of string u"{b}Logiciels utilis\xe9s{/b}\n\nMoteur graphique : {a=http://www.renpy.org}Ren'py{/a}\n\nCr\xe9ation et retouche d'image : {a=http://www.gimp.org/}GIMP{/a} et filtres {a=http://gmic.eu/}G'Mic{/a".
So it seems that my string lacks a "}" at the end.

But look at my code !

Code: Select all

# Credits logiciels
    $ illu = "credits logiciels"
    $ details = _("{b}Logiciels utilisés{/b}\n\nMoteur graphique : {a=http://www.renpy.org}Ren'py{/a}\n\nCréation et retouche d'image : {a=http://www.gimp.org/}GIMP{/a} et filtres {a=http://gmic.eu/}G'Mic{/a}")
    show screen credit(type,illu, details)
    pause
the "}" is really there !

If I remove one character from the string, the error disappears.

So here is my question : is there a maximum length for a string ? (Is this normal ? Is this a bug ?)

There is no urge here, I can cut my string, but I am puzzled...

Thanks for your advice.

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: Maximum length of string ?

#2 Post by PyTom »

There shouldn't be a limit. What does the screen code look like?
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
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: Maximum length of string ?

#3 Post by korova »

Here is the relevant screen code

Code: Select all

screen credit(type,illu,details):
# type = l'écran est différent pour une image ou un fichier audio
# Illu = image qui sera affichée comme illustration (la photo, la couv de l'album, la représentation du bruitage)
# details = éléments pour la description (sous forme de tableau): auteur, nom de l'asset, licence, ...
    
            
    # À gauche : on a soit une simple image, soit image + boutons si c'est du son, donc un screen spécial (audio_illu)
    if type == "audio":
        use audio_illu(illu)
    else:
        add illu anchor (0.5,0.5) ypos 300 xpos 300
        
    # les items sont différents si on décrit une image ou du son (chacun a son propre screen)
    # on garde une solution par défaut où on reproduit simplement la chaine de caractère passée en argument
    if type == "audio":
        use audio_description(details)
    elif type == "image":
        use image_description(details)
    else:
        vbox:
            xpos 635
            ypos 100
            xsize 330
            text details style "st_credit"

style st_credit:
    color "#ccc"
There are "sub" screens, but not used there.

More complete error message

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/clairobscur.rpy", line 981, in script call
    call credits_scrolling from _call_credits_scrolling
  File "game/clairobscur.rpy", line 995, in script call
    call credits_generaux from _call_credits_generaux
  File "game/credits.rpy", line 16, in script
    pause
  File "renpy/common/000statements.rpy", line 363, in execute_pause
    renpy.pause()
Exception: Open text tag at end of string u"{b}Logiciels utilis\xe9s{/b}\n\nMoteur graphique : {a=http://www.renpy.org}Ren'py{/a}\n\nCr\xe9ation et retouche d'image : {a=http://www.gimp.org/}GIMP{/a} et filtres {a=http://gmic.eu/}G'Mic{/a".

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

Full traceback:
  File "game/clairobscur.rpy", line 981, in script call
    call credits_scrolling from _call_credits_scrolling
  File "game/clairobscur.rpy", line 995, in script call
    call credits_generaux from _call_credits_generaux
  File "game/credits.rpy", line 16, in script
    pause
  File "/home/psct/Programmes/renpy/renpy/ast.py", line 1641, in execute
    self.call("execute")
  File "/home/psct/Programmes/renpy/renpy/ast.py", line 1659, in call
    renpy.statements.call(method, parsed, *args, **kwargs)
  File "/home/psct/Programmes/renpy/renpy/statements.py", line 144, in call
    return method(parsed, *args, **kwargs)
  File "renpy/common/000statements.rpy", line 363, in execute_pause
    renpy.pause()
  File "/home/psct/Programmes/renpy/renpy/exports.py", line 1148, in pause
    rv = renpy.ui.interact(mouse='pause', type='pause', roll_forward=roll_forward)
  File "/home/psct/Programmes/renpy/renpy/ui.py", line 277, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/home/psct/Programmes/renpy/renpy/display/core.py", line 2276, in interact
    repeat, rv = self.interact_core(preloads=preloads, **kwargs)
  File "/home/psct/Programmes/renpy/renpy/display/core.py", line 2527, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "/home/psct/Programmes/renpy/renpy/display/core.py", line 341, in visit_all
    d.visit_all(callback)
  File "/home/psct/Programmes/renpy/renpy/display/core.py", line 341, in visit_all
    d.visit_all(callback)
  File "/home/psct/Programmes/renpy/renpy/display/core.py", line 341, in visit_all
    d.visit_all(callback)
  File "/home/psct/Programmes/renpy/renpy/display/screen.py", line 386, in visit_all
    self.child.visit_all(callback)
  File "/home/psct/Programmes/renpy/renpy/display/core.py", line 341, in visit_all
    d.visit_all(callback)
  File "/home/psct/Programmes/renpy/renpy/display/core.py", line 341, in visit_all
    d.visit_all(callback)
  File "/home/psct/Programmes/renpy/renpy/display/core.py", line 338, in visit_all
    for d in self.visit():
  File "/home/psct/Programmes/renpy/renpy/text/text.py", line 1346, in visit
    self.update()
  File "/home/psct/Programmes/renpy/renpy/text/text.py", line 1329, in update
    tokens = self.tokenize(text)
  File "/home/psct/Programmes/renpy/renpy/text/text.py", line 1644, in tokenize
    tokens.extend(textsupport.tokenize(i))
  File "renpy/text/textsupport.pyx", line 117, in renpy.text.textsupport.tokenize (gen/renpy.text.textsupport.c:3380)
    raise Exception("Open text tag at end of string {0!r}.".format(s))
Exception: Open text tag at end of string u"{b}Logiciels utilis\xe9s{/b}\n\nMoteur graphique : {a=http://www.renpy.org}Ren'py{/a}\n\nCr\xe9ation et retouche d'image : {a=http://www.gimp.org/}GIMP{/a} et filtres {a=http://gmic.eu/}G'Mic{/a".

Linux-3.16.0-4-686-pae-i686-with-debian-stretch-sid
Ren'Py 6.99.4.467
clairobscur 0.1
Sorry, comments are written in french in my code because... I'm french !
If you need further details....

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: Maximum length of string ?

#4 Post by PyTom »

I think I need the entire game. Could you send it to me, modified so that when I start the game it goes straight to the credits?
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
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: Maximum length of string ?

#5 Post by korova »

You can download my project here :
https://bitbucket.org/Korova08/clairobs ... 123bbc.zip
you have a button on the main menu to access directly to the credits.

You will see scrolling credits (that works OK), you have to click on the button "Crédits détaillés" on the upper right corner.
Fist screen works OK, you click and the next screen is wherre the error arrives.

Thank you for your help.

Post Reply

Who is online

Users browsing this forum: No registered users