problem with the "show" keyword

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
shahab96
Veteran
Posts: 228
Joined: Mon May 24, 2010 5:40 am
Location: Lahore, Pakistan
Contact:

problem with the "show" keyword

#1 Post by shahab96 » Thu Jul 11, 2013 10:03 am

Its been a long time since i used renpy and i've run into a problem now with the show keyword.

Code: Select all

show Neo
Is causing the game to crash, i have no idea why. Here's the traceback.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/Chapter_1.rpy", line 15, in script
  File "game/screens.rpy", line 26, in python
IndexError: string index out of range

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

Full traceback:
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/execution.py", line 288, in run
    node.execute()
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/ast.py", line 453, in execute
    renpy.exports.say(who, what, interact=self.interact)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/exports.py", line 757, in say
    who(what, interact=interact)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/character.py", line 795, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/character.py", line 671, in do_display
    **display_args)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/character.py", line 450, in display_say
    what_text = show_function(who, what_string)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/character.py", line 655, in do_show
    **self.show_args)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/character.py", line 263, in show_display_say
    return renpy.display.screen.get_widget(screen, "what")
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/display/screen.py", line 620, in get_widget
    screen.update()
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/display/screen.py", line 266, in update
    self.screen.function(**self.scope)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/screenlang.py", line 1217, in __call__
    renpy.python.py_exec_bytecode(self.code.bytecode, locals=scope)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/python.py", line 1297, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/screens.rpy", line 26, in <module>
    text who id "who"
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/ui.py", line 448, in __call__
    w = self.function(*args, **keyword)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/text/text.py", line 1097, in __init__
    super(Text, self).__init__(**properties)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/display/core.py", line 131, in __init__
    self.style = renpy.style.Style(style, properties, heavy=True)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/style.py", line 837, in __init__
    build_style(self)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/style.py", line 646, in build_style
    my_updates.extend(expand_properties(p))
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/style.py", line 531, in expand_properties
    newval = func(val)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/easy.py", line 41, in color
    if c[0] == '#':
IndexError: string index out of range

Linux-3.8.0-26-generic-i686-with-debian-wheezy-sid
Ren'Py 6.15.7.374
A Ren'Py Game 0.0
I hope its just me doing something stupid '-'
The true measure of a man is what he does with his power.

User avatar
Suwamoto
Regular
Posts: 66
Joined: Wed Sep 05, 2012 7:36 am
Contact:

Re: problem with the "show" keyword

#2 Post by Suwamoto » Thu Jul 11, 2013 10:15 am

What is Neo? o.o; An image, a label, a screen?

User avatar
shahab96
Veteran
Posts: 228
Joined: Mon May 24, 2010 5:40 am
Location: Lahore, Pakistan
Contact:

Re: problem with the "show" keyword

#3 Post by shahab96 » Thu Jul 11, 2013 10:22 am

Neo is an image

i declared it properly aswell ;_;

Code: Select all

image Neo = "/Images/Characters/Neo.png"
edit: I've also tried using it as

Code: Select all

image Neo = "Images/Characters/Neo.png"
still wont work
The true measure of a man is what he does with his power.

User avatar
Suwamoto
Regular
Posts: 66
Joined: Wed Sep 05, 2012 7:36 am
Contact:

Re: problem with the "show" keyword

#4 Post by Suwamoto » Thu Jul 11, 2013 10:30 am

Try adding an attribute to it owo Like:

image Neo normal = "/Images/Characters/Neo.png"

And call it with

show Neo normal

User avatar
shahab96
Veteran
Posts: 228
Joined: Mon May 24, 2010 5:40 am
Location: Lahore, Pakistan
Contact:

Re: problem with the "show" keyword

#5 Post by shahab96 » Thu Jul 11, 2013 10:35 am

Just tried it, its crashing in the same way it was before.

Here's the traceback

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/Chapter_1.rpy", line 15, in script
  File "game/screens.rpy", line 26, in python
IndexError: string index out of range

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

Full traceback:
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/execution.py", line 288, in run
    node.execute()
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/ast.py", line 453, in execute
    renpy.exports.say(who, what, interact=self.interact)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/exports.py", line 757, in say
    who(what, interact=interact)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/character.py", line 795, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/character.py", line 671, in do_display
    **display_args)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/character.py", line 450, in display_say
    what_text = show_function(who, what_string)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/character.py", line 655, in do_show
    **self.show_args)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/character.py", line 263, in show_display_say
    return renpy.display.screen.get_widget(screen, "what")
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/display/screen.py", line 620, in get_widget
    screen.update()
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/display/screen.py", line 266, in update
    self.screen.function(**self.scope)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/screenlang.py", line 1217, in __call__
    renpy.python.py_exec_bytecode(self.code.bytecode, locals=scope)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/python.py", line 1297, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/screens.rpy", line 26, in <module>
    text who id "who"
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/ui.py", line 448, in __call__
    w = self.function(*args, **keyword)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/text/text.py", line 1097, in __init__
    super(Text, self).__init__(**properties)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/display/core.py", line 131, in __init__
    self.style = renpy.style.Style(style, properties, heavy=True)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/style.py", line 837, in __init__
    build_style(self)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/style.py", line 646, in build_style
    my_updates.extend(expand_properties(p))
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/style.py", line 531, in expand_properties
    newval = func(val)
  File "/home/shahab96/Documents/renpy-6.15.7-sdk/renpy/easy.py", line 41, in color
    if c[0] == '#':
IndexError: string index out of range

Linux-3.8.0-26-generic-i686-with-debian-wheezy-sid
Ren'Py 6.15.7.374
A Ren'Py Game 0.0
If it helps, the image itself is declared in script.rpy while the show keyword to show it is used in a different .rpy file within the same folder and project.
The true measure of a man is what he does with his power.

User avatar
Suwamoto
Regular
Posts: 66
Joined: Wed Sep 05, 2012 7:36 am
Contact:

Re: problem with the "show" keyword

#6 Post by Suwamoto » Thu Jul 11, 2013 10:44 am

Then nothing is wrong with the image. Try this
http://lemmasoft.renai.us/forums/viewto ... =8&t=18562
The first reply owo I guess it might be the same problem.

Or what are the first 15 lines in Chapter_1.rpy and 26 lines in screens.rpy?

User avatar
shahab96
Veteran
Posts: 228
Joined: Mon May 24, 2010 5:40 am
Location: Lahore, Pakistan
Contact:

Re: problem with the "show" keyword

#7 Post by shahab96 » Thu Jul 11, 2013 10:49 am

that fixed it... o.o thanks alot lol, i'll be careful with declarations now '-'
The true measure of a man is what he does with his power.

Post Reply

Who is online

Users browsing this forum: Google [Bot], ijffdrie