[SOLVED] :!: Help with points/choice system?

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
xydrate
Newbie
Posts: 4
Joined: Wed Oct 08, 2014 9:24 pm
Contact:

[SOLVED] :!: Help with points/choice system?

#1 Post by xydrate »

Alright, so my visual novel relies heavily on the points system, I've gotten pretty far without much help and this is the last thing I need to figure out and I can't find any help on the forums about this specific thing, sorry if I missed an how-to on this but I couldn't seem to find it after hours of countless searching.

Alright now to the problem;

How can I get a dialogue option in the menu: to ONLY appear with a specific amount of points? I've tried everything I've tried "if Character_Points >=7" (I'm typing that off the top of my head so that example might not be correct) but I don't know what to do I hate asking but I'm stumped. I only want it to appear with a certain amount of approval points or at least grayed out that would be great too I just have no idea and I'm not sure what to copy and paste of what I have so far so yeah just tell me. I hope I explained this properly, PLEASE HELP.
Last edited by xydrate on Fri Oct 10, 2014 9:05 pm, edited 1 time in total.

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: :!: Help with points/choice system?

#2 Post by Kia »

Code: Select all

        if Character_Points< 6:
            do something
        else:
            do something else
if you are getting any error copy them here to see what's wrong and if you can't make it work bring our code and let people look for errors

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: :!: Help with points/choice system?

#3 Post by trooper6 »

What you are looking for is on this page of the documentation:

http://www.renpy.org/doc/html/menus.html
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
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: :!: Help with points/choice system?

#4 Post by Milkymalk »

Do it like this:

Code: Select all

menu:
    "First choice, always there":
        do stuff
    "Second choice" if Character_Points >= 7:
        do stuff
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

xydrate
Newbie
Posts: 4
Joined: Wed Oct 08, 2014 9:24 pm
Contact:

Re: :!: Help with points/choice system?

#5 Post by xydrate »

Milkymalk wrote:Do it like this:

Code: Select all

menu:
    "First choice, always there":
        do stuff
    "Second choice" if Character_Points >= 7:
        do stuff
I've tried the >=7 thing the option shows up no matter what the points are

@ the top answer:
how do I implement this? I'm kind of confused lol like how do I implement it in the "menu:"
like this is my code

Code: Select all

      menu:
          "\"Please Blixa can you help?\"":
            $ Nick_Points += 1
            $ affection += 1
            play sound "nice1.ogg"
            show nickgood at topright with dissolve
            jump ambush
            
          "\"Screw this.\"":
            $ Nick_Points -= 1
            $ affection -= 1
            play sound "no.wav"
            show nickbad at topright with dissolve
            jump ambush
            
          "\"Let's find another way, Nick he's not prepared.\"": 
            jump ambush
          
           if Nick_Points< 7:
          
          "[[CONVICE NICK TO APOLOGIZE]":
            jump blixahelp
obviously I'm confused on where to put the if statement it doesn't work as I have it now

User avatar
HidekiKun
Newbie
Posts: 14
Joined: Thu Sep 18, 2014 3:47 pm
Projects: Red Ties
Tumblr: hideki-husbando
Deviantart: vissnande
Skype: resu-baka
Soundcloud: Cicinee
Location: Cananadia
Contact:

Re: :!: Help with points/choice system?

#6 Post by HidekiKun »

Code: Select all

            "[[CONVICE NICK TO APOLOGIZE]" if Nick_Points> 7:
            jump blixahelp
I don't know if this is exactly the right answer (since I'm still learning my way around with Ren'Py as well). Have you tried using the variable viewer in the developer menu to check if you had under/over 7 points during the times it still appeared?

xydrate
Newbie
Posts: 4
Joined: Wed Oct 08, 2014 9:24 pm
Contact:

Re: :!: Help with points/choice system?

#7 Post by xydrate »

^ Yep I did check and I have a meter in the corner which equals 11
but I made another save with points below 7 and it still shows up

xydrate
Newbie
Posts: 4
Joined: Wed Oct 08, 2014 9:24 pm
Contact:

Re: :!: Help with points/choice system?

#8 Post by xydrate »

HidekiKun wrote:

Code: Select all

            "[[CONVICE NICK TO APOLOGIZE]" if Nick_Points> 7:
            jump blixahelp
I don't know if this is exactly the right answer (since I'm still learning my way around with Ren'Py as well). Have you tried using the variable viewer in the developer menu to check if you had under/over 7 points during the times it still appeared?


HOLY CRAP I JUST TRIED THIS AND IT WORKED I SWEAR I DID THIS SAME CODE BEFORE?????????????? BUT WHATEVER IT WORKED THANK YOU SOSOSOSOSO MUCH

User avatar
HidekiKun
Newbie
Posts: 14
Joined: Thu Sep 18, 2014 3:47 pm
Projects: Red Ties
Tumblr: hideki-husbando
Deviantart: vissnande
Skype: resu-baka
Soundcloud: Cicinee
Location: Cananadia
Contact:

Re: [SOLVED] :!: Help with points/choice system?

#9 Post by HidekiKun »

Aah I'm glad to help!! ;v;

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: [SOLVED] :!: Help with points/choice system?

#10 Post by Milkymalk »

It's how it's done so of course it works ;-)
Your problem was probably in the variable itself, you just didn't find it and then corrected it without noticing. I know this "but that's how I was trying it the whole time" thing myself :D
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

Post Reply

Who is online

Users browsing this forum: barsunduk, dragondatingsim