help for a choice menu

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
metaevar
Newbie
Posts: 15
Joined: Sat Jul 02, 2016 8:42 am
Deviantart: metaevar
Contact:

help for a choice menu

#1 Post by metaevar »

Hi there,

I come here again, searching for help, a lot of help :p

I explain, i try to make a choice :
If the player clic on the left portal he go to the "previously" of the first episode, and if he clic on the right portal the player start the game.

(image bellow)


Then second problem :

the player he's in front of a gate, this one is close.
The player have to clic on the gems in the right order if he want to oppen it, but i suck soooo.

(image in coming)
Attachments
dream march.jpg

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: help for a choice menu

#2 Post by indoneko »

I can't see the image. Is it just me?
My avatar is courtesy of Mellanthe

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: help for a choice menu

#3 Post by gas »

I'll send you the codes in 6/8 hours.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: help for a choice menu

#4 Post by gas »

Problem A
It's an imagemap.
While the right one use 'action Start()', the left one use 'action Start("Foo")' where foo is the label of that 'previously' chapter.

Problem B
I suppose a 4 code system.

Code: Select all

default code=[] #the code you input
default locks=["1","2","1","4"] # the correct sequence
default attempts=0 #the order of input

label start:
    "Let's guess the code"
    jump insertcode
    "bye!"
    $ renpy.full_restart()

label insertcode:
    call screen inputgem
    $ nowgem=_return
    $ code.append(nowgem)
    $ attempts +=1
    if attempts==4:
        if code==locks:
            "You did it!"
            return
        else:
            "Wrong code, try again!"
            $ attempts =0
            $ code=[]
            jump insertcode
    jump insertcode

screen inputgem():
    $ whatsleft = 4 - len(code)
    grid 4 1:
        xalign 0.5
        yalign 0.1
        for i in range(len(code)):
            $ nowthing=code[i]
            text "[nowthing]"
        for i in range (0,whatsleft):
            text "-"

    hbox:
        xalign 0.5
        yalign 0.6
        textbutton "gem1" action Return ("1")
        textbutton "gem2" action Return ("2")
        textbutton "gem3" action Return ("3")
        textbutton "gem4" action Return ("4")
This use textbuttons and text, but you can use imagebutton and add (I can PM a better code if you give me details).
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

metaevar
Newbie
Posts: 15
Joined: Sat Jul 02, 2016 8:42 am
Deviantart: metaevar
Contact:

Re: help for a choice menu

#5 Post by metaevar »

hi thank for help :)

for the menu choice i try but don't get anything, i know how to do image map, but i when i try to create a menu nothing append, or it crash...

here is my image map code :

Code: Select all

screen menu1:
        
       imagemap:
        
        ground 'dream m.jpg' 
        #hover 'intro pV2 hover.jpg'
        
        #alpha False
        
        hotspot (198, 52, 165, 327) action Start("previous")
        hotspot (983, 59, 162, 326) action start("next")
(i don't have hover for now)

I've done an intro and want to put the menu after this intro :

Code: Select all

label start:
    label start:
    
    nvl clear
    
    scene met
    with dissolve
    
    pause
    
    nvl clear
    
    scene ands
    with dissolve
    
    pause
    
    nvl clear

    scene elp
    with dissolve
    
    pause
    
    nvl clear
   
    scene presentent
    with dissolve
    
    pause
    
    hide presentent

    scene histoire with dissolve
    
    pause
    
    nvl clear
    
    scene tabu with dissolve
    
    pause

(insert menu here)
but, it dosen't work >_<

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: help for a choice menu

#6 Post by gas »

Issue A: mind the code. The hinting after imagemap: is wrong. always 4 spaces :), not 1. And the second Start is not capitalized.


Issue B:
label start:
label start:

that's why doesn't work.
This is correct.

Code: Select all

label start:   
    nvl clear
   
    scene met
    with dissolve
   
    pause
   
    nvl clear
   
    scene ands
    with dissolve
   
    pause
   
    nvl clear

    scene elp
    with dissolve
   
    pause
   
    nvl clear
   
    scene presentent
    with dissolve
   
    pause
   
    hide presentent

    scene histoire with dissolve
   
    pause
   
    nvl clear
   
    scene tabu with dissolve
   
    pause
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

metaevar
Newbie
Posts: 15
Joined: Sat Jul 02, 2016 8:42 am
Deviantart: metaevar
Contact:

Re: help for a choice menu

#7 Post by metaevar »

ok... so after many try my menu still don't work...
here my code

Code: Select all

    image dream march= "dream march.jpg"
    image dream march= "dream march hover.jpg"
    image dream march= "dream march idle.jpg"

    $ w = Character('', window_background="textbox wingate.png")
    $ s = Character('', window_background="textbox sokiout.png")
    $ f = Character('', window_background="textbox fulch.png")
    $ n = Character('', window_background="textbox narator.png")

    define narrator = Character(None, what_font="FLllana1.ttf", kind=nvl)

label Start:
    
    screen menu1:
        
       imagemap:
        
        ground 'dream march.jpg' 
        hover 'dream march hover.jpg'
        idle 'dream march idle.jpg'
        
        hotspot (198, 52, 165, 327) action Start("prev")
        hotspot (983, 59, 162, 326) action Start("story")
        
        
label prev:
    
    "text here"
    
    end prev
    
label story:
    
    "text here"
but nothing work >_<

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: help for a choice menu

#8 Post by indoneko »

Did you mean something like this?

Code: Select all

image dream march= "dream march.jpg"
image dream march= "dream march hover.jpg"
image dream march= "dream march idle.jpg"
$ w = Character('', window_background="textbox wingate.png")
$ s = Character('', window_background="textbox sokiout.png")
$ f = Character('', window_background="textbox fulch.png")
$ n = Character('', window_background="textbox narator.png")
define narrator = Character(None, what_font="FLllana1.ttf", kind=nvl)

screen menu1:
    imagemap:
        ground 'dream march.jpg'
        hover 'dream march hover.jpg'
        idle 'dream march idle.jpg'
        hotspot (198, 52, 165, 327) action Jump("prev")
        hotspot (983, 59, 162, 326) action Jump("story")
    
label start:     
    call screen menu1    
    return   
       
label prev:
    "text here"
    return
   
label story:
    "text here"
    return
My avatar is courtesy of Mellanthe

metaevar
Newbie
Posts: 15
Joined: Sat Jul 02, 2016 8:42 am
Deviantart: metaevar
Contact:

Re: help for a choice menu

#9 Post by metaevar »

thank all for the help, it work fine, and the code too :)

Post Reply

Who is online

Users browsing this forum: piinkpuddiin