Hello!
I#m new here, and with ren'py.
So i know how to make questions in ren'py. But i would want to know something more.
for example i make a question, and if the player decides for yes or know, two diffrent roots for the next possible event can happen, when either of this event is finished the story follows the same route.
So what i want to do is this.
a long time after the decision i want to have it some influnce what kind of event habens.
Can i give if you chose yes an variable event01=1 and with an no event01=0
And can i make a decision like
menu:
"Yes, I do.":
jump choice1_yes
"No, I don't.":
jump choice1_no
label choice1_yes:
event01=1
$ menu_flag = True
story
jump choice1_done
label choice1_no:
event01=0
$ menu_flag = False
story
jump choice1_done
label choice1_done:
# ... the game continues here.
story
story
story
if event=1
then
Story
Story
Story
jump goal
else
story
story
story
jump goal
label goal
Can you help me please with the coding?
and sorry for my bad english
Variables and desicions
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.
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.
Re: Variables and desicions
special for preschool children who do not know about Google:
1) variable-an empty plate, in which you can put the cutlets, you can call it and say that it is empty, it zero cutlets:
2) the operator of assignment (sign"=") - we put the right amount of cutlets in a bowl, for example, just 2 pieces:
3) operator increment (variable increase, the sign"+") - add to the plate the desired number of cutlets. for example, to two in a plate add another:
# total their in plate now 3!
4) decrement (subtraction), read the previous paragraph. eat one cutlet:
5) condition - can be true or incorrect - - because 1 is not equal to 2, the result will be a lie. - because 1 is 1, the result is true. if you have your plate 2 cakes, and you'll tell the teacher that ate everything, you lie. is a lie. is a lie, because we have two cutlets left after eating one of the three. comparison operators are different, not only "equal" -, but also "unequal" -, more, less, etc.
6) conditional statement - if is our educator who checks if you tell him the truth or lie. and accordingly reacts on your statements.
else: otherwise. the block after this statement is executed if the statement in the if statement is false. for kindergarten will be difficult. let me explain by example.
if you came to the teacher with an empty plate and said that it was empty (if really kotletki == 0), then you told the truth, all ate and generally well done! you can go play.
if you said that you ate "skazal == 0", and the cutlet is greater than 0 (kotletki > 0), i.e. you did not eat everything, then you have to put in a corner for lying, then the block" else: "(otherwise) works.
example:
7) the choice whether to eat burgers
choosing what to say to the teacher after lunch
9) and now programmable reaction of a caregiver
10) forks and variables, you can do all you want, and checks too. in short, sculpt so many endings, how many leftist heel pleases.
if after this you do not understand the basics of programming, then I highly recommend you go to the neighbor
1) variable-an empty plate, in which you can put the cutlets, you can call it and say that it is empty, it zero cutlets:
Code: Select all
$ kotletki = 0
Code: Select all
$ kotletki = 2
Code: Select all
$ kotletki = kotletki + 1
4) decrement (subtraction), read the previous paragraph. eat one cutlet:
Code: Select all
$ kotletki = kotletki-1
Code: Select all
"1==2"
Code: Select all
"1 == 1"
Code: Select all
"2 == 0"
Code: Select all
"kotletki == 0"
Code: Select all
"=="
Code: Select all
"!="
6) conditional statement - if is our educator who checks if you tell him the truth or lie. and accordingly reacts on your statements.
else: otherwise. the block after this statement is executed if the statement in the if statement is false. for kindergarten will be difficult. let me explain by example.
if you came to the teacher with an empty plate and said that it was empty (if really kotletki == 0), then you told the truth, all ate and generally well done! you can go play.
if you said that you ate "skazal == 0", and the cutlet is greater than 0 (kotletki > 0), i.e. you did not eat everything, then you have to put in a corner for lying, then the block" else: "(otherwise) works.
example:
Code: Select all
if kotletki == 0:
....jump igrushki
else:
....jump ugol
Code: Select all
$ kotletki = 1
# one left
menu:
...."no, not go":
........pass # do nothing, skip the selection unit
...."okay, finish and last":
........$ kotletki = kotletki-1
Code: Select all
menu:
...."I ate it all!":
........$ skazal = 0
........pass
...."One chicken left. Never at a loss already":
........$ skazal = 1
Code: Select all
# if I said that everyone ate, we move on to the block where 0 is discussed cutlets
if skazal == 0:
....jump label 0
# otherwise, if there was no transition, the program will continue to run further
#f next we discuss 1 cutlet
if kotletki > 0:
...."boy, that is not lying. but the meatballs need to finish"
....jump start # starts all over again (instead of one of the endings)
else:
...."but you ate all the cutlets. why lie? boy, you moron? go to the doctor, check it out."
....jump doctor
# and here we discuss zero cutlets
label label0:
if kotletki == 0:
...."said he ate, really ate. muzhik! go ahead and play.":
....jump igrushki
else:
...."you said I ate, and then there are burgers! into a corner!"
....jump ugol
if after this you do not understand the basics of programming, then I highly recommend you go to the neighbor
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
Sawa - a game of the Drow Nation
Honest Critique
Poses in visual novels, or how to hold a character properly in the frame
Help save articles to the webarchive. [/color]
- jax63
- Newbie
- Posts: 2
- Joined: Fri Feb 16, 2018 2:41 pm
- Tumblr: jax63-polyporn
- Deviantart: jax63
- Contact:
Re: Variables and desicions
Thank you.
Who is online
Users browsing this forum: Ahrefs [Bot]