create a secret scene
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.
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.
create a secret scene
hi, by advance sorry for my bad english i'm french.
i am the developer of a game called "Galaxy"
i'm new in renpy and i would like to hide a secret scene if the player click on a place in background.
but i would like that if is not clicked the story continue on another background is it possible?
i am the developer of a game called "Galaxy"
i'm new in renpy and i would like to hide a secret scene if the player click on a place in background.
but i would like that if is not clicked the story continue on another background is it possible?
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: create a secret scene
Sure.
You just need a screen with modal False (should be False by default)
In your screen, place an imagebutton and have it unlock your secret scene.
So for example
Depending on how you want the game to be structured, you might use Jump, instead of Call.
You just need a screen with modal False (should be False by default)
In your screen, place an imagebutton and have it unlock your secret scene.
So for example
Code: Select all
screen secret_screen() :
modal False
imagebutton:
idle "path to image"
hover "path to image"
focus_mask True
xpos 100
ypos 100
action Call("secret_scene")
label start:
show screen secret_screen
"dialogue goes here."
hide secret_screen
label more_dialogue:
"the secret button is gone now. You missed your chance!"
return
label secret_scene:
"sacré bleu, but Monsieur, this is a secret. How did you find it!?"
return
Last edited by Imperf3kt on Tue Jan 22, 2019 3:00 pm, edited 2 times in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: create a secret scene
Or you can do it this way also
make menu first like this and put it at the beginning of the game
then make a label
and put it at the end of the game
make menu first like this and put it at the beginning of the game
Code: Select all
if not (persistent.route1_seen and persistent.route2_seen):
jump beginning
menu path_choices:
nav "selection"
"Start from beginning":
jump beginning
"Start from after OP":
jump op
"Risa extra scenario":
$ route_1 = True
jump extra1
"Kana & Kuu extra scenario":
$ route_2 = True
jump extra2
"Seika & Kaie extra scenario":
$ route_2 = True
jump extra3
return
Code: Select all
label extra2 or label extra3
Re: create a secret scene
i think the best for me is the Imperf3kt solution but when i click it continue the story and show the secret scene after
Code: Select all
screen secret() :
modal False
imagebutton:
idle "secret.png"
hover "secret.png"
focus_mask True
xpos 100
ypos 100
action Jump("cache")
label start:
show secret
"bla bla"
"bla bla"
"bla bla"
hide secret
scene ver6
"story continue"
label cache:
scene ven2
"secret here"
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: create a secret scene
You need a return before the secret label, otherwise renpy treats it as part of the previous label (labels are mostly just jump points and renoy ignores them in dialogue flow unless told to go there)
Like this. (there are some indentation issues here that I don't have time to fix.),
Like this. (there are some indentation issues here that I don't have time to fix.),
Code: Select all
screen secret() :
modal False
imagebutton:
idle "secret.png"
hover "secret.png"
focus_mask True
xpos 100
ypos 100
action Jump("cache")
label start:
show secret
"bla bla"
"bla bla"
"bla bla"
hide secret
scene ver6
"story continue"
"story end"
return
label cache:
scene ven2
"secret here"
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: create a secret scene
ok sorry for the "return" now it's good the story continue but when i click on the background i dont jump to the secret scene
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: create a secret scene
Are you clicking on the right spot?
The xpos and ypos in the imagebutton determine the coordinates, which are currently 100 pixels in from both the left and top sides of the screen
The xpos and ypos in the imagebutton determine the coordinates, which are currently 100 pixels in from both the left and top sides of the screen
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: create a secret scene
sorry i can't answer before, i was click on the spot but nothing.
is it possible to click anyway on the half side of the background for example?
is it possible to click anyway on the half side of the background for example?
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: create a secret scene
Oh I see what's going on, this was my mistake.
I forgot that screens are shown with "show screen", not just "show"
I also forgot to get rid of the button when you access the scene.
I forgot that screens are shown with "show screen", not just "show"
Code: Select all
screen secret() :
modal False
imagebutton:
idle "secret.png"
hover "secret.png"
focus_mask True
xpos 100
ypos 100
action Jump("cache")
label start:
show screen secret
"bla bla"
"bla bla"
"bla bla"
hide secret
scene ver6
"story continue"
"story end"
return
label cache:
hide secret
scene ven2
"secret here"
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: create a secret scene
maybe it's to complicated for me...
now the secret scene dont show
now the secret scene dont show
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: create a secret scene
I'm confused. How I previously wrote it was incorrect, it shouldn't have worked at all.
You say it did?
You say it did?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: create a secret scene
with your code the story continue with conversation but on scene ver6 without showing the background of secret.
very sorry for my english.
very sorry for my english.
Re: create a secret scene
sorry my fault! i write xpos 10000 and xpos 10000!
it work but the bg is not full screen
sorry again!!
and the secret dont hide
it work but the bg is not full screen
sorry again!!
and the secret dont hide
Re: create a secret scene
ok i found the problem "hide screen secret"
so now i dont have secret bg on full screen and when i click to continue story i automaticly go on secret scene.
so now i dont have secret bg on full screen and when i click to continue story i automaticly go on secret scene.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: create a secret scene
Is everything working correctly now?
I apologise about not being able to reply in a timely manner.
I apologise about not being able to reply in a timely manner.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Who is online
Users browsing this forum: Google [Bot]