Search found 2427 matches

by Ocelot
Sat May 25, 2024 1:33 pm
Forum: Ren'Py Questions and Announcements
Topic: Rolling back array
Replies: 4
Views: 150

Re: Rolling back array

Can't say without looking at the code. The simplest explanation would be that maze array is not declared using default, but I suspect that it could be something more nuanced.
by Ocelot
Thu May 23, 2024 5:29 pm
Forum: Ren'Py Questions and Announcements
Topic: What's the most efficient way to store variables?
Replies: 19
Views: 563

Re: What's the most efficient way to store variables?

This is why I've never understood why people choose to code in things like C which are almost impossible to understand without a degree in computer science and a manual the size of War and Peace, when there's no reason code written in any other simpler language couldn't compile down to exactly the ...
by Ocelot
Thu May 23, 2024 9:31 am
Forum: Ren'Py Questions and Announcements
Topic: What's the most efficient way to store variables?
Replies: 19
Views: 563

Re: What's the most efficient way to store variables?

In most compiled languages variable names do not exist in final binary (function and by proxy class names often still exist in debug info, if included). It a convenience for a programmer, names given to arbitrary memory areas before they are discarded and transformed into bunch of memory adresses an...
by Ocelot
Thu May 23, 2024 8:07 am
Forum: Ren'Py Questions and Announcements
Topic: What's the most efficient way to store variables?
Replies: 19
Views: 563

Re: What's the most efficient way to store variables?

One way I've always done this - especially in older programs on computer systems with little memory (16K in the 80s, for example), was to store answers in a single text string. This uses way less memory than allocating memory space for separate variables, and allows for 10 different answers to each...
by Ocelot
Thu May 23, 2024 6:10 am
Forum: Ren'Py Questions and Announcements
Topic: What's the most efficient way to store variables?
Replies: 19
Views: 563

Re: What's the most efficient way to store variables?

Because those are two ways to approach the problem. You pick one and use it. Either question names or numbers. Dictionary or list.
You can add more to the list later, but it wouldn't be so trivial. If you exspect number of questions to change, I suggest dictionary approach.
by Ocelot
Thu May 23, 2024 4:07 am
Forum: Ren'Py Questions and Announcements
Topic: What's the most efficient way to store variables?
Replies: 19
Views: 563

Re: What's the most efficient way to store variables?

1) You are overthinking it. Unless you have tens of thousands of unused variables you don't even have to consider perfomance impact. Namespace pollutuion could be the problem when you accidentally reuse variable name because there are so many of them. 2) Instead of having 100 individual variables, u...
by Ocelot
Thu May 23, 2024 3:50 am
Forum: Ren'Py Questions and Announcements
Topic: Outlining only certain text in dialog
Replies: 7
Views: 296

Re: Outlining only certain text in dialog

Be aware that adding transparent outline to the text will increase letter spacing.
If you do not want that, then giorgi1111 has the link that can help you (second to last message in that thread)
by Ocelot
Wed May 15, 2024 2:58 pm
Forum: Ren'Py Questions and Announcements
Topic: Help with in-screen audio player issues (restarting music, unable to truly 'pause') [SOLVED]
Replies: 7
Views: 237

Re: Help with in-screen audio player issues (restarting music, unable to truly 'pause'))

Code: Select all

changed playSignal()
is equivalent to

Code: Select all

$ x = playSignal()
changed x
Which is equvalent to

Code: Select all

$ playSignal()
changed None
You need to pass a function, not call it and pass result of its execution.

TL;DR:
Remove () from playSignal()
by Ocelot
Wed May 15, 2024 12:39 pm
Forum: Ren'Py Questions and Announcements
Topic: How to replicate the id generated by Ren'Py?
Replies: 1
Views: 167

Re: How to replicate the id generated by Ren'Py?

Long story short, it is generated from current label name, hash of line contents and potentially a number if ID collides with any other previous ID.

Relevant code is here:
https://github.com/renpy/renpy/blob/8f2 ... __.py#L297
by Ocelot
Wed May 15, 2024 12:27 pm
Forum: Ren'Py Questions and Announcements
Topic: Help with in-screen audio player issues (restarting music, unable to truly 'pause') [SOLVED]
Replies: 7
Views: 237

Re: Help with in-screen audio player issues (restarting music, unable to truly 'pause'))

I think it may be an issue with me running the $ playSignal() command in my screen, and why it's restarting every time. However, I want the tracks to change in real time with the slider, so I need something there that tracks and changes what is playing, which is what that function does. Your functi...
by Ocelot
Sat May 11, 2024 6:16 am
Forum: Ren'Py Questions and Announcements
Topic: the number of dice and the modifier do not change the value
Replies: 3
Views: 249

Re: the number of dice and the modifier do not change the value

And as those are not global variables, you need to use SetScreenVariable instead. Or, even better: IncrementScreenVariable
https://www.renpy.org/doc/html/screen_a ... enVariable
by Ocelot
Sat May 11, 2024 3:46 am
Forum: Ren'Py Questions and Announcements
Topic: the number of dice and the modifier do not change the value
Replies: 3
Views: 249

Re: the number of dice and the modifier do not change the value

Your buttons are working fine and changing values as expected. There just a litlle thing to remember about screens: their code is constantly rerun. For example before each interaction, which happens to be after you press the button and it execute its actions. Mainly I am talking about this piece of ...
by Ocelot
Fri May 10, 2024 2:26 pm
Forum: Ren'Py Questions and Announcements
Topic: Screeen not Refreshing after Shift + R
Replies: 2
Views: 164

Re: Screeen not Refreshing after Shift + R

Besides, I suspect that "init" blocks might be not refreshable, because they run before all those game loads and reloads (meaning, they might be unaffected by reloads). Shift+R reloads make use of neat undocumented functionality which utterly restarts the game, including reloading and rer...
by Ocelot
Thu May 09, 2024 5:41 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Variable as a part of another variable's name?
Replies: 9
Views: 423

Re: Variable as a part of another variable's name?

1) You can use rp["bob"] in developer console to check specific variable you want.
2) You can use long command in developer console to switch to the long display mode. After that " rp " will show you full info instead of shortened data.
by Ocelot
Thu May 09, 2024 2:00 pm
Forum: Ren'Py Questions and Announcements
Topic: [SOLVED]Variable as a part of another variable's name?
Replies: 9
Views: 423

Re: Variable as a part of another variable's name?

The Pythonic way is to use dictionaries: default rp = { "linda": 0, "bob": 0, "rose": 0, "max": 0, } defaul num_random = 0 default cha_name = " " label question: Linda "Puppies are cute! Right?" menu: "Yes!": $ rp['linda'] += 1 $ ...