Making Music Novel (or actually mod)

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Beridok
Newbie
Posts: 6
Joined: Mon Aug 17, 2015 2:10 am
Skype: beridok
Soundcloud: beridok
Contact:

Making Music Novel (or actually mod)

#1 Post by Beridok »

Hello there!

Everlasting Summer is game with very good music and it has workshop on Steam, so people can create their own stories based on the game, using .rpy file and 'registering' custom music and images there. Link to game: http://store.steampowered.com/app/331470

And I found the guide about 'musical' trip - where guy just wrote which tracks we should listen to. I thought that it's very interesting, but having to click the tracks in Music Room/Box is well... too distracting if i'm playing some other game or doing something else.
Therefore, I tried to make mod, which would play the tracks one by one. (Alas, I could make one file with all music being there, but it would be another ~100-150 mb download and hdd usage for players).

I know that while using "music" channel, I have to add "noloop" in order to play music once. If I use music file in "sound" channel, it will play once.
I remember finding code that was supposed to play tracks one by one, but it didn't worked.

Code: Select all

play music ["file1.ogg", "file2.ogg"] noloop
Also found:

Code: Select all

queue music [ "a.ogg", "b.ogg" ]
But it didn't worked as intended. I'm not sure if it's not fault of "music_list" in code needed to play music:
play music music_list["everlasting_summer"]
I tried different possibilities but mostly I get this kind error:

Code: Select all

While running game code:
  File "game/feel-the-trip-music-mod.rpy", line 93, in script
    queue music (music_list["a_promise_from_distant_days"]; music_list["blow_with_the_fires"]) noloop
  File "renpy/common/000statements.rpy", line 166, in execute_queue_music
    eval(p["file"]),
SyntaxError: invalid syntax (game/feel-the-trip-music-mod.rpy, line 93)
#1 So, how to make that to work? No clicking, but music changing after finished playing?
#2 I tried also to make random-music option, but the code I found on this forum doesn't work - it gives error of not being able to find file...

Code: Select all

    $ tune = renpy.random.choice( file1.ogg, file2.ogg, file3.ogg )
    $ renpy.music.play (tune, channel="music", if_changed=True)
#3 Also I wanted to make 'display' of name as notice/text of every music playing, so everyone can see the name of track. The regular text needs to be clicked to proceed or when using autoplay it varies on the length of text [?] and user setting...

Beridok
Newbie
Posts: 6
Joined: Mon Aug 17, 2015 2:10 am
Skype: beridok
Soundcloud: beridok
Contact:

Re: Making Music Novel (or actually mod)

#2 Post by Beridok »

I really don't want to make double post, but no reply should mean that I wrote this thread wrongly?
That there is no solution for this?
Or somehow I answered myself in my own 'tries', but failed somehow?

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Making Music Novel (or actually mod)

#3 Post by xela »

List the choices and you should be fine:

Code: Select all

    $ tune = renpy.random.choice([file1.ogg, file2.ogg, file3.ogg])
    $ renpy.music.play (tune, channel="music", if_changed=True)
You don't specify why queue "didn't work as interned" anywhere or what "works as intended" actually means to you.
Like what we're doing? Support us at:
Image

Beridok
Newbie
Posts: 6
Joined: Mon Aug 17, 2015 2:10 am
Skype: beridok
Soundcloud: beridok
Contact:

Re: Making Music Novel (or actually mod)

#4 Post by Beridok »

xela wrote: You don't specify why queue "didn't work as interned" anywhere or what "works as intended" actually means to you.
Intention of queue is that one tracks plays, when it's over, the next one plays, and so on.
At least that's how I read about.
Also your code is not exact. I can't use "file1.ogg", cause in game scenario those musics must be played with code:

Code: Select all

play music music_list["here_is_title_example"]
The problem is that queueing is not possible (not as couple lines with queue function or one line of queue containing multiple tracks) as I tried to use it in the game's mod [Everlasting Summer] before.

How I wanted to make mod... so basically menu with 4 options (so it fits everyone's preference, basically) + Exit option:
Endless Play - it jump back to the begining of label that starts this and plays the set of X music tracks constantly. [But how to start playing next track without clicking, if queue doesn't work?]
Click-to-change - music changes only after click. [Easy to make]
Random Track - it plays random track. [Problem with code]
Skipable mode - we can skip to other track, if we want, and it will keep playing next ones properly (which is one by one). It's kinda like Endless Play mixed with Click-to-change.

I attached example traceback.txt file.
Edit: Also I have auto-play of text in game turned on, so the question is how make the name of track appear as text only when track changes?
Attachments
traceback1.txt
(2.07 KiB) Downloaded 96 times

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Making Music Novel (or actually mod)

#5 Post by xela »

No clue, I am not familiar with that game, nor with their setups. Try:

Code: Select all

    $ temp = music_list["everlasting_summer"]
    play music temp
Maybe problem is that Ren'Py doesn't access the dict properly, otherwise, you need to figure out what music_list["everlasting_summer"] is returning and work from there.
Like what we're doing? Support us at:
Image

Beridok
Newbie
Posts: 6
Joined: Mon Aug 17, 2015 2:10 am
Skype: beridok
Soundcloud: beridok
Contact:

Re: Making Music Novel (or actually mod)

#6 Post by Beridok »

@xela
Using that code played music. Does it mean I have to do that code to all tracks I want to use?

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Making Music Novel (or actually mod)

#7 Post by xela »

I see, so what we are dealing with is most likely is some form of a dictionary that binds "name": "path_to_file", so what you can do is (prolly) this:

Code: Select all

$ all_tracks = music_list.values()
play music all_tracks
queue or condition as you like...
Like what we're doing? Support us at:
Image

Beridok
Newbie
Posts: 6
Joined: Mon Aug 17, 2015 2:10 am
Skype: beridok
Soundcloud: beridok
Contact:

Re: Making Music Novel (or actually mod)

#8 Post by Beridok »

xela wrote:

Code: Select all

$ all_tracks = music_list.values()
play music all_tracks
queue or condition as you like...
The code I use might be wrong (then I just didn't understand you). If I use code like this...

Code: Select all

    $ all_tracks = music_list.values("a_promise_from_distant_days", "blow_with_the_fires")
    play music all_tracks
... traceback "says":

Code: Select all

While running game code:
  File "game/feel-the-trip-music-mod.rpy", line 30, in script
    $ all_tracks = music_list.values("a_promise_from_distant_days", "blow_with_the_fires")
  File "game/feel-the-trip-music-mod.rpy", line 30, in <module>
    $ all_tracks = music_list.values("a_promise_from_distant_days", "blow_with_the_fires")
TypeError: values() takes no arguments (2 given)
Edit: I assume I wrote the code badly cause the only files in traceback are from 'renpy' subfolder.
Attachments
traceback2.txt
(1.92 KiB) Downloaded 92 times

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Making Music Novel (or actually mod)

#9 Post by xela »

!@#$%^&*( ;)

You are NOT supposed to enter any parameters into dict.values()! I am advising you from assumption that music_list is NOT a list but some form of a dictionary where:

Code: Select all

{"a_promise_from_distant_days": "PATH_TO_FILE_GOES_HERE", "blow_with_the_fires": "PATH_TO_FILE_GOES_HERE"}
Search for python dictionaries online and figure out how to work with them, these are some examples:

Code: Select all

SINGLE_TRACK = music_list["blow_with_the_fires"]

SOME_TRACKS = list(music_list[i] for i in music_list if i in ["blow_with_the_fires", "a_promise_from_distant_days"])

ALL_TRACKS = music_list.values()

TRACKS_THAT_ARE_IN_ALL_TRACKS_BUT_NOT_IN_SOME_TRACKS = ALL_TRACKS - SOME_TRACKS

RANDOM_TRACK = renpy.random.choice(ALL_TRACKS)
RANDOM_TRACK = renpy.random.choice(SOME_TRACKS)
All of the above code should work as it is, if I understand the situation correctly.
Like what we're doing? Support us at:
Image

Beridok
Newbie
Posts: 6
Joined: Mon Aug 17, 2015 2:10 am
Skype: beridok
Soundcloud: beridok
Contact:

Re: Making Music Novel (or actually mod)

#10 Post by Beridok »

It doesn't work as you thought. Anyway I talked with guy that usually helps the other ones to make mods for Everlasting Summer and he didn't understand you, too. Neither he knew why it didn't work.

I wanted to make it without knowing python. I thought there might be solution for my 'wantings' with Ren'Py engine.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Making Music Novel (or actually mod)

#11 Post by xela »

I'll grab the game and take a quick glance myself, maybe I can get an idea or two from it for my own design :)

===
Nice game... works exactly like I've described btw @Version 1.2. I am going to play it a bit if I can a chance to see if I can draw some ideas from it.
Like what we're doing? Support us at:
Image

Post Reply

Who is online

Users browsing this forum: No registered users