Search found 34 matches

by Vladya
Thu Dec 31, 2020 3:10 am
Forum: Ren'Py Questions and Announcements
Topic: Help with user-selectable game music
Replies: 7
Views: 849

Re: Help with user-selectable game music

... but isn't working so well when used from the _game_menu - the music plays, I close the game menu, and then the song reverts ... This happens because _game_menu is called in a new context, which generates a new MusicContext object, from which Ren'Py takes information about the music (it is check...
by Vladya
Wed Dec 30, 2020 9:50 am
Forum: Ren'Py Questions and Announcements
Topic: Help with user-selectable game music
Replies: 7
Views: 849

Re: Help with user-selectable game music

I tried your os.path suggestion, but I don't know how to make use of it. Use it where you want to show the name of the song. The function takes the path in any format and returns a string with the file name, without extension or directories. An example of how you can implement a notification of the...
by Vladya
Tue Dec 29, 2020 8:19 pm
Forum: Ren'Py Questions and Announcements
Topic: Help with user-selectable game music
Replies: 7
Views: 849

Re: Help with user-selectable game music

... except for some reason it strips too much off the song name, leaving me with the notification "Now Playing - Volta" instead of "Now playing - Voltaic" You slightly misunderstood how the strip method works. It doesn't take a prefix, or a suffix. It takes an array of character...
by Vladya
Fri Dec 18, 2020 9:44 pm
Forum: Ren'Py Questions and Announcements
Topic: List doesn't work
Replies: 2
Views: 623

Re: List doesn't work

if damage <= 0 and "Pizza" or "Torta" or "Budino" or "Zuppa" in food: This is not how the check for containing an element in an array works. The in operator takes precedence over the or operator, so your condition only checks for the last condition , while al...
by Vladya
Thu Dec 17, 2020 3:38 pm
Forum: Development of Ren'Py
Topic: Surface from Texture.
Replies: 1
Views: 4708

Surface from Texture.

Good afternoon! I think it would be great if in new versions of Ren'Py it would be possible to get a Surface object from any texture (TextureGrid, Surface, Texture). Why do I need it? Mainly to be able to work directly with pixels in cython , getting mapped via PySurface_AsSurface without having to ...
by Vladya
Sun Nov 29, 2020 5:49 pm
Forum: Ren'Py Questions and Announcements
Topic: <Solved> How do I clear ',u,[] and other "service" characters from strings?
Replies: 5
Views: 505

Re: How do I clear ',u,[] and other "service" characters from strings?

Use separator.join(array) to combine text data from an array on one string. Where separator is the string separating elements (can be empty).
In your case:

Code: Select all

text "".join(turnMessages) size 22 xalign 0.5
by Vladya
Sun Nov 22, 2020 8:28 pm
Forum: Ren'Py Cookbook
Topic: Simple glitch effect.
Replies: 2
Views: 3275

Simple glitch effect.


Sources:
https://github.com/NyashniyVladya/RenPyGlitchs

To use it, copy glitchs_api.rpy into your project folder and work with the Glitch class. There are several examples of use in script.rpy.
by Vladya
Fri Nov 20, 2020 10:09 am
Forum: Ren'Py Questions and Announcements
Topic: [solved]Make music continue on main menu when the game ends
Replies: 4
Views: 466

Re: Make music continue on main menu when the game ends

Hmm... Have you performed any manipulations with config.main_menu_music variable? If it is not set, Ren'Py will automatically call renpy.music.stop before initializing the menu. If all you want is for the music to continue playing, set your song to config.main_menu_music and remove the Play() line a...
by Vladya
Thu Nov 19, 2020 9:43 pm
Forum: Ren'Py Questions and Announcements
Topic: [solved]Make music continue on main menu when the game ends
Replies: 4
Views: 466

Re: Make music continue on main menu when the game ends

Pass to "Play" class the argument if_changed with the value True.

Code: Select all

on "show" action Play("music", "gui/pres_de_toi.ogg", if_changed=True)
https://www.renpy.org/doc/html/audio.ht ... music.play
by Vladya
Thu Nov 19, 2020 2:43 pm
Forum: Ren'Py Questions and Announcements
Topic: Total playtime in quit menu
Replies: 12
Views: 1080

Re: Total playtime in quit menu

Made something similar to what you need.
viewtopic.php?t=60644
by Vladya
Thu Nov 19, 2020 2:42 pm
Forum: Ren'Py Cookbook
Topic: Time spent in a game.
Replies: 3
Views: 2576

Time spent in a game.

Small API that allows display game time in a convenient form. It can work with the game time of a specific save, with the total time of a game and with user input (you can find a more detailed description in the code below). How to use it: Copy the API code into a new .rpy file in your project. init...
by Vladya
Tue Nov 17, 2020 9:53 am
Forum: Ren'Py Questions and Announcements
Topic: Total playtime in quit menu
Replies: 12
Views: 1080

Re: Total playtime in quit menu

ok, now we got a little step forward..it print the time but its stuck at 0... sorry for being boring but I'm a beginner Because the "screen" is not redrawn. As one option, add timer with the function "renpy.restart_interaction". timer .1 repeat True action Function(renpy.restart...
by Vladya
Tue Nov 17, 2020 7:34 am
Forum: Ren'Py Questions and Announcements
Topic: Total playtime in quit menu
Replies: 12
Views: 1080

Re: Total playtime in quit menu

i dont get any error with my code but it doesnt print any total time either.. it print just the word "[playtime]" It works exactly as it should. You will not see the error. In new versions of Ren'Py format errors are suppressed (see the "substitute" function in the "renpy-s...
by Vladya
Tue Nov 17, 2020 6:54 am
Forum: Ren'Py Questions and Announcements
Topic: Total playtime in quit menu
Replies: 12
Views: 1080

Re: Total playtime in quit menu

i dont get any error with my code but it doesnt print any total time either.. it print just the word "[playtime]" It works exactly as it should. You will not see the error. In new versions of Ren'Py format errors are suppressed (see the "substitute" function in the "renpy-s...
by Vladya
Sat Nov 14, 2020 1:27 am
Forum: Ren'Py Questions and Announcements
Topic: [solved] adding new files
Replies: 8
Views: 625

Re: adding new files

renpy.loader.transfn returns the path to file only if it is in one of the config.searchpath directories. To create a new file, attach the required path in Ren'Py format to the variable config.gamedir . Like this: init python: # Module for correct work with paths, # taking into account the features ...