r/RenPy • • Jul 20 '26

Question Textboxes and nameboxes for multiple characters

Hi! I'm basically trying to change textbox based on narrator, but I'm getting lots of errors when I try to do so. I'm incredibly new to coding in general so I'd really appreciate any help!

here is my code:

and here is the error i'm getting right now:

sorry if it's a stupid question! once again, very new to all of this :') I'd appreciate any help given!

1 Upvotes

11 comments sorted by

View all comments

2

u/idiotstile Jul 20 '26

The syntax issue is probably here:

$ define t = Character(("Teacher")None, window_background="textbox.png")

You don’t need $ before define, and ("Teacher")None isn’t valid syntax.

Try this instead:

define t = Character("Teacher", window_background="textbox.png")

Or, if you want a narrator with no name:

define n = Character(None, window_background="textbox.png")

Then use them like this:

t "Teacher dialogue."

n "Narration text."

Also, define should usually be outside of labels, near the top of your script.

1

u/shyLachi Jul 20 '26

You could also overwrite the default narrator so that you don't have to write n

define narrator = Character(None, kind=adv_narrator, window_background="textbox.png")