Ren'Py [SOLVED]String Format : again and again

GoldenD

Member
Sep 30, 2018
102
70
Hi guys,
when I think it's finish, another case arises from the shadow...

Look at :
Python:
.../...
    $ listDialog = [
    ( classStory( last = 1, dialog="Here is one story line.\n{i}%s- Here is a Talk ?{/i}\nAnother story Line" % (Narrator.fontColor)))
    ]
    myString = "Here is one story line.\n{i}%s- Here is a Talk ?{/i}\nAnother story Line" % (Narrator.fontColor)

.../...
The problem is with string tags. If I use a common string variable, myString here, all is ok.
If I use a class with string propertie "dialog", the first tag {i} is good, but the endind tag {/i} isn't properly interpreted.

An idea ?
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
Hi guys,
when I think it's finish, another case arises from the shadow...
You haven't shown us enough of the code to know what is going on. In particular, how things are actually being displayed. So we have no way of knowing whether the string inside classStory() itself has gotten transformed in a way you don't expect, or if this is a problem with how the string is then used later one. Also, what is the contents of Narrator.fontColor?

The first thing I would do is to use the Ren'py developer console to examine the "dialog" value inside your classStory() object and see if it looks correct.
 

GoldenD

Member
Sep 30, 2018
102
70
You haven't shown us enough of the code to know what is going on. In particular, how things are actually being displayed. So we have no way of knowing whether the string inside classStory() itself has gotten transformed in a way you don't expect, or if this is a problem with how the string is then used later one. Also, what is the contents of Narrator.fontColor?

The first thing I would do is to use the Ren'py developer console to examine the "dialog" value inside your classStory() object and see if it looks correct.
It's ok. Your question about Narrator.fontColor is the way to correct because I open a color flag and no close.
Thanks a lot.
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
It's ok. Your question about Narrator.fontColor is the way to correct because I open a color flag and no close.
Thanks a lot.
Glad you got it sorted.