Search found 1365 matches

by xavimat
Wed Mar 06, 2019 11:52 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved] end of session hook for Python code
Replies: 2
Views: 96

Re: end of session hook for Python code

Probably you could use the "quit" special label. And put a "python" block in it (or normal label code, not necessarily python).
https://www.renpy.org/doc/html/label.ht ... ial-labels

But I'd ask what are you trying to achieve. Maybe there are other means (like persistent variables, maybe).
by xavimat
Wed Mar 06, 2019 11:38 am
Forum: Development of Ren'Py
Topic: Beginner questions
Replies: 1
Views: 148

Re: Beginner questions

1. you can include python code inside renpy. To define classes you can use an "init python" block. https://renpy.org/doc/html/python.html#init-python-statement 2. Yes. https://lemmasoft.renai.us/forums/viewtopic.php?f=4&t=53442&p=503389&hilit=rpy+files#p503306 3. It seems that code should work, if i...
by xavimat
Mon Mar 04, 2019 1:18 pm
Forum: Ren'Py Questions and Announcements
Topic: Loading renpy game from another dir
Replies: 2
Views: 69

Re: Loading renpy game from another dir

Put the scripts in your projects directory (if you have not defined it, you can choose that directory in the preferences of the launcher). If your programmer has sent the "game" directory, then you need to create a folder "MyGameName" in the projects directory and put the "game" directory there. If ...
by xavimat
Wed Feb 27, 2019 6:44 pm
Forum: Ren'Py Questions and Announcements
Topic: Un - labeled choices question.
Replies: 2
Views: 304

Re: Un - labeled choices question.

I'm not sure if I have understood the question correctly. Sorry if my answer doesn't make sense. The thing is: you must write every route if you give the player the option. If you don't want to write that route, then don't give the option. It's true that the Map of choices is hard to do, but the Map...
by xavimat
Wed Feb 27, 2019 2:21 pm
Forum: Ren'Py Questions and Announcements
Topic: What would be a way to "save game" on this case?
Replies: 3
Views: 242

Re: What would be a way to "save game" on this case?

(sorry for double post) I was trying a solution when I realized that, without knowing how variables are handled, it was not possible to know for sure if my solution will work. Anyway, you can try this: define persistent.started = False default _quit_slot = "mysave" label before_main_menu: if persist...
by xavimat
Tue Feb 26, 2019 2:44 pm
Forum: Ren'Py Questions and Announcements
Topic: What would be a way to "save game" on this case?
Replies: 3
Views: 242

Re: What would be a way to "save game" on this case?

Saving of variables depends on several things. If you initialize a variable in an "init python" block, it's possible that renpy won't save it in the saves. You should always initialize your variables with "default", so renpy knows that those variables must be saved. Also, it depends how are you chan...
by xavimat
Tue Feb 26, 2019 2:24 pm
Forum: Ren'Py Questions and Announcements
Topic: customized responses based on player input
Replies: 3
Views: 249

Re: customized responses based on player input

povname is a variable. You can use "if/elif/else" to check anything with it. (don't need the "python" part, put them inside a label with $ at the begining of the lines) define pov = Character("[povname]") label set_povname: $ povname = renpy.input("So. What is your name?").strip() if povname == "Eil...
by xavimat
Tue Feb 26, 2019 1:44 pm
Forum: Ren'Py Questions and Announcements
Topic: How can I disable the "Load" button when there are no existing save files?
Replies: 6
Views: 277

Re: How can I disable the "Load" button when there are no existing save files?

UPDATE: [/size] I took Remix's advice and it worked! if renpy.list_saved_games(fast=True): textbutton _("Load") action ShowMenu("load") else: textbutton _("Load") BUT when I try to delete the save and reload the game (to test it out), the Load button remains acessible :? Renpy saves your game infor...
by xavimat
Tue Feb 26, 2019 1:24 pm
Forum: Ren'Py Questions and Announcements
Topic: renpy.quit questions
Replies: 4
Views: 268

Re: renpy.quit questions

I strongly advise you against that kind of technique. It's possible that many players won't find it interesting or funny. I don't think it makes your game more interesting. That said, I've given it a try as a theoretical question, and I've managed to do it putting the "load" function inside the spec...
by xavimat
Tue Feb 26, 2019 12:31 pm
Forum: Ren'Py Questions and Announcements
Topic: Show the date of a save only when hovered
Replies: 4
Views: 266

Re: Show the date of a save only when hovered

My first idea is to change the color of the text to transparent, so it is not "hidden", but simply not visible. If you want to actually hide it, probably it will be more complicated because the space of the missing date and time will change the size of the button itself. So, try adding to the text ...
by xavimat
Mon Feb 25, 2019 4:28 pm
Forum: Ren'Py Questions and Announcements
Topic: Show the date of a save only when hovered
Replies: 4
Views: 266

Re: Show the date of a save only when hovered

My first idea is to change the color of the text to transparent, so it is not "hidden", but simply not visible. If you want to actually hide it, probably it will be more complicated because the space of the missing date and time will change the size of the button itself. So, try adding to the text t...
by xavimat
Tue Feb 19, 2019 1:35 am
Forum: Ren'Py Questions and Announcements
Topic: Finding the Highest Value of Variables for Endings
Replies: 4
Views: 126

Re: Finding the Highest Value of Variables for Endings

First, you need to decide what ending has priority in case of a tie. Say if all three variables have the same value, what ending should renpy choose? (OR you could write 7 endings, because there are seven possibilities counting ties and no-ties, but let's stick to your three endings). For example, y...
by xavimat
Mon Feb 18, 2019 2:25 pm
Forum: Ren'Py Questions and Announcements
Topic: Hotspots active on two call screens!
Replies: 2
Views: 77

Re: Hotspots active on two call screens!

I think this code is confusing. Screens do not belong to labels, but they are defined on their own, and then can be called or shown from any label. Also, how does ToggleScreen work with call screen? If ToggleScreen only changes visibility but there is no "Return()", is the screen there but hidden? I...
by xavimat
Thu Feb 14, 2019 3:15 pm
Forum: Ren'Py Questions and Announcements
Topic: Python "if statements" not working?
Replies: 4
Views: 142

Re: Python "if statements" not working?

You need a colon at the end of the "if" line (see Karl_C answer)
by xavimat
Thu Feb 14, 2019 3:10 pm
Forum: Ren'Py Questions and Announcements
Topic: .remove() isn't removing an object from array
Replies: 4
Views: 163

Re: .remove() isn't removing an object from array

I use shuffle and pop in a copy of the list to do this: define deck = [1,2,3,4,5,6] # deck is a constant, so I use "define" here. label start: $ deck2 = deck[:] # deck2 is a copy of the original deck $ renpy.random.shuffle(deck2) # shuffling as in real life card games. while len(deck2) > 3: $ card =...