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.
i've entered to my game in progress the "in-games massages system".
and i want to create an on-screen button so the user can enter the massages screen when ever he wants.
i've tried
init python:
# Give us some space on the right side of the screen.
style.window.right_padding = 100
def toggle_skipping():
config.skipping = not config.skipping
show_button_game_menu = True
def button_game_menu():
if show_button_game_menu:
# to save typing
ccinc = renpy.curried_call_in_new_context
ui.vbox(xpos=0.99, ypos=0.98, xanchor='right', yanchor='bottom')
ui.textbutton("Massages", clicked=ccinc("$ show_messages()"xminimum=80)
ui.close()
config.overlay_functions.append(button_game_menu)
and i get the eror:
"ScriptError: could not find label ' $ show_messages()'."
and i get the eror:
"ScriptError: could not find label ' $ show_messages()'."
The problem is that show_messages() is a Python function, and call_in_new_context only jumps to Ren'Py labels. So you need to replace your call with something like:
It should be without the init or init python - it looks to me that the error in that case is that you've written " messages" in the ccinc call instead of "messages" - there shouldn't be any spaces between the word 'messages' and the quotes surrounding it, but it looks like you have a space immediately before the first 'm'.
(Arguably this is a bit of a Ren'Py bug, as labels can't have spaces at the beginning or end, so Ren'Py should probably trim them off. But it doesn't, so you need to be careful not to have extraneous spaces when referring to labels.)
ok now it works thanks!
can i put in another script insteed of the Script.rpy?so it won't make a mess out of the script.rpy??
edit:
never mind (:
i used the Jump command
thanks again!