'if not' label [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
Project_Astro
Newbie
Posts: 21
Joined: Wed Jun 13, 2018 1:02 pm
Projects: NeoLythe / Dark Investigations
Contact:

'if not' label [solved]

#1 Post by Project_Astro »

Well I was writing my script and something came in mind.
Is it possible to make a label that will run only if it's not already done ?
I know you can do something like this :

Code: Select all

play music "investigation.wav"
label enquêtepart1:
    menu:
        "Investigate" if not inspecter:
            play sound "choice sound.wav"
            $ preuve = True
            jump insp1
        "present" if preuve == True:
            play sound "choice sound.wav"
            $ move2 = True
            jump présenter1
        " Talk":
            play sound "choice sound.wav"
            $ move = True
            jump AndroQ1
        " Move" if move and move2:
            play sound "choice sound.wav"
            $ chi = False
            jump move1
label enquêtepart1_done:
    
label insp1:
$ inspecter = True
hide AndroSerious
with dissolve
But is it possible to make something that would look like this ? :

Code: Select all

label Corpseuh if not I11:
     play sound "choice sound.wav"
     $ I11 = True
h "Alors voilà notre homme..."
show AndySerious at center:
    yalign 0.3
a "Oui."
a "Il s'appelle Joan Feder, {w=0.3}c'est un écrivain."
h "Autre chose sur lui ?"
(I know that the second one doesn't work)
So do we have to make a menu for this ? Or is there an other way to do it ?

Or (I'm getting annoying I know) is it possible to jump to another label when the first is done so we won't have the same text and all ? (because in "Corpseuh" label, the player receives a paper, but it's a screen, so they can click on it anytime they want but I would like them to reveive it once, not twice and so on)
Last edited by Project_Astro on Sat Jun 16, 2018 10:30 am, edited 1 time in total.

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

Re: 'if not' label

#2 Post by gas »

You can just use a variable to register if the player had seen the label, if he does jump to another.

Code: Select all

default seen =False
label example:
    if seen == True:
        jump elsewhere
    e "Salut!"
    $ seen = True
This example label is executed only the first time, all further times jump instead to "elsewhere"
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
Project_Astro
Newbie
Posts: 21
Joined: Wed Jun 13, 2018 1:02 pm
Projects: NeoLythe / Dark Investigations
Contact:

Re: 'if not' label

#3 Post by Project_Astro »

Oh yes, I see ! Thank you very much, I'm gonna try this !

User avatar
Project_Astro
Newbie
Posts: 21
Joined: Wed Jun 13, 2018 1:02 pm
Projects: NeoLythe / Dark Investigations
Contact:

Re: 'if not' label

#4 Post by Project_Astro »

Thank you very much as I said. It works perfectly !

Post Reply

Who is online

Users browsing this forum: No registered users