[SOLVED] Make Player Be Able To Put Their Desired Name ?

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
pratomoastan
Regular
Posts: 39
Joined: Fri Mar 11, 2016 11:39 am
Projects: My High School Life
Organization: After School Things
Deviantart: pratomoastan
Location: Indonesia
Contact:

[SOLVED] Make Player Be Able To Put Their Desired Name ?

#1 Post by pratomoastan »

How to make the players could add their own name to the game : already try this https://www.renpy.org/wiki/renpy/doc/co ... r_own_name
its gave me an error

How to add a splash screen ?

Should i use this ? :

Code: Select all

label splashscreen:

    $ renpy.movie_cutscene('filename.ogv')

    return
How to make main menu music stop when the game start ?
Should i use

Code: Select all

stop music 
after

Code: Select all

label start:
Last edited by pratomoastan on Sun Jul 03, 2016 12:02 pm, edited 1 time in total.

User avatar
pratomoastan
Regular
Posts: 39
Joined: Fri Mar 11, 2016 11:39 am
Projects: My High School Life
Organization: After School Things
Deviantart: pratomoastan
Location: Indonesia
Contact:

Got Error

#2 Post by pratomoastan »

Code: Select all

 
    scene bg white
    
    nrt "One day in a school"
    
    renpy.music.play("bell.wav")
    renpy.music.stop()
    
    scene bg clsrm
    
    renpy.music.play("clscht.wav")
    
    str "Hi, my name is Eko"

    "Hi, my name is %(p_name)."

    return

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/script.rpy", line 55: expected statement.
    renpy.music.play("bell.wav")
                                ^

File "game/script.rpy", line 56: expected statement.
    renpy.music.stop()
                      ^

File "game/script.rpy", line 60: expected statement.
    renpy.music.play("clscht.wav")
                                  ^

Ren'Py Version: Ren'Py 6.99.9.1168

User avatar
pratomoastan
Regular
Posts: 39
Joined: Fri Mar 11, 2016 11:39 am
Projects: My High School Life
Organization: After School Things
Deviantart: pratomoastan
Location: Indonesia
Contact:

More Error !!

#3 Post by pratomoastan »

Code: Select all

I'm sorry, but an uncaught exception occurred.

After initialization, but before game start.
  File "game/screens.rpy", line 254, in prepare_screen
    screen file_picker():
  File "game/screens.rpy", line 254, in prepare
    screen file_picker():
  File "game/screens.rpy", line 256, in prepare
    frame:
  File "game/screens.rpy", line 256, in prepare
    frame:
  File "game/screens.rpy", line 259, in prepare
    has vbox
  File "game/screens.rpy", line 259, in prepare
    has vbox
  File "game/screens.rpy", line 263, in prepare
    hbox:
  File "game/screens.rpy", line 263, in prepare
    hbox:
  File "game/screens.rpy", line 269, in prepare
    textbutton _("Auto"):
  File "game/screens.rpy", line 269, in prepare
    textbutton _("Auto"):
  File "renpy/common/00action_file.rpy", line 508, in __init__
    self.page = str(page)
  File "game/screens.rpy", line 254, in prepare_screen
    screen file_picker():
  File "game/screens.rpy", line 254, in prepare
    screen file_picker():
  File "game/screens.rpy", line 256, in prepare
    frame:
  File "game/screens.rpy", line 256, in prepare
    frame:
  File "game/screens.rpy", line 259, in prepare
    has vbox
  File "game/screens.rpy", line 259, in prepare
    has vbox
  File "game/screens.rpy", line 263, in prepare
    hbox:
  File "game/screens.rpy", line 263, in prepare
    hbox:
  File "game/screens.rpy", line 269, in prepare
    textbutton _("Auto"):
  File "game/screens.rpy", line 269, in prepare
    textbutton _("Auto"):
  File "renpy/common/00action_file.rpy", line 508, in __init__
    self.page = str(page)
Exception: Cannot start an interaction in the middle of an interaction, without creating a new context.

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

Full traceback:
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\bootstrap.py", line 277, in bootstrap
    renpy.main.main()
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\main.py", line 472, in main
    run(restart)
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\main.py", line 85, in run
    renpy.display.screen.prepare_screens()
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\display\screen.py", line 827, in prepare_screens
    s.ast.prepare_screen()
  File "game/screens.rpy", line 254, in prepare_screen
    screen file_picker():
  File "game/screens.rpy", line 254, in prepare
    screen file_picker():
  File "game/screens.rpy", line 256, in prepare
    frame:
  File "game/screens.rpy", line 256, in prepare
    frame:
  File "game/screens.rpy", line 259, in prepare
    has vbox
  File "game/screens.rpy", line 259, in prepare
    has vbox
  File "game/screens.rpy", line 263, in prepare
    hbox:
  File "game/screens.rpy", line 263, in prepare
    hbox:
  File "game/screens.rpy", line 269, in prepare
    textbutton _("Auto"):
  File "game/screens.rpy", line 269, in prepare
    textbutton _("Auto"):
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\python.py", line 1485, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "<screen language>", line 270, in <module>
  File "renpy/common/00action_file.rpy", line 508, in __init__
    self.page = str(page)
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\character.py", line 841, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\character.py", line 690, in do_display
    **display_args)
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\character.py", line 493, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\ui.py", line 277, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\display\core.py", line 2425, in interact
    repeat, rv = self.interact_core(preloads=preloads, **kwargs)
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\display\core.py", line 2481, in interact_core
    renpy.display.screen.prepare_screens()
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\display\screen.py", line 827, in prepare_screens
    s.ast.prepare_screen()
  File "game/screens.rpy", line 254, in prepare_screen
    screen file_picker():
  File "game/screens.rpy", line 254, in prepare
    screen file_picker():
  File "game/screens.rpy", line 256, in prepare
    frame:
  File "game/screens.rpy", line 256, in prepare
    frame:
  File "game/screens.rpy", line 259, in prepare
    has vbox
  File "game/screens.rpy", line 259, in prepare
    has vbox
  File "game/screens.rpy", line 263, in prepare
    hbox:
  File "game/screens.rpy", line 263, in prepare
    hbox:
  File "game/screens.rpy", line 269, in prepare
    textbutton _("Auto"):
  File "game/screens.rpy", line 269, in prepare
    textbutton _("Auto"):
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\python.py", line 1485, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "<screen language>", line 270, in <module>
  File "renpy/common/00action_file.rpy", line 508, in __init__
    self.page = str(page)
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\character.py", line 841, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\character.py", line 690, in do_display
    **display_args)
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\character.py", line 493, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\ui.py", line 277, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\prato\Downloads\Programs\renpy-6.99.9-sdk\renpy\display\core.py", line 2402, in interact
    raise Exception("Cannot start an interaction in the middle of an interaction, without creating a new context.")
Exception: Cannot start an interaction in the middle of an interaction, without creating a new context.

Windows-8-6.2.9200
Ren'Py 6.99.9.1168
myhighschool 0.0

Code: Select all

  scene bg white
    
    nrt "One day in a school"
    
    $ renpy.play("bell.wav")
    $ renpy.stop()
    
    scene bg clsrm
    
    $ renpy.play("clscht.wav")
    
    str "Hi, my name is Eko"

    "Hi, my name is %(p_name)."
    
    $ renpy.stop()
    
    return

User avatar
firecat
Miko-Class Veteran
Posts: 540
Joined: Sat Oct 25, 2014 6:20 pm
Completed: The Unknowns Saga series
Projects: The Unknown Saga series
Tumblr: bigattck
Deviantart: bigattck
Skype: bigattck firecat
Soundcloud: bigattck-firecat
Contact:

Re: How to make the players could add their own name to the

#4 Post by firecat »

you using the old codes that doesn't work anymore and i see that you did the code wrong at the same time. this is how its done: https://www.renpy.org/doc/html/input.html

this is how the code works now a days: https://www.renpy.org/doc/html/quickstart.html
Image


Image


special thanks to nantoka.main.jp and iichan_lolbot

User avatar
pratomoastan
Regular
Posts: 39
Joined: Fri Mar 11, 2016 11:39 am
Projects: My High School Life
Organization: After School Things
Deviantart: pratomoastan
Location: Indonesia
Contact:

Re: How to make the players could add their own name to the

#5 Post by pratomoastan »

Oh thanks !! it's worked

Post Reply

Who is online

Users browsing this forum: No registered users