Flag and "points" with character

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
HikkiNeet
Newbie
Posts: 2
Joined: Thu Jan 29, 2015 8:44 pm
Location: Canada
Contact:

Flag and "points" with character

#1 Post by HikkiNeet »

Hello,

I'm writing this post because I'm in the process of programming my first VN and I've stumbled into a problem that's blocking me. Basically, some of your choice with have an impact on your relationship with a girl and will make you have different discussion with them/different scene with them depending on your amount of point your have.

I tried quite a lot of different manner and last time I tried inputting command, I ended up not being able to run the game at all and I had to rollback to a prior version. So I might seem like I haven't done a lot but I'm bit at a lost at that point. I will post what I think is pertinent, if you need any other information, I'll do my best to give it to you.

# The game starts here.
label start:

$ manson = 0
$ bundy = 0
$ gein = 0
$ dahmer = 0
$ gacy = 0
$ saki = 0


So these are the variable. I putted right at the beginning.

That's the first menu where you can gain point with one of the girl:

menu:
"In the common room":
$ manson += 1
jump CR1

"In the courtyard":
jump CY01

"Here in the cafeteria":
jump CF1


And that's the place where one of the first branching of different choice you made will happen.

menu:
"Got out in the courtyard"
if manson == 1:
jump CY13
elif manson ==0:
jump CY14

"Go to the common room"
jump CR1


I've got a bit lost in the variable and point being added to the different character/variable.

Some event would trigger different event with character depending on how many points they have and some other line of discussion.

Sorry if it's not so clear, english is not my native language.

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

Re: Flag and "points" with character

#2 Post by trooper6 »

You should put your code inside of [ code] [ /code] tags in your post (without the extra spaces) so we can see your indentation.

If you do that you code will look like this in the post:

Code: Select all

menu:
    "Go out in the courtyard":
        if manson == 1:
            jump CY13
        elif manson ==0:
            jump CY14
    "Go to the common room":
        jump CR1
Note: I added two missing colons...which would cause you menu to not work. When you are giving choices in a menu, you have to have a colon.
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
Darim
Regular
Posts: 67
Joined: Sun Jun 21, 2015 4:17 pm
Organization: Setsuna Ken
Github: SetsunaKen
Location: Germany
Contact:

Re: Flag and "points" with character

#3 Post by Darim »

Try this way: Put the variables with the init command above your start label.

Code: Select all

init:
     $ manson = 0
     $ bundy = 0
     $ gein = 0
     $ dahmer = 0
     $ gacy = 0
     $ saki = 0
# The game starts here.
label start:

So these are the variable. I putted right at the beginning.

That's the first menu where you can gain point with one of the girl:

menu:
"In the common room":
$ manson += 1
jump CR1

"In the courtyard":
jump CY01

"Here in the cafeteria":
jump CF1


And that's the place where one of the first branching of different choice you made will happen.

menu:
"Got out in the courtyard"
if manson == 1:
jump CY13
elif manson ==0:
jump CY14

"Go to the common room"
jump CR1

User avatar
HikkiNeet
Newbie
Posts: 2
Joined: Thu Jan 29, 2015 8:44 pm
Location: Canada
Contact:

Re: Flag and "points" with character

#4 Post by HikkiNeet »

Great, thanks a lot for the quick reply!

I'm starting to grasp more how the programming work. Now all the branching work properly.

User avatar
orz
Regular
Posts: 126
Joined: Tue Apr 21, 2015 10:19 pm
Contact:

Re: Flag and "points" with character

#5 Post by orz »

My only question is, why is there no Ridgway to romance?

Post Reply

Who is online

Users browsing this forum: Bing [Bot]