What is a "python expression"?

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
Zamialillium
Newbie
Posts: 7
Joined: Fri Jun 10, 2016 8:33 am
Contact:

What is a "python expression"?

#1 Post by Zamialillium »

Hello,

I'm trying to learn the engine, and the tutorial doesn't explain what a python expression is, or a simple expression. Can anyone explain to me, like I'm 5, what it is? I couldn't find anything on google.

Thanks in advance <3

User avatar
saguaro
Miko-Class Veteran
Posts: 560
Joined: Sun Feb 12, 2012 9:17 am
Completed: Locked-In, Sunrise, The Censor
Organization: Lucky Special Games
itch: saguarofoo
Location: USA
Contact:

Re: What is a "python expression"?

#2 Post by saguaro »


Zamialillium
Newbie
Posts: 7
Joined: Fri Jun 10, 2016 8:33 am
Contact:

Re: What is a "python expression"?

#3 Post by Zamialillium »

I've tried to look at those already, and I quickly get confused by the many unknown words :/ I need to have it explained via small words and examples, like a child :P I've pasted some of my script(with some default script I used to learn the basics) below, so if anyone could point out where the python and simple expressions are, if there are any - also please, if possible, explain why and how you're able to tell :)

Thanks! ^^

transform topright:
xalign 1.0 yalign 0.0

transform bottomright:
xalign 1.0 yalign 1.0

transform topleft:
xalign 0.0 yalign 0.0

transform bottomleft:
xalign 0.0 yalign 1.0

transform sleft:
xalign .2

transform sright:
xalign .8

transform lcenter:
xalign .4

transform rcenter:
xalign .6

transform ltext:
xpos -.05 ypos 0.6


#Declare transformations

transform outl:
linear 1.0 xalign -1.0

transform outr:
linear 1.0 xalign 2.0

transform move_jump:
xalign 1.0 yalign 0.0
pause 1.0
xalign 1.0
repeat

transform move_slide:
xalign 1.0 yalign 0.0
linear 3.0 xalign 0.0

transform shake:
linear 0.01 xanchor -0.1
linear 0.01 xanchor 0.1
repeat
time 0.3
xanchor 0

# Declare transitions

define sdis = Dissolve(1.0)

define dis = Dissolve(.5)

define fade = Fade(.5, .5, .5)

define sfade = Fade(1.0, .5, 1.0)

#Declare BGs

image ethereal plane = "images/BGs/ethereal plane2.jpg"

# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"

image bg cave = "cave.jpg"
image bg wash = "bg washington.jpg"
image bg white = "bg whitehouse.jpg"
image bg band = "band.jpg"

image lucy happy = "lucy_happy.png"
image lucy mad = "lucy_mad.png"

image eileen happy = "eileen happy.png"
image eileen vhappy = "eileen vhappy.png"
image eileen con = "eileen concerned.png"

image logo = "logo.png"

# Declare Conditionswitchs



# Declare animations

image eileen ani1:
"eileen happy"
pause .5
"eileen vhappy"
pause .5
repeat

image eileen ani2:
"eileen happy"
pause .5
"eileen vhappy"

image bg atl trans1:
"bg wash" with dissolve
pause 1.0
"bg white" with dissolve
pause 1.0
repeat

# Declare characters used by this game.

define t = Character('Thunder', color="#ffd700")
define T = Character('???????', color="#ffd700")

define s = Character('Snow', color="#fffafa")
define S = Character('????', color="#fffafa")

define su = Character('Sunshine', color="#ff4500")
define SU = Character('????????', color="#ff4500")

define r = Character('Rain', color="#191970")
define R = Character('????', color="#191970")

define fr = Character('Frost', color="#b0e0e6")
define FR = Character('????', color="#b0e0e6")

define f = Character('Fog', color="#c0c0c0")
define F = Character('???', color="#c0c0c0")

define l = Character('Lily', color="#9400d3")

define h = Character('Helena', color="#ff1493")
define H = Character('??????', color="#ff1493")

define n = Character('Natalia', color="#a52a2a")
define N = Character('???????', color="#a52a2a")

define si = Character('Sidney', color="#6b8e23")
define SI = Character('??????', color="#6b8e23")

define r1 = Character('???', color="#666666")

define r2 = Character('????', color="#666699")


# The game starts here.
label start:

label CP_Prologue:

scene black
show text "{size=+25}{i}October{/i}{/size}" with sdis
pause
show text "{size=+10}{i}Thursday, 31st{/i}{/size}" with sfade
pause
hide text with sdis

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]