Optional image declaring

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
Vnigma
Regular
Posts: 29
Joined: Wed Sep 16, 2015 6:43 pm
Projects: Origin of War
Organization: VNigma
Contact:

Optional image declaring

#1 Post by Vnigma » Wed Sep 16, 2015 6:59 pm

I have this problem that i need some help to fix, this code always defines the image (p1_stand) as the second image, for some reason i cant get the if statement to work:

Code: Select all

if player1=="Red":
    image p1_stand="Red_stand.png"
elif player1=="Blue": 
    image p1_stand="Blue_stand.jpg"
the same things happens when i use transforms inside the if statement, please if anyone can help and/or offer an alternative code because i really use a lot of motions in my vn and this will save me a tremendous amount of time.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3679
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Optional image declaring

#2 Post by trooper6 » Wed Sep 16, 2015 7:10 pm

a) This should be in the Renpy Questions thread rather than here.
b) What you are looking for in terms of the images is the ConditionSwitch. It is documented here: http://www.renpy.org/doc/html/displayab ... tionSwitch
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
Vnigma
Regular
Posts: 29
Joined: Wed Sep 16, 2015 6:43 pm
Projects: Origin of War
Organization: VNigma
Contact:

Re: Optional image declaring

#3 Post by Vnigma » Sat Oct 03, 2015 6:26 pm

tyvm this helped me alot

Post Reply

Who is online

Users browsing this forum: No registered users