Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Fri May 24, 2013 3:16 pm

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat Mar 24, 2012 6:20 pm 
Newbie

Joined: Mon Feb 20, 2012 3:33 pm
Posts: 10
I've been working on this script for awhile and there's always something wrong with it but I think I have it now except....for this one error

Code:
 You can place the script of your game in this file.

# Declare images below this line, using the image statement.
image bed = "bedroomday.png"
image class = "classroomday.png"
image hall = "hallwayday.png"
image stairs = "hstairsday.png"
image room = "roomday.png"
image school = "schoolday.png"
image nurse = "nurseday.png"
image up = "GreenButton_UpArrow.svg.png"
image down = "GreenButton_DownArrow.svg.png"
image left = "GreenButton_LeftArrow.svg.png"
image right = "GreenButton_RightArrow.svg.png"
# Declare characters used by this game.

init:
 $ esubtitle = Character(None,
                            what_size=28,
                            what_outlines=[(3, "#0008", 2, 2), (3, "#000", 0, 0)],
                            what_layout="subtitle",
                            what_xalign=0.5,
                            what_text_align=0.5,
                            window_background=None,
                            window_yminimum=0,
                            window_xfill=False,
                            window_xalign=0.5)
 screen NRJ:
     text "Energy 10/10"
screen hp:
    text "Energy 9/10"
screen scan:
    textbutton "Scan" action Jump("read")
screen lets_go:
    imagebutton auto "GreenButton_UpArrow.svg.png" action Jump("up") (693, 479, 59, 32)
    imagebutton auto "GreenButton_DownArrow.svg.png" action Jump("down") (696, 563, 59, 32)
    imagebutton auto "GreenButton_LeftArrow.svg.png" action Jump("left") (627, 518, 59, 32)
    imagebutton auto "GreenButton_RightArrow.svg.png" action Jump("right") (726, 513, 59, 32)
    # The game starts here.
label start:
    scene school
    show screen NRJ
    esubtitle "Welcome to the Anarchy Institute."
    esubtitle "Go ahead inside..."
    show screen lets_go
label up:
    scene room
    show screen hp
    show screen scan
    esubtitle "I wonder what this room is for."
label read:
    esubtitle "This is it?"
label down:
    scene stairs
    esubtitle "I wonder where these stairs go..."
    esubtitle "Hmmm.."
   
label left:
    scene nurse
    esubtitle "The nurse.."
label right:
    scene hall
    esubtitle "The classes must be down this hall."


And this is the error

Code:
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 50, in script
        esubtitle "I wonder what this room is for."
  File "game/script.rpy", line 35, in python
        imagebutton auto "GreenButton_UpArrow.svg.png" action Jump("up") (693, 479, 59, 32)
TypeError: __call__() takes exactly 1 argument (5 given)

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

Full traceback:
  File "F:\renpy-6.13.7\renpy\execution.py", line 261, in run
  File "F:\renpy-6.13.7\renpy\ast.py", line 396, in execute
  File "F:\renpy-6.13.7\renpy\exports.py", line 696, in say
  File "F:\renpy-6.13.7\renpy\character.py", line 770, in __call__
  File "F:\renpy-6.13.7\renpy\character.py", line 664, in do_display
  File "F:\renpy-6.13.7\renpy\character.py", line 471, in display_say
  File "F:\renpy-6.13.7\renpy\ui.py", line 237, in interact
  File "F:\renpy-6.13.7\renpy\display\core.py", line 1798, in interact
  File "F:\renpy-6.13.7\renpy\display\core.py", line 2036, in interact_core
  File "F:\renpy-6.13.7\renpy\display\core.py", line 246, in visit_all
  File "F:\renpy-6.13.7\renpy\display\core.py", line 246, in visit_all
  File "F:\renpy-6.13.7\renpy\display\core.py", line 246, in visit_all
  File "F:\renpy-6.13.7\renpy\display\core.py", line 248, in visit_all
  File "F:\renpy-6.13.7\renpy\display\core.py", line 2036, in <lambda>
  File "F:\renpy-6.13.7\renpy\display\screen.py", line 152, in per_interact
  File "F:\renpy-6.13.7\renpy\display\screen.py", line 244, in update
  File "F:\renpy-6.13.7\renpy\screenlang.py", line 1166, in __call__
  File "F:\renpy-6.13.7\renpy\python.py", line 978, in py_exec_bytecode
  File "game/script.rpy", line 35, in <module>
TypeError: __call__() takes exactly 1 argument (5 given)

Windows-Vista-6.0.6000
Ren'Py 6.13.7.1646
A Ren'Py Game 0.0


So my question is what's the error and are the imagebuttons right? And are there any other mistakes?

Thanks


Last edited by vitum on Sun Mar 25, 2012 5:38 pm, edited 1 time in total.

Top
 Profile Send private message  
 
PostPosted: Sat Mar 24, 2012 7:10 pm 
Veteran
User avatar

Joined: Wed Nov 18, 2009 11:17 am
Posts: 359
Location: Germany
Completed: Loren
Projects: PS2
Your imagebutton declarations are wrong, try it this way:
Code:
imagebutton auto "GreenButton_UpArrow.svg.png" action Jump("up") area (693, 479, 59, 32)

_________________
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase II


Top
 Profile Send private message  
 
PostPosted: Sun Mar 25, 2012 1:25 am 
Newbie

Joined: Mon Feb 20, 2012 3:33 pm
Posts: 10
I tried that and got this error

Code:
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 50, in script
        esubtitle "I wonder what this room is for."
  File "game/script.rpy", line 35, in python
        imagebutton auto "GreenButton_UpArrow.svg.png" action Jump("up") area (693, 479, 59, 32)
TypeError: not all arguments converted during string formatting

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

Full traceback:
  File "F:\renpy-6.13.7\renpy\execution.py", line 261, in run
  File "F:\renpy-6.13.7\renpy\ast.py", line 396, in execute
  File "F:\renpy-6.13.7\renpy\exports.py", line 696, in say
  File "F:\renpy-6.13.7\renpy\character.py", line 770, in __call__
  File "F:\renpy-6.13.7\renpy\character.py", line 664, in do_display
  File "F:\renpy-6.13.7\renpy\character.py", line 471, in display_say
  File "F:\renpy-6.13.7\renpy\ui.py", line 237, in interact
  File "F:\renpy-6.13.7\renpy\display\core.py", line 1798, in interact
  File "F:\renpy-6.13.7\renpy\display\core.py", line 2036, in interact_core
  File "F:\renpy-6.13.7\renpy\display\core.py", line 246, in visit_all
  File "F:\renpy-6.13.7\renpy\display\core.py", line 246, in visit_all
  File "F:\renpy-6.13.7\renpy\display\core.py", line 246, in visit_all
  File "F:\renpy-6.13.7\renpy\display\core.py", line 248, in visit_all
  File "F:\renpy-6.13.7\renpy\display\core.py", line 2036, in <lambda>
  File "F:\renpy-6.13.7\renpy\display\screen.py", line 152, in per_interact
  File "F:\renpy-6.13.7\renpy\display\screen.py", line 244, in update
  File "F:\renpy-6.13.7\renpy\screenlang.py", line 1166, in __call__
  File "F:\renpy-6.13.7\renpy\python.py", line 978, in py_exec_bytecode
  File "game/script.rpy", line 35, in <module>
  File "F:\renpy-6.13.7\renpy\ui.py", line 435, in __call__
  File "F:\renpy-6.13.7\renpy\ui.py", line 695, in _imagebutton
  File "F:\renpy-6.13.7\renpy\ui.py", line 691, in choice
  File "common/00library.rpy", line 380, in imagemap_auto_function
TypeError: not all arguments converted during string formatting

Windows-Vista-6.0.6000
Ren'Py 6.13.7.1646
A Ren'Py Game 0.0


Top
 Profile Send private message  
 
PostPosted: Sun Mar 25, 2012 1:32 am 
Veteran
User avatar

Joined: Wed Nov 18, 2009 11:17 am
Posts: 359
Location: Germany
Completed: Loren
Projects: PS2
The problem is your usage of auto, Ren'Py expects the image name string to interpolate the button state.
Look here in the documentation for examples and a further explanation.

_________________
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase II


Top
 Profile Send private message  
 
PostPosted: Sun Mar 25, 2012 4:37 pm 
Newbie

Joined: Mon Feb 20, 2012 3:33 pm
Posts: 10
Ok so do I have to use selected idle, selected hover, hovered and unhovered or can I keep it like this,

Code:
screen lets_go:
    imagebutton idle "up_arrow.jpg" action Jump('up') area (693, 479, 59, 32)
    imagebutton hover "up_arrow.jpg" action Jump('up') area  (693, 479, 59, 32)
    imagebutton idle "down_arrow.jpg" action Jump('down') area  (696, 563, 59, 32)
    imagebutton hover "down_arrow.jpg" action Jump('down') area (696, 563, 59, 32)
    imagebutton idle "left_arrow.jpg" action Jump('left') area  (627, 518, 59, 32)
    imagebutton hover "left_arrow.jpg" action Jump('left') area  (627, 518, 59, 32)
    imagebutton idle "right_arrow.jpg" action Jump('right')  area (726, 513, 59, 32)
    imagebutton hover "right_arrow.jpg" action Jump('right') area (726, 513, 59, 32)


This is the error

Code:
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 54, in script
        esubtitle "I wonder what this room is for."
  File "game/script.rpy", line 35, in python
        imagebutton idle "up_arrow.jpg" action Jump('up') area (693, 479, 59, 32)
Exception: Not a displayable: None

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

Full traceback:
  File "F:\renpy-6.13.7\renpy\execution.py", line 261, in run
  File "F:\renpy-6.13.7\renpy\ast.py", line 396, in execute
  File "F:\renpy-6.13.7\renpy\exports.py", line 696, in say
  File "F:\renpy-6.13.7\renpy\character.py", line 770, in __call__
  File "F:\renpy-6.13.7\renpy\character.py", line 664, in do_display
  File "F:\renpy-6.13.7\renpy\character.py", line 471, in display_say
  File "F:\renpy-6.13.7\renpy\ui.py", line 237, in interact
  File "F:\renpy-6.13.7\renpy\display\core.py", line 1798, in interact
  File "F:\renpy-6.13.7\renpy\display\core.py", line 2036, in interact_core
  File "F:\renpy-6.13.7\renpy\display\core.py", line 246, in visit_all
  File "F:\renpy-6.13.7\renpy\display\core.py", line 246, in visit_all
  File "F:\renpy-6.13.7\renpy\display\core.py", line 246, in visit_all
  File "F:\renpy-6.13.7\renpy\display\core.py", line 248, in visit_all
  File "F:\renpy-6.13.7\renpy\display\core.py", line 2036, in <lambda>
  File "F:\renpy-6.13.7\renpy\display\screen.py", line 152, in per_interact
  File "F:\renpy-6.13.7\renpy\display\screen.py", line 244, in update
  File "F:\renpy-6.13.7\renpy\screenlang.py", line 1166, in __call__
  File "F:\renpy-6.13.7\renpy\python.py", line 978, in py_exec_bytecode
  File "game/script.rpy", line 35, in <module>
  File "F:\renpy-6.13.7\renpy\ui.py", line 435, in __call__
  File "F:\renpy-6.13.7\renpy\ui.py", line 711, in _imagebutton
  File "F:\renpy-6.13.7\renpy\display\behavior.py", line 682, in __init__
  File "F:\renpy-6.13.7\renpy\easy.py", line 129, in displayable
Exception: Not a displayable: None

Windows-Vista-6.0.6000
Ren'Py 6.13.7.1646
A Ren'Py Game 0.0


Top
 Profile Send private message  
 
PostPosted: Mon Mar 26, 2012 3:07 pm 
Veteran
User avatar

Joined: Wed Nov 18, 2009 11:17 am
Posts: 359
Location: Germany
Completed: Loren
Projects: PS2
Okay, let's start with a simpler button concept and go to the full imagebutton from there.
Try the following:
Code:
button:
    background "up_arrow.jpg"
    area (693, 479, 59, 32)
    action Jump('up')

That should get you a working button at the least.

_________________
Avatar created with this deviation by Crysa
Currently working on:
  • Winterwolves "Planet Stronghold 2" - RPG Framework: Phase II


Top
 Profile Send private message  
 
PostPosted: Mon Mar 26, 2012 6:47 pm 
Newbie

Joined: Mon Feb 20, 2012 3:33 pm
Posts: 10
So is this the only way to make direction buttons? Or is there another way?


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group