History menu variation. Problem with realization. [SOLVED]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
lentlen
Newbie
Posts: 13
Joined: Fri Jan 24, 2020 9:27 pm
Completed: Shoot in the head (ru)
Projects: Backerei
Discord: lentlen#1606
Contact:

History menu variation. Problem with realization. [SOLVED]

#1 Post by lentlen »

Hello! I have a question about history screen in RenPy.

Now i'm working with it and my idea is:
History screen but with pictures like avatars instead of names of characters or pictures with characters name near. Now i reached one same pictures with every charater speech, but i want it to change depending on the character. Anyone know, is it possible to do with some standart features? Or it need a more complex solution because i tried use who.image_tag but image_tag is not image of character, just tag for emotion sprites... and if i know right, we can't assign picture to Character object, what is the history window referring to.
Last edited by lentlen on Fri Jan 28, 2022 10:56 pm, edited 1 time in total.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: History menu variation. Problem with realization.

#2 Post by Ocelot »

There are few solutions:
1) Parse who and select image depending on that (does not play well with translations)
2) Make sure that characters have image tag set and then select your image based on this tag (image tag is first part of image name, before attributes)
3) Create a history callback, which will append nessesary information to the history entry.
< < insert Rick Cook quote here > >

User avatar
lentlen
Newbie
Posts: 13
Joined: Fri Jan 24, 2020 9:27 pm
Completed: Shoot in the head (ru)
Projects: Backerei
Discord: lentlen#1606
Contact:

Re: History menu variation. Problem with realization.

#3 Post by lentlen »

Ocelot wrote: Mon Jan 24, 2022 3:26 am There are few solutions:
1) Parse who and select image depending on that (does not play well with translations)
2) Make sure that characters have image tag set and then select your image based on this tag (image tag is first part of image name, before attributes)
3) Create a history callback, which will append nessesary information to the history entry.
i want to ask more about second solution. i tried to use who.image_tag but all that was shown is name of character tag, not picture itself. so how i can set picture to character. it also need to be not sprite, just small 100x100px avatar.
or you mean set some tags and then use if else operator that will choose pictures depending on tag? but this remindes me first solution and maybe will have same problems?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: History menu variation. Problem with realization.

#4 Post by Ocelot »

Image tag is a string which can be used to construct an image. In any way you like. I created a quick project. First of all, I added foloowing to history screen:

Code: Select all

hbox:
    if h.image_tag:
        add "history " + h.image_tag
    else:
        null width 100
THen I wrote my script:

Code: Select all

define character.yesod = Character("Yesod", image="yesod")
image yesod smiling = "_YesodSmiling.png"
image history yesod = "yesod-6.png"

label start:
    show yesod smiling
    yesod "Hello"
    yesod ". . ."
    ". . ."
    yesod "Test"
    return
Results:
Image
< < insert Rick Cook quote here > >

User avatar
lentlen
Newbie
Posts: 13
Joined: Fri Jan 24, 2020 9:27 pm
Completed: Shoot in the head (ru)
Projects: Backerei
Discord: lentlen#1606
Contact:

Re: History menu variation. Problem with realization.

#5 Post by lentlen »

i'll try it after work, hope i can do it work too and also will try with different characters. thanks a lot.
if all be good, i'll post results and close theme.
_____
it works good. THANKS!

Post Reply

Who is online

Users browsing this forum: No registered users