Writer, Wanderer, Wonderer

Tutorial: How to create a character that the player can name in a Ren’Py visual novel.

Someone very nicely asked how I did this in Must Love Jaws (where the player can name the shark), so I’ve made a tutorial. :)

(This is my first tutorial, I’m nervous!)

  1. Okay, so first you pull up the script where you want this scene to happen. I wrote some conversation between Matt and Bernard that leads to them naming the shark. (Lines 606-611)
  2. Matt wants to name him “Bruce.” I added a Menu option where Bernard (the player) can agree with this, or pick a name themselves. (Lines 613-618)
  3. Now this is where it get’s interesting: At Line 625, you need to type what you want to use as the label for the shark’s name (I used shark_name. Just remember that you’ll have to type it out EVERY time you use the shark’s name in dialogue), what you want the textbox to say (I wrote “I need to think up a better name for the shark”), and the character limit (meaning how many letters the name can be. I used a character limit of 10, so I typed length=10). Adding a character limit is important, because if the player chooses a long name, it could cause the text to go off-screen! 0_o
  4. Lines 627-628: Removes spaces if the player added one in the name.
  5. Lines 632-633: This code is in case the player leaves it blank.
  6. Lines 635-636: If the player types in Bruce, the name Matt suggested, the game acts as if the player agrees with Matt’s original suggestion.
  7. Lines 657-659: The player picking the name, followed by Bernard saying the name in conversation.
  8. EXTRA CREDIT - Lines 638-655: This code is for creating custom responses to certain names. I made it so that if you name the shark “Ogu Pigu,” (I did this in case ChrisTenarium played the game, which he did. XD ) Matt gets mad and changes the name to “Dave.” Also, if you name the shark “Dave,” Matt notes how it’s a plain name, but goes along with it anyway. You can also use this code to prevent the player from using swear words or other characters’ names.

I think that’s about it? Any questions, just let me know! Hope this helps. :)

  1. sweetlywingedcreation reblogged this from katy-133
  2. walonde reblogged this from katy-133
  3. katy-133 reblogged this from fatmoonbear and added:
    Glad I could help!
  4. fatmoonbear reblogged this from katy-133 and added:
    yo this saved my LIFE. thank you!
  5. lylynyan reblogged this from daeva-agas
  6. lntellectual reblogged this from katy-133
  7. daeva-agas reblogged this from katy-133
  8. elliotli reblogged this from katy-133
  9. douteshani reblogged this from a-box-o-jills
  10. a-box-o-jills reblogged this from katy-133
  11. bokutokoutarowife reblogged this from katy-133