Button For gallery.
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.
- KairuKyun
- Veteran
- Posts: 286
- Joined: Thu Feb 12, 2015 4:10 pm
- Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
- Projects: Warped Reality
- Organization: Unwonted Studios
- IRC Nick: Kairu_kyun
- Tumblr: karamuchan
- Contact:
Button For gallery.
How do I make a button that appears once I clear the game.
Last edited by KairuKyun on Sat Mar 21, 2015 8:47 pm, edited 1 time in total.
Kyle Tyner
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
- Zetsubou
- Miko-Class Veteran
- Posts: 522
- Joined: Wed Mar 05, 2014 1:00 am
- Completed: See my signature
- Github: koroshiya
- itch: zetsuboushita
- Contact:
Re: Button
Use persistent data to see if you've finished the game, then edit your main menu in screens.rpy to check for that variable.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
- KairuKyun
- Veteran
- Posts: 286
- Joined: Thu Feb 12, 2015 4:10 pm
- Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
- Projects: Warped Reality
- Organization: Unwonted Studios
- IRC Nick: Kairu_kyun
- Tumblr: karamuchan
- Contact:
Re: Button For gallery.
Thank you
Kyle Tyner
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
- KairuKyun
- Veteran
- Posts: 286
- Joined: Thu Feb 12, 2015 4:10 pm
- Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
- Projects: Warped Reality
- Organization: Unwonted Studios
- IRC Nick: Kairu_kyun
- Tumblr: karamuchan
- Contact:
Re: Button For gallery.
So I am trying:
And then I tried:
They are both messy and aren't pointed towards the gallery yet but What's wrong?
Code: Select all
if replay == True:
imagebutton auto "assets/images/menu/btn_choice_%s.png" action Quit() xpos 400 ypos 394 focus_mask True at quitmen
Code: Select all
if not replay:
centered "No Gallery"
else:
imagebutton auto "assets/images/menu/btn_choice_%s.png" action Quit() xpos 400 ypos 394 focus_mask True at quitmen
Kyle Tyner
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
- Zetsubou
- Miko-Class Veteran
- Posts: 522
- Joined: Wed Mar 05, 2014 1:00 am
- Completed: See my signature
- Github: koroshiya
- itch: zetsuboushita
- Contact:
Re: Button For gallery.
What's wrong with the above exactly? ie. What results are you getting, and what do you want it to do?
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
- KairuKyun
- Veteran
- Posts: 286
- Joined: Thu Feb 12, 2015 4:10 pm
- Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
- Projects: Warped Reality
- Organization: Unwonted Studios
- IRC Nick: Kairu_kyun
- Tumblr: karamuchan
- Contact:
Re: Button For gallery.
I feel completely stupid, I forgot to include persistent. before replay...
Kyle Tyner
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
- KairuKyun
- Veteran
- Posts: 286
- Joined: Thu Feb 12, 2015 4:10 pm
- Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
- Projects: Warped Reality
- Organization: Unwonted Studios
- IRC Nick: Kairu_kyun
- Tumblr: karamuchan
- Contact:
Re: Button For gallery.
Nope never mind still get an error:
File "game/screens.rpy", line 294: screen expects a non-empty block.
if persistent.replay == True :
^
File "game/screens.rpy", line 294: screen expects a non-empty block.
if persistent.replay == True :
^
Kyle Tyner
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
- Zetsubou
- Miko-Class Veteran
- Posts: 522
- Joined: Wed Mar 05, 2014 1:00 am
- Completed: See my signature
- Github: koroshiya
- itch: zetsuboushita
- Contact:
Re: Button For gallery.
I'd need to see more of that screen, but going by the message alone it seems like the line after the screen statement isn't indented properly.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
- KairuKyun
- Veteran
- Posts: 286
- Joined: Thu Feb 12, 2015 4:10 pm
- Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
- Projects: Warped Reality
- Organization: Unwonted Studios
- IRC Nick: Kairu_kyun
- Tumblr: karamuchan
- Contact:
Re: Button For gallery.
I have this at the end of my game:
And this in the menu:
I fixed the indentation error but now I don't get my button when i finish the game.
Code: Select all
#This says the game is over
$ persistent.replay = True
Code: Select all
if persistent.replay == True :
imagebutton auto "assets/images/menu/btn_choice_%s.png" action Quit() xpos 550 ypos 394 focus_mask True
Kyle Tyner
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
- Zetsubou
- Miko-Class Veteran
- Posts: 522
- Joined: Wed Mar 05, 2014 1:00 am
- Completed: See my signature
- Github: koroshiya
- itch: zetsuboushita
- Contact:
Re: Button For gallery.
Can't say for sure with so little info, but going by the indentation of the comment "#This says the game is over", I'm guessing the problem is that "$ persistent.replay = True" isn't indented properly.
should do what you want, but
may not.
Code: Select all
label endOfGame:
"The game is over!"
$ persistent.replay = True
Code: Select all
label endOfGame:
"The game is over!"
$ persistent.replay = True
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
- Donmai
- Eileen-Class Veteran
- Posts: 1960
- Joined: Sun Jun 10, 2012 1:45 am
- Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
- Projects: Slumberland
- Location: Brazil
- Contact:
Re: Button For gallery.
Also, maybe your variable wasn't initialized at all. Put this at the very beginning of your script.rpy
Code: Select all
init:
python:
if persistent.replay is None:
persistent.replay = False
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)
TOIRE NO HANAKO (A Story About Fear)
- KairuKyun
- Veteran
- Posts: 286
- Joined: Thu Feb 12, 2015 4:10 pm
- Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
- Projects: Warped Reality
- Organization: Unwonted Studios
- IRC Nick: Kairu_kyun
- Tumblr: karamuchan
- Contact:
Re: Button For gallery.
Neither worked NOw I am tring to make it where when
then in menu
BUt I get a error
Code: Select all
#This says the game is over
$ persistent.replay = True
if persistent.replay = True :
$ re = 1
Code: Select all
if re = 1 :
imagebutton auto "assets/images/menu/btn_choice_%s.png" action Quit() xpos 550 ypos 394 focus_mask True
Code: Select all
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/script.rpy", line 5357: if statement expects a non-empty block.
if persistent.replay = True :
^
Ren'Py Version: Ren'Py 6.18.3.761
Kyle Tyner
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
- Zetsubou
- Miko-Class Veteran
- Posts: 522
- Joined: Wed Mar 05, 2014 1:00 am
- Completed: See my signature
- Github: koroshiya
- itch: zetsuboushita
- Contact:
Re: Button For gallery.
is being caused byKairuKyun wrote:Neither worked NOw I am tring to make it where whenCode: Select all
I'm sorry, but errors were detected in your script. Please correct the errors listed below, and try again. File "game/script.rpy", line 5357: if statement expects a non-empty block. if persistent.replay = True : ^ Ren'Py Version: Ren'Py 6.18.3.761
Code: Select all
if persistent.replay = True :
$ re = 1
Python is different than other languages like C and Java, where braces define a block of code. It might be worthwhile looking at some introductory Python books if you keep running into errors.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails
Working on:
Sable's Grimoire 2
https://zetsubou.games
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Button For gallery.
There's a second problem here. You want:
Double equals is comparison, single equals is assignment. It's the Python (and, C, C++, Java, C#, etc) way!
Actually, you probably don't care about equality to True, but just truth, so a more pythonic way to write this would be:
Code: Select all
if persistent.replay == True:
$ re = 1
Actually, you probably don't care about equality to True, but just truth, so a more pythonic way to write this would be:
Code: Select all
if persistent.replay:
$ re = 1
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
- KairuKyun
- Veteran
- Posts: 286
- Joined: Thu Feb 12, 2015 4:10 pm
- Completed: No One But You, Catch Canvas, Sickness, Written in the Sky, Wander no more, Warped Reality
- Projects: Warped Reality
- Organization: Unwonted Studios
- IRC Nick: Kairu_kyun
- Tumblr: karamuchan
- Contact:
Re: Button For gallery.
Well even after doing this in main menu screen it still says that re is not defined. So I don't know if the re variable just isn't showing on the screens or what.
Kyle Tyner
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
Creator of Unwonted Studios
ktyner@unwontedstudios.co
Visit Our Website
Projects: No One But You, Sickness, Written in the Sky, Wander no more, Catch Canvas, Warped Reality
Who is online
Users browsing this forum: Ahrefs [Bot], Andredron, Google [Bot], Kia