Please Help Me Create Puzzle In Ren'py Novel :( (Solved)

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
vocaloidimai
Regular
Posts: 26
Joined: Sat May 05, 2012 10:38 am
Contact:

Please Help Me Create Puzzle In Ren'py Novel :( (Solved)

#1 Post by vocaloidimai »

In Ren'py
Can i make puzzle in the Novel ?
Just puzzle simply like this video ^^!

http://www.youtube.com/watch?v=OGRuECVk ... re=related
http://www.youtube.com/watch?v=0pgYRmHXe5E

Please Help & Thanks.
Last edited by vocaloidimai on Wed Aug 01, 2012 5:34 am, edited 1 time in total.

User avatar
Sharm
Miko-Class Veteran
Posts: 558
Joined: Mon May 07, 2012 4:39 pm
Projects: Twin Crowns, Weather Wizard
Contact:

Re: Please Help Me Create Puzzle In Ren'py Novel :(

#2 Post by Sharm »

Well, here's a tutorial to do a puzzle with square pieces. With a little creativity it could be used like the second example. http://lemmasoft.renai.us/forums/viewto ... 51&t=16151 I bet you could also use this one http://lemmasoft.renai.us/forums/viewto ... 51&t=16151 to help you built a different sort of game. A simple "input the right answer game" wouldn't be too hard, just a matter of using variable inputs correctly. I'm still a newb at programming so I can't really walk you through it. Good luck!
Works in Progress: Twin Crowns | Weather Wizard

User avatar
vocaloidimai
Regular
Posts: 26
Joined: Sat May 05, 2012 10:38 am
Contact:

Re: Please Help Me Create Puzzle In Ren'py Novel :(

#3 Post by vocaloidimai »

Sharm wrote:Well, here's a tutorial to do a puzzle with square pieces. With a little creativity it could be used like the second example. http://lemmasoft.renai.us/forums/viewto ... 51&t=16151 I bet you could also use this one http://lemmasoft.renai.us/forums/viewto ... 51&t=16151 to help you built a different sort of game. A simple "input the right answer game" wouldn't be too hard, just a matter of using variable inputs correctly. I'm still a newb at programming so I can't really walk you through it. Good luck!
Uh....
Maybe can i make the Picture have info about Puzzle
Like mean Puzzle text & Player just write answer ?
Link Image : http://up.ssc.vn/images/30001.png
Behind the text is image Puzzle
If player answered correctly or not - what step i make continue ? )
Thank You for Jigsaw Puzzle ^^
I will try to make it ^^

A - What program can make Image 3D ~> 2D ?
If someone know please tell me ^^
Thanks

User avatar
Sharm
Miko-Class Veteran
Posts: 558
Joined: Mon May 07, 2012 4:39 pm
Projects: Twin Crowns, Weather Wizard
Contact:

Re: Please Help Me Create Puzzle In Ren'py Novel :(

#4 Post by Sharm »

Yes, I meant having the player write the answer like the name entry in Ren'py's demo. It sounds like you're in over your head though, you may want to get used to making a simple game before you dive in to such complex customizations. To do these things you'll either need a programmer or be willing to become one yourself.
Works in Progress: Twin Crowns | Weather Wizard

User avatar
vocaloidimai
Regular
Posts: 26
Joined: Sat May 05, 2012 10:38 am
Contact:

Re: Please Help Me Create Puzzle In Ren'py Novel :(

#5 Post by vocaloidimai »

Sharm wrote:Yes, I meant having the player write the answer like the name entry in Ren'py's demo. It sounds like you're in over your head though, you may want to get used to making a simple game before you dive in to such complex customizations. To do these things you'll either need a programmer or be willing to become one yourself.
Uh :(
But i don't know something like this :(
Maybe i wait someone can help me :(
Thank You Very Much.

KimiYoriBaka
Miko-Class Veteran
Posts: 636
Joined: Thu May 14, 2009 8:15 pm
Projects: Castle of Arhannia
Contact:

Re: Please Help Me Create Puzzle In Ren'py Novel :(

#6 Post by KimiYoriBaka »

With a little creativity it could be used like the second example
the downside to doing that would be that the cardgame stacks are designed to allow free placement, which is how players normally would go about a tangram puzzle.
Maybe i wait someone can help me
this is a bit hard, since every type of puzzle in any video game will have it's own subtleties and thus needs to be coded differently. this is true no matter what engine/language you use.

since it's simple enough though, I can answer how to have the player type in the answer. before that, though, make sure you've read the renpy documentation at least through the first several sections, because otherwise this won't make any sense to you. firstly the function for getting input from the text box is renpy.input(). it's used as follows

Code: Select all

$ response = renpy.input(question)
where question is the question in quotation marks and response becomes whatever the player puts in. the classic example is asking the player's name which would look like

Code: Select all

$ playername = renpy.input("What is your name?")
once you have that, next is to check to what the player put and then have the program respond accordingly. For this, it's best to use the if statement to check a modified version of the player's response. For example:

Code: Select all

if response.strip() == "5":
    "Your response was 5"
else:
    "Your response wasn't 5"
strip() takes out any spaces the player might accidently put before or after the answer. lower() is also useful if you don't want the answer to be case sensitive. to use both just put them one after another so it'd be response.strip().lower(). that's enough for a riddle that only requires one answer, or even multiple if you don't feel like paying attention to good game design.

if you want a riddle that requires multiple answers such a the one in the example, you can repeat the line for getting the player input, but with a different variable each time, and preferably some way to return to a previous spot in case the player changes his/her mind. having different variables is simple enough (just use "and" to check multiple at once) but returning to a previous spot isn't as simple.

to do so, you need to either put a button on the screen for going back (I'm not going to explain that here), or tell your player something they can enter in to show that they've changed their mind. having them not put anything is a good choice and looks like this:

Code: Select all

    "To go back, just press enter without typing anything"
    label part1:
        $ response1 = renpy.input("How many green ones are there?")
    label part2:
        $ response2 = renpy.input("How many red ones are there?")
        if response2.strip() = "":
            jump part1
    if response1.strip() == "4" and response2.strip() == "3":
        jump correct
    else:
        jump incorrect
some other things that would be good to note:
--If you want to have the riddle as a paragraph of text on the screen at the same time as the input, you can show the text as an image like so:

Code: Select all

show text "How much wood would a woodchuck chuck if a woodchuck could chuck wood?"
--If you want to restrict the player to only entering in digits (highly recommended) you can adjust the renpy.input() usage as so:

Code: Select all

$ response = renpy.input(question, allow='0123456789')

User avatar
vocaloidimai
Regular
Posts: 26
Joined: Sat May 05, 2012 10:38 am
Contact:

Re: Please Help Me Create Puzzle In Ren'py Novel :(

#7 Post by vocaloidimai »

KimiYoriBaka wrote:

Code: Select all

    "To go back, just press enter without typing anything"
    label part1:
        $ response1 = renpy.input("How many green ones are there?")
    label part2:
        $ response2 = renpy.input("How many red ones are there?")
        if response2.strip() = "":
            jump part1
    if response1.strip() == "4" and response2.strip() == "3":
        jump correct
    else:
        jump incorrect
Uh....
About code Puzzle ^^!
Can i make one response?
Thanks.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]