Search found 145 matches

by Doeny
Mon Feb 19, 2024 1:35 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Creating a loop that searches a specific variable
Replies: 8
Views: 1012

Re: Creating a loop that searches a specific variable

screen value_screen: vbox: for item in switch.extract_non_zero(): text str(item) It's something I realized just by now, but the extract_non_zero method doesn't update it's value as one of the buttons are changed. Maybe 'cause it's pre-defined or I overlooked something with my code. If I'm right wit...
by Doeny
Wed Feb 14, 2024 5:21 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Bypassing imagebutton's hovred-action corelation under condition
Replies: 5
Views: 238

Re: Bypassing imagebutton's hovred-action corelation under condition

Each line here is in fact longer, I just shortened them to don't make a big mess here. But what caught my attention is that if I don't have any e.g. wood, which is a condition above action, I can't hover over certain slots to trigger them. Ocelot already stated it and I want to make it clear: You a...
by Doeny
Wed Feb 14, 2024 3:58 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Bypassing imagebutton's hovred-action corelation under condition
Replies: 5
Views: 238

Re: Bypassing imagebutton's hovred-action corelation under condition

Not sure I'm following, you probably mean the "sensitive" property is related to the "action" property. Otherwise please provide an example! Alright, I'll just show it on a part of the code. vbox: for item in decor_list: if item.type == e_type and item.place == e_place and item....
by Doeny
Wed Feb 14, 2024 1:59 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Bypassing imagebutton's hovred-action corelation under condition
Replies: 5
Views: 238

[Solved]Bypassing imagebutton's hovred-action corelation under condition

Alright, I know the subject is unintelligible, but what I mean is some time ago I realized that if you put an imagebutton's 'action' under a condition, the 'hovered' statement is automatically locked under that condition aswell. Is there a way to bypass it? (without having to write another copy/past...
by Doeny
Mon Feb 12, 2024 2:16 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Creating a loop that searches a specific variable
Replies: 8
Views: 1012

Re: Creating a loop that searches a specific variable

Ocelot wrote: Thu Feb 08, 2024 12:48 pm
Doeny wrote: Wed Feb 07, 2024 6:31 pm For the first method it gives me an error saying that 'name switch" is not definied
I was relying on code you have shown, and switch was defined there...
My bad, I forgot it's name after changing it.
by Doeny
Wed Feb 07, 2024 6:31 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Creating a loop that searches a specific variable
Replies: 8
Views: 1012

Re: Creating a loop that searches a specific variable

init python: class buttons: def __init__(self, img, place1, place2, place3, place4, place5, place6): self.img = img self.places = [place1, place2, place3, place4, place5, place6] def extract_non_zero(self): return filter(None, self.places) # This returns a list of non-zero numbers screen value_scre...
by Doeny
Wed Jan 31, 2024 6:46 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Creating a loop that searches a specific variable
Replies: 8
Views: 1012

Re: Creating a loop that searches a specific variable

Not sure I'm following. You also have typos in your code. What is this "buttons" class anyway? It's not a dict, that's for sure. You have to post the corresponding class if you need help. The class itself isn't too complex. Just a placeholder for test purposes. init python: class buttons:...
by Doeny
Sat Jan 27, 2024 2:25 am
Forum: Ren'Py Questions and Announcements
Topic: [Solved]Creating a loop that searches a specific variable
Replies: 8
Views: 1012

[Solved]Creating a loop that searches a specific variable

Hi, I was wondering if there is a way to search for e.g. three variables from a whole dict that meets certain requirements. So let's say we have a... default switch = buttons("button_1", 0, 1, 0 ,4 , 5, 0} #in sequence: image, and other corresponding values screen value_screen: vbox: text ...
by Doeny
Mon Jan 08, 2024 5:02 am
Forum: Ren'Py Questions and Announcements
Topic: Check if player has certain items in inventory
Replies: 5
Views: 39868

Re: Check if player has certain items in inventory

I'm wondering, is there a way to put it in another dictionary and make it work for multiple objects? Because I have like 9 materials to work on, and don't wanna create a separate line for each of them. You can put lists in dicts, dicts in lists, and all other ways possible. What do you mean you wan...
by Doeny
Fri Jan 05, 2024 11:34 pm
Forum: Ren'Py Questions and Announcements
Topic: Check if player has certain items in inventory
Replies: 5
Views: 39868

Re: Check if player has certain items in inventory

If you're only talking about the player, you don't really need a class, since there always will only be one instance of "the player", right? (Classes are mostly useful, if you want to derive multiple objects from it, like a class "Animal" or "NPC".) Since you want to s...
by Doeny
Thu Jan 04, 2024 8:38 am
Forum: Ren'Py Questions and Announcements
Topic: Check if player has certain items in inventory
Replies: 5
Views: 39868

Re: Check if player has certain items in inventory

m_from_space wrote: Thu Jan 04, 2024 3:59 am
Since you want to store not only an item, but also its amount, I suggest using a simple dictionary for the inventory.
Well, that looks less complicated than I thought. I'll see how far can I go with this. Thanks.
by Doeny
Thu Jan 04, 2024 2:02 am
Forum: Ren'Py Questions and Announcements
Topic: Check if player has certain items in inventory
Replies: 5
Views: 39868

Check if player has certain items in inventory

Hi, I was wondering if there's a way to create a class/object with list as one of it's properties, which contains a register of items the player has to have in their inventory to satisfy a certain condition. For example: (the list contains 10x wood, 5x fiber & 3x rope). Is it possible to create ...
by Doeny
Sat Nov 25, 2023 6:38 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Disable skipping for a couple of scenes
Replies: 2
Views: 835

Re: Disable skipping for a couple of scenes

Hi, I'm wondering if there's a way to prevent skipping [...] Depending on what you need: # prevent skipping at all $ _skipping = False # make sure Renpy is stopping at the next interaction, if it's already skipping (like a menu or dialogue line) $ renpy.choice_for_skipping() Both seem useful. Tysm
by Doeny
Fri Nov 24, 2023 7:13 pm
Forum: Ren'Py Questions and Announcements
Topic: [Solved] Disable skipping for a couple of scenes
Replies: 2
Views: 835

[Solved] Disable skipping for a couple of scenes

Hi, I'm wondering if there's a way to prevent skipping and also manually advancing scenes for cetrain amount of scenes, to make sure the player views whole stack of videos?
by Doeny
Wed Nov 22, 2023 1:43 pm
Forum: Ren'Py Questions and Announcements
Topic: Making a moving bar minigame
Replies: 0
Views: 7184

Making a moving bar minigame

Hi, I started making a qte minigame, where you need to tap the key with the right timing, as a rectangle lines up in certain area, and gets harder with each attempt. I used come from fable_2_minigame I found on lemmasoft as a base, but can't get it to work, and I'm not even sure if that's the proper...