Can you add songs?

Happy Tuesdays!!!

Just curious. Can you add background songs to your game to help set the tone and ambience of a scene? Do you think it would be nice for the player like in a movie or narrative audio, or would it just annoy them and break immersion?

Also, I have another question which I really should make another topic for, but I love to encourage discussion, so. How well would an anime-themed game fare with the CoG fanbase/audience? I want to make Hunter Sky more anime like in a way.

It is possible to add a soundtrack. Trial of the Demon Hunter has one.

That said, ā€œsongsā€ implies something with lyrics. I would enjoy music to accompany a game, but lyrics would be distracting.

1 Like

Yessir, you can use the *sound command. Check out the documentation here:

Just so you donā€™t have to experiment and find out for yourself

  • Sounds will continue to play until they are finished
  • Sounds will continue even if you press Next, make a choice or if you change scenes
  • If youā€™re on a page where a sound starts and you open-close the stats menu- the sound with abruptly start again
  • To stop a sound, you type *sound and nothing else on that line- OR you let the sound finish
  • You canā€™t change the volume of a sound
  • Sounds wonā€™t loop
  • You canā€™t create a playlist or check when a song has ended, which sucks.
  • If you want to play songs one after another, you have to merge them into one file

Some people might be playing with their own music on in the background, so sounds might be annoying for them- if you really want to play sounds, maybe have it as an option you can turn on and off in the stats menu?

  • Something like a true/false variable, before you play the sound check if variable is true (aka "I want to play songs), if it is, the sound is played.

  • If you want to control how loud a sound is then youā€™ll need to have multiple copies of it- all at different volumes. Switch the sound control true/false variable to a number- where 0 is off, and then 1 to whatever number you want for max determines which ā€˜volumeā€™ of sound you want to play.

-Edit-
Oops, meant to go to a new line but posted early by mistake


Oh there are a bunch of anime stories, weā€™ve got a Samurai oneā€¦ A Mage Reborn uses anime art, Fatehaven too. Theyā€™re all popular.

5 Likes
  1. A lot of people donā€™t want that, Iā€™ve seen this discussion before. Not to mention people who use screenreaders. So if you do include sound, add an option to turn it off. Then in the code, guard the call to the *sound command with an *if statement.

  2. ChoiceScript offers almost no control over the sound, you canā€™t pause and resume or play multiple tracks at the same time. So thereā€™s not much room for getting creative with sounds like that.

7 Likes

my biggest complain over it is the lack of audio control. I played a WIP recently that has it (Path of Martial Arts) and while it doesnā€™t detract, it distracts. If I could just make it a bit more quiet, I could probably get into it. Until then, Iā€™ll probably just stick to having some ASMR running while I read.

3 Likes

Oh wow cool! I didnā€™t know this was possible with choice script. Awesome!

I was hoping to add some ambient music like forest noises or beach sounds to fit the scenes, and sad instrumental songs(no lyrics) for sad scenes and intense ones. I really am impressed with how much one can do with Choicescript.

Thanks for the instructions!

1 Like

I see. No control over the sound huh :thinking:
Thanks for the advice!

Cool! I was thinking of adding ambient nature sounds and instrumental background music for sad and intense scenes.

1 Like

Does anybody know if adding sound into a game has been a choicescript feature since itā€™s creation, or has it been implemented along the way? Seems like a cool aspect of code that should be made known to more authors who want more interesting mechanics in their games.

Also, another game that uses sounds (and gives the option to turn them off) is @Franzinyte ā€˜s lovely Dear Diary, We Created a Plot Hole, still a WiP. So you definitely wouldnā€™t be alone in adding sounds to your game.

5 Likes

Well, Trial of the Demon Hunter was released in 2014 (9 years ago!), which was about 3 years after CoG was founded, I think? So Iā€™d guess the *sound command has been a thing since the birth of choicescript. Itā€™s about time that it starts catching on in more games!

2 Likes

Hard agree. Plus it can make the wip lag, big files. Also, music (and even some sounds) are SO taste-specific; more than even ROs. One person may hear birdsong and angels while another hears nails on chalkboards.

3 Likes

Personally I generally dislike sound tracks being played over books. Sometimes for specific projects it can work, but for longer books I generally find it really distracting. While you can do it, thereā€™s a lot of downsides as people have discussed like the reader not being able stop and start it, no looping of audio, large files etc. If you really want to add sounds, twine is the more versatile platform for it.

4 Likes

On top of what other people have said, thereā€™s also the possibility it might be wasted effort if people play without audio (itā€™s text-based, after all) like me.

1 Like