Page 1 of 1
conditional image and variable
Posted: Sun Jul 14, 2019 7:12 am
by Vandaris
hey all...
i want to ask something
on my VN, i have 4 girl to have ending (whatever it good or bad). then, i want put love image or symbol at left side of character name and then, every time the variable change (the variable increase is from choices) the love image or symbol is changed colour. maybe smiliar as harvest moon dialouge style. please help me.

Re: conditional image and variable
Posted: Sun Jul 14, 2019 10:43 am
by Kia
you can edit the character's name using: $ girl1.name = "♥ Aiko"
an maybe few text tags for coloring
Re: conditional image and variable
Posted: Sun Jul 14, 2019 11:04 am
by Milkymalk
Use a variable reference as the name and change the variable, as seen here:
viewtopic.php?f=8&t=56009&p=514661#p514694
Another option, though more complicated, would be to edit the speech boxes, but that's only necessary if you have changeable names and want to use the variable contents in instances where the ♥ is not wanted.
Re: conditional image and variable
Posted: Sun Jul 14, 2019 11:49 am
by Vandaris
ok guys. im inspire.
how can i replace name colour.
for example,
if affection poin = 0, the name colour is black
if affection poin = 1, the name colour is blue
if affection poin = 2, the name colour is green
etc. owh sorry im really new here
Re: conditional image and variable
Posted: Sun Jul 14, 2019 3:59 pm
by Crazy Li
The easiest way is to probably make multiple character definitions for each color (like if the character's name was sue, you could have sue1, sue2, and sue3) and then when it's time to show the dialog, have an if check on the value of the affection variable and pick the appropriate character. Something like
Code: Select all
$ sue1 = Character("Sue", color="#000000")
$ sue2 = Character("Sue", color="#0000FF")
$ sue3 = Character("Sue", color="#008000")
#check affection level
if affection == 0:
sue1 "I don't like you."
elif affection == 1:
sue2 "You're okay."
else:
sue3 "I love you!"
basic, barebones idea anyway.
Re: conditional image and variable
Posted: Wed Jul 17, 2019 10:34 pm
by Kia
Vandaris wrote: ↑Sun Jul 14, 2019 11:49 am
how can i replace name colour.
there are two main approaches, one by editing the character:
or by editing the say screen in the screens.rpy. this one requires a bit more knowledge about screens and styles.