Variable in imagebutton path(name) [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
JinOptimist
Newbie
Posts: 8
Joined: Tue Apr 09, 2013 8:10 am
Projects: Carrier
Skype: JinOptimist
Location: Belarus, Minsk
Contact:

Variable in imagebutton path(name) [SOLVED]

#1 Post by JinOptimist »

Hi

I want do something like that:

Code: Select all

screen viewport_Urban_Elite:
  for elite in elites:
    imagebutton auto "img hero/Face [elite.name] %s.gif" action [ToggleVariable("showById", 0, elite.id)]
In this case I have error
Not a displayable: None

If I write this

Code: Select all

screen viewport_Urban_Elite:
  for elite in elites:
    imagebutton auto "img hero/Face 1 %s.gif" action [ToggleVariable("showById", 0, elite.id)]
I have no errors. But at the same image duplicated X times. That's not what I want

How can I do this?

Thanks
Last edited by JinOptimist on Thu Mar 05, 2015 5:13 am, edited 1 time in total.
Just smile.

Current Project: Carrier. [Sci-Fi]
Prepared at 20%

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

Re: Variable in imagebutton path(name)

#2 Post by philat »

If elites is a list of objects, have a separate field with the path. http://lemmasoft.renai.us/forums/viewto ... 88#p360107

User avatar
JinOptimist
Newbie
Posts: 8
Joined: Tue Apr 09, 2013 8:10 am
Projects: Carrier
Skype: JinOptimist
Location: Belarus, Minsk
Contact:

Re: Variable in imagebutton path(name)

#3 Post by JinOptimist »

Thank you very match!
It works!
Just smile.

Current Project: Carrier. [Sci-Fi]
Prepared at 20%

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Semrush [Bot]