Page 1 of 1

One Character with two stylings?

Posted: Mon Jan 14, 2019 7:38 pm
by recreation
I bet its the most simple thing, but I cant figure it out right now.
I have one character who's text should look different when he's thinking and not talking.
What I tried:

Code: Select all

define pc = Character("[pc]", who_color="#2b68b2")
define pcthink = Character("[pc]", who_italic=True, what_italic=True, what_color="#888", what_prefix="(", what_suffix=")")
This works for pcthink, but the 1st one stays the same color and doesn't do anything no matter what styling attributes I apply.

Code: Select all

define pc = Character("[pc]", who_color="#2b68b2")
define pcthink = Character("[pcthink]", who_italic=True, what_italic=True, what_color="#888", what_prefix="(", what_suffix=")")
...other stuff...
$ pc = renpy.input("Choose your name.")
$ pcthink = pc
Results in no styling applied to both (which actually makes sense if pcthink would inherit the styling from pc?).

I don't get it, what am I doing wrong?

Re: One Character with two stylings?

Posted: Mon Jan 14, 2019 8:43 pm
by philat
Don't use the same variable name for your character object and character name. In other words.

Code: Select all

define pc = Character("[pc_name]", who_color="#2b68b2")
define pcthink = Character("[pcthink_name]", who_italic=True, what_italic=True, what_color="#888", what_prefix="(", what_suffix=")")
...other stuff...
$ pc_name = renpy.input("Choose your name.")
$ pcthink_name = pc_name

Re: One Character with two stylings?

Posted: Mon Jan 14, 2019 8:44 pm
by Remix

Code: Select all

default pc_name = "???"
define pc = Character("[pc_name]", who_color="#2b68b2")
# char pc uses name pc_name (note that pc and pc_name are not the same)

define pcthink = Character("[pc_name] (thoughts)", who_italic=True, what_italic=True, what_color="#888", what_prefix="(", what_suffix=")")
# char uses same name

...other stuff...
$ pc_name = renpy.input("Choose your name.")

pc "This is me talking"
pc_think "This is me thinking"

Re: One Character with two stylings?

Posted: Mon Jan 14, 2019 9:24 pm
by recreation
Thanks you too. I was getting a headache because of this.

Re: One Character with two stylings?

Posted: Mon Jan 14, 2019 9:34 pm
by mitoky
Dont name your character and variable the same thing "pc". Otherwise it gives problems.
Add the italic stiling into the prefix/suffix (Tested, should work):

Code: Select all

define pc = Character("[pc_name]", who_color="#2b68b2")
define pcthink = Character("[pc_name]", who_color="#888", who_prefix='{i}', who_suffix='{/i}', what_prefix='({i}', what_suffix='{/i})')