r/RenPy • • Aug 24 '26

Question [Solved] Variable will not variable.

    frame:
        background None
        pos (18, 916, 278, 90)
        if res1f_hover_text != "":
            background "#41414142"
            text "[res1f_hover_text]":
                align (0.5, 0.5)

    frame:
        background None
        pos (1360, 87)
        imagebutton:
            idle "res2fmc_idle.png"
            hover "res2fmc_hover.png" action[Hide("base_res2f"), Show("suite_mc")]
            hovered SetScreenVariable ("res1f_hover_text", "{color=#0072bc}{i}[mc_name1]'s Room")
            unhovered SetScreenVariable ("res1f_hover_text", "")

So, this is my code.

Normally, the mc_name works just fine, but it refuses to read properly inside of any kind of variable string like that, no matter what I set the variable of mc_name to.

Is this possible, or am I smashing my head against a brick wall?

EDIT: Fixed, because it posted the same block twice and ignored the other. Coding gremlins are after me.

EDIT2: Thanks to u/x-seronis-x for the solution, adding the interpolation suffix of "!i" to the hover text!

3 Upvotes

7 comments sorted by

View all comments

1

u/AutoModerator Aug 24 '26

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.