remember player choices in planner

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
Mii
Newbie
Posts: 11
Joined: Thu Feb 19, 2015 9:26 am
Contact:

remember player choices in planner

#1 Post by Mii »

i was wondering if there was a way for renpy to remember the choices made in the dating sim engine framework? (the weekly planner part that is) so that the player can either make a choice of what they want to do during the week or just repeat their last chosen activities for the week?

Onishion
Veteran
Posts: 295
Joined: Mon Apr 20, 2015 10:36 am
Contact:

Re: remember player choices in planner

#2 Post by Onishion »

I'm not familiar with the details of that framework, but I imagine you could just store the player's choices in a list, and then read that list if they want to repeat it?

Mii
Newbie
Posts: 11
Joined: Thu Feb 19, 2015 9:26 am
Contact:

Re: remember player choices in planner

#3 Post by Mii »

as i am still quite new to ren'py and coding in general is there any example you can give on how to do this?

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: remember player choices in planner

#4 Post by trooper6 »

Hi Mii, dealing with variables is a more a Python thing than a RenPy thing. May I recommend you take the Beginners Python course from the website CodeAcademy? It is very, very good and it will make your life doing complex things in Renpy/Python much easier. If you only want to do basic renpy things like show text and some sprites, you don't need to worry about Python things. But since you want to do more complex things like schedules and day planners, etc, and you don't know how to make a list, you really should do the CodeAcademy course.
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

philat
Eileen-Class Veteran
Posts: 1920
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: remember player choices in planner

#5 Post by philat »

Not that lists aren't worth studying, but you don't really have to use lists depending on how you set up your schedule screen. If you use SetVariable as the action, the next time the scheduler is called, the buttons will be selected according to the prior choice. Example:

Code: Select all

label start:
    $ day_act = None

label loop:
    # $ day_act = None ##uncomment this line to have the scheduler 'reset' every loop
    call screen scheduler
    "You chose: [day_act]"
    jump loop

screen scheduler():
    textbutton "1" action SetVariable("day_act", 1)
    textbutton "2" action SetVariable("day_act", 2)

Mii
Newbie
Posts: 11
Joined: Thu Feb 19, 2015 9:26 am
Contact:

Re: remember player choices in planner

#6 Post by Mii »

thank you for answering the solution worked perfectly, i should of played with the code some more. i was just afraid of breaking something

Post Reply

Who is online

Users browsing this forum: Google [Bot]