Search found 777 matches
- Sat Jul 24, 2021 3:47 pm
- Forum: Ren'Py Questions and Announcements
- Topic: How to make player lose health if they view a screen?
- Replies: 11
- Views: 873
Re: How to make player lose health if they view a screen?
the code was meant to be an example, you're seeing nothing because I just want to show you how to do what you want. if you want to show it visually, you gonna have to add some displayables to your screen, like the text and bar that you have in your original code. Those kinds of things depend on your...
- Sat Jul 24, 2021 10:25 am
- Forum: Ren'Py Questions and Announcements
- Topic: How to make player lose health if they view a screen?
- Replies: 11
- Views: 873
Re: How to make player lose health if they view a screen?
crap, uhhh sorry, there's a little mistake.
should be...
but ig, rayminator's code is what you're looking for, just want to correct it nonetheless.
Code: Select all
hp = min(max(hp, hp_min), hp_max)
Code: Select all
hp = min(max(value, hp_min), hp_max)
- Fri Jul 23, 2021 8:15 pm
- Forum: Ren'Py Questions and Announcements
- Topic: AttributeError: 'MultiBox' object has no attribute 'slow'
- Replies: 3
- Views: 784
Re: AttributeError: 'MultiBox' object has no attribute 'slow'
I'm guessing you're using strings inside your screens with some text tags? such as {fast}? afaik that won't work as it is only designed for dialogues.
- Fri Jul 23, 2021 8:05 pm
- Forum: Ren'Py Questions and Announcements
- Topic: How to make player lose health if they view a screen?
- Replies: 11
- Views: 873
Re: How to make player lose health if they view a screen?
default hp = 100 default hp_max = 100 default hp_min = 0 init python: def _setHealth(value, action=[]): global hp, hp_min, hp_max hp = min(max(value, hp_min), hp_max) # clamp the values if hp == 0: renpy.run(action) def SetHealth(value, action=[]): return Function(_setHealth, value, action) screen ...
- Fri Jul 23, 2021 7:49 pm
- Forum: Ren'Py Questions and Announcements
- Topic: [Solved] Exception: Possible infinite loop
- Replies: 4
- Views: 721
Re: Exception: Possible infinite loop
try default playing = true label start: while playing: pass not sure though, never used this kind of method before. I wouldn't suggest doing it either since renpy itself is already running on an infinite loop to make the game work. If you're monitoring something, use periodic callbacks or screens.
- Tue Jul 20, 2021 6:04 pm
- Forum: Ren'Py Questions and Announcements
- Topic: Return displayables from Python function
- Replies: 1
- Views: 615
Re: Return displayables from Python function
That wont work since that is a renpy specific syntax (screen language). When you're inside a python block, you code as you do in python, so python syntax only.
What you need are objects that you can instantiate and return.
https://www.renpy.org/doc/html/displayables.html
What you need are objects that you can instantiate and return.
https://www.renpy.org/doc/html/displayables.html
- Tue Jul 20, 2021 9:34 am
- Forum: Ren'Py Questions and Announcements
- Topic: Is it possible to have too many images?
- Replies: 5
- Views: 897
Re: Is it possible to have too many images?
Played the game, it doesn't contain videos to make the game that large, only images.
And I think what you're talking about is the limit for apks on Android. Nonetheless, that issue is still solvable using expansion apks (stated in the link), if I understood it correctly.
And I think what you're talking about is the limit for apks on Android. Nonetheless, that issue is still solvable using expansion apks (stated in the link), if I understood it correctly.
- Tue Jul 20, 2021 2:05 am
- Forum: Ren'Py Questions and Announcements
- Topic: Is it possible to have too many images?
- Replies: 5
- Views: 897
Re: Is it possible to have too many images?
yes, you can. I've seen games with even 1k~2.5k images per update. the biggest game I've seen was around 20gb. the problems that it may entail really depend on how well the game was optimized, whether the devs compressed/downsized the images themselves, and other resources. otherwise, it could poten...
- Mon Jul 19, 2021 6:02 am
- Forum: Ren'Py Questions and Announcements
- Topic: Can I use animated GIF pictures?
- Replies: 5
- Views: 706
Re: Can I use animated GIF pictures?
images supported: https://www.renpy.org/doc/html/displayables.html#Image You have many options here, either make them a Movie displayable (use webm and masking to simulate transparency) mask If given, this should be the path to a movie file that is used as the alpha channel of this displayable. The ...
- Fri Jul 16, 2021 12:14 pm
- Forum: Ren'Py Questions and Announcements
- Topic: Insensitive menu options still selectable with keyboard
- Replies: 7
- Views: 845
Re: Insensitive menu options still selectable with keyboard
Code: Select all
for n, i in enumerate(items, 1): # n would be the number starting from 1
textbutton str(n) + ". " + i.caption:
action i.action
style "nvl_button"
keysym (str(n) if n < 10 else None) # works like the `key` displayable on screens...
- Fri Jul 16, 2021 10:38 am
- Forum: Ren'Py Questions and Announcements
- Topic: Indentation error at the very beginning of a script
- Replies: 4
- Views: 723
Re: Indentation error at the very beginning of a script
I can't see what's wrong in here. better to post the full traceback here.
- Fri Jul 16, 2021 12:25 am
- Forum: Ren'Py Questions and Announcements
- Topic: Insensitive menu options still selectable with keyboard
- Replies: 7
- Views: 845
Re: Insensitive menu options still selectable with keyboard
a button has a keysym property, use that instead...
https://www.renpy.org/doc/html/screens.html#textbutton
https://www.renpy.org/doc/html/screens.html#textbutton
- Thu Jul 15, 2021 9:55 pm
- Forum: Ren'Py Questions and Announcements
- Topic: [Solved] How do you declare a local variable in a screen?
- Replies: 1
- Views: 635
Re: How do you declare a local variable in a screen?
The former is actually a screen variable, the latter is a local variable, that's where the SetScreenVariable and SetLocalVariable actions come into place. If you want a static-like declaration of something when the screen is called/shown and have it update only at specific interactions, then use scr...
- Thu Jul 15, 2021 10:54 am
- Forum: Ren'Py Questions and Announcements
- Topic: [Solved]Questions about function(in button action)
- Replies: 5
- Views: 786
Re: Questions about function(in button action)
if you're planning to return something from the function then the interaction will end (the called screen will hide and continue to your current script in labels). https://www.renpy.org/doc/html/screen_actions.html#Function If the function returns a non-None value, the interaction stops and returns ...
- Thu Jul 15, 2021 6:45 am
- Forum: Ren'Py Questions and Announcements
- Topic: [Solved]Questions about function(in button action)
- Replies: 5
- Views: 786
Re: Questions about function(in button action)
SetVariable("hp", 0)
this one throws an error because the SetVariable action is meant for global variables not local variables, in your screen you're passing the hp as a local variable.
Use SetLocalVariable instead, its also documented in Renpy Actions section.
this one throws an error because the SetVariable action is meant for global variables not local variables, in your screen you're passing the hp as a local variable.
Use SetLocalVariable instead, its also documented in Renpy Actions section.