Solved - hide a character name until he has been introduced?

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.
Post Reply
Message
Author
webryder
Regular
Posts: 40
Joined: Thu Feb 06, 2014 9:46 pm
Contact:

Solved - hide a character name until he has been introduced?

#1 Post by webryder »

Hi all,

I have my game setup so that if a character has not been introduced yet it shows

?????

instead of the character name. I have it set up like this...

Code: Select all

define doctor = Character('Rensont', color="#d3d3d3", ctc=anim.Blink("arrow.png"))

    "{color=d3d3d3}?????{/color}" "Wait, don't move! "
    "{color=d3d3d3}?????{/color}" "I saw you fall from across the street. That looked like a nasty bump on the head. "
    "{color=d3d3d3}?????{/color}" "I'm Doctor Rensont. Let me take a look at you before you get up. "
    doctor "You have the beginning of a big bump on your head, but other than that you seem to be ok. You can get up now. "
I do this for all the characters the player meets. It works as is, but the problem I'm running into is getting the ctc to work with the dialogue that starts with ?????. Each character has a different color associated with their name, so I didn't want to just create a new ????? character to get the ctc to work.

Any suggestions?

Thanks!
Last edited by webryder on Fri Feb 07, 2014 2:28 pm, edited 1 time in total.

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How to hide a character name until he has been introduce

#2 Post by philat »

Code: Select all

define doctor = Character('[doctor]', color="#d3d3d3", ctc=anim.Blink("arrow.png"))

    $ doctor = "?????"

    doctor "Wait, don't move! "
    doctor "I saw you fall from across the street. That looked like a nasty bump on the head. "
    doctor "I'm Doctor Rensont. Let me take a look at you before you get up. "

    $ doctor = "doctor"

    doctor "You have the beginning of a big bump on your head, but other than that you seem to be ok. You can get up now. "
Something like this should be easier to use.
Last edited by philat on Fri Feb 07, 2014 12:48 pm, edited 1 time in total.

SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Re: How to hide a character name until he has been introduce

#3 Post by SundownKid »

Or define 2 characters and use the first one to represent the "hidden name" version.

webryder
Regular
Posts: 40
Joined: Thu Feb 06, 2014 9:46 pm
Contact:

Re: How to hide a character name until he has been introduce

#4 Post by webryder »

philat wrote:

Code: Select all

define doctor = Character('[doctor]', color="#d3d3d3", ctc=anim.Blink("arrow.png"))

    $ doctor = "?????"

    doctor "Wait, don't move! "
    doctor "I saw you fall from across the street. That looked like a nasty bump on the head. "
    doctor "I'm Doctor Rensont. Let me take a look at you before you get up. "

    $ doctor = "doctor"

    doctor "You have the beginning of a big bump on your head, but other than that you seem to be ok. You can get up now. "
Something like this should be easier to use.
Just tried this and it loses the color and ctc.
SundownKid wrote:Or define 2 characters and use the first one to represent the "hidden name" version.
I was hoping to not have to make duplicates of all my characters for one or two lines of dialogue...

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How to hide a character name until he has been introduce

#5 Post by philat »

Ah, sorry, didn't think through the details enough. The problem is that the character and the variable are both 'doctor'. Change one of them to something else (e.g. define doctor = Character('[dr]', color, ctc) ) and it should work.

webryder
Regular
Posts: 40
Joined: Thu Feb 06, 2014 9:46 pm
Contact:

Re: How to hide a character name until he has been introduce

#6 Post by webryder »

Found the solution!

I ended up using DynamicCharacter instead of character - it works like this...

Code: Select all

define doctor = DynamicCharacter("doc_name", color="#d3d3d3", ctc=anim.Blink("arrow.png"))

$ doc_name = "?????"

#and then later I can change the name using 
$ doc_name = "Rensont"
That let me keep the color and the ctc without putting in duplicate character lines.

webryder
Regular
Posts: 40
Joined: Thu Feb 06, 2014 9:46 pm
Contact:

Re: Solved - hide a character name until he has been introdu

#7 Post by webryder »

This also does the same thing:

Code: Select all

define doctor = Character("doc_name", color="#d3d3d3", ctc=anim.Blink("arrow.png"), dynamic = True)

Post Reply

Who is online

Users browsing this forum: No registered users