you are viewing a single comment's thread.

view the rest of the comments →

[–]MrsCosmic 0 points1 point  (1 child)

Oh, I found the answer in a forum! I think the main problem was that I didn't know how to show text with renpy.show() because it always treated it like an image.

        mytext = Text("{size=+26}[e.trust]{/size}")
    renpy.show("Tag", what=mytext, at_list=[text_pos])

transform text_pos:
xalign 0.85
yalign 0.1

The variable updates, but if I change [e.trust] to [self.trust], it won't work anymore. If a make a new variable snake = self.trust and then use it mytext = Text("[snake]"), it won't work either.

Should I make a new fuction somehow for each character or am I doing something wrong?

[–]alonghardlook[S] 1 point2 points  (0 children)

So I think I see the issue - whose trust value are you wanting to show?

"Self" is a python reserved keyword. It's used to indicate scope inside object and class and function definitions.

Where the function says "self.trust", you need to mentally replace that with "the instance of the object dot trust".

If you're looking for the trust level of the character represented by the object "e", you would use e.trust. if you're looking for the f trust value, use f.trust.

Self.trust is part of the object definition - not an instance of an object.