How do I clear side image attributes?

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
jackmcbarn
Newbie
Posts: 7
Joined: Wed Feb 24, 2016 3:56 pm
Github: jackmcbarn
Contact:

How do I clear side image attributes?

#1 Post by jackmcbarn »

After I use say with image attributes, how do I remove the attributes without replacing them with new ones? Assume that I have 'side eileen.png', 'side eileen mad.png', and 'side eileen happy.png'.

Code: Select all

define e = Character("Eileen", image="eileen")
define se = Character("Someone else")

label start:
    e "This will show the 'side eileen' image"
    e "This will still show the 'side eileen' image"
    e mad "This will show the 'side eileen mad' image"
    e "This will still show the 'side eileen mad' image"
    e happy "This will show the 'side eileen happy' image"
    se "The tags get remembered even if someone else talks in between"
    e "This will still show the 'side eileen happy' image"
So in this example, how do I get back to showing just 'side eileen'?

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: How do I clear side image attributes?

#2 Post by _ticlock_ »

Hi, jackmcbarn,

Any world will work if it is not in the pool of attributes. Renpy is looking for the best match of attributes, so if you don't use happy and add another non-pool attribute, the best match is default image side eileen. Try this example:

Code: Select all

label start:
    e "e default"
    e happy "e happy"
    e None "e default"
    e happy "e happy"
    e default "e default"
    e happy "e happy"
    e d "e default"
    e happy default "THIS IS e happy"
Last edited by _ticlock_ on Sun Jan 10, 2021 8:09 am, edited 1 time in total.

philat
Eileen-Class Veteran
Posts: 1910
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How do I clear side image attributes?

#3 Post by philat »

Don't remember if this was ever added to the docs where it should be (looking at it now, I guess not?), but -attribute should work with side images. You can also use @ attribute for one-line only attributes.

Code: Select all

label start:
    e "This will show the 'side eileen' image"
    e mad "This will show the 'side eileen mad' image"
    e -mad "Back to 'side eileen'."

jackmcbarn
Newbie
Posts: 7
Joined: Wed Feb 24, 2016 3:56 pm
Github: jackmcbarn
Contact:

Re: How do I clear side image attributes?

#4 Post by jackmcbarn »

philat wrote: Sun Jan 10, 2021 5:10 am Don't remember if this was ever added to the docs where it should be (looking at it now, I guess not?), but -attribute should work with side images. You can also use @ attribute for one-line only attributes.

Code: Select all

label start:
    e "This will show the 'side eileen' image"
    e mad "This will show the 'side eileen mad' image"
    e -mad "Back to 'side eileen'."
This doesn't work the way you'd think it would. It seems like it's just replacing the attribute with one called "-mad" and not just removing the one called "mad". In particular, if I make a file called "side eileen -mad.png", it will switch to it.

philat
Eileen-Class Veteran
Posts: 1910
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: How do I clear side image attributes?

#5 Post by philat »

Huh. Weird. Figured that it would support the new - and @ notation but guess that's just for layered images. Guess you can always force it by providing a nonexistent attribute as pointed out above.

Post Reply

Who is online

Users browsing this forum: Google [Bot], piinkpuddiin