Best path to the soundtrack directory

The official Rising World Soundtrack is available!
You can also get the Soundtrack on Steam
  • I'm creating a plugin for listen Rising World Soundtrack with a radio. I need some programming advice.

    First, what's the best way to find the path to the music folder ?


    I play on Linux with Steam and have coded this :

    Code
    musicDir = "/../../../../music/Rising World Soundtrack";
    sound = player.playSound(SoundAsset.loadFromFile(plugin.getPath() + musicDir + "/" + playlist.get(musicIndex), true));

    But I imagine this won't work on Windows or if the soundtracks have not been purchased via Steam.

    Is there a way to find out the soundtrack directory directly? And does it work on all platforms?

  • leviking

    Changed the title of the thread from “Best path to the music directory” to “Best path to the soundtrack directory”.
  • SoundAsset SoundFile = SoundAsset.loadFromFile(getPath() + "/Assets/Music.mp3");


    MP3 stored in the Assets folder in the plugins folder

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • Thanks for your reply. But I wanted to know how to play the music tracks sold by R.W. Under my Linux, they can be found in the directory: /opt/games/steamapps/music/Rising World Soundtrack


    How can I find this folder for sure? Is there a function like SoundTrack.getPath()?

  • Thanks for your reply. But I wanted to know how to play the music tracks sold by R.W. Under my Linux, they can be found in the directory: /opt/games/steamapps/music/Rising World Soundtrack


    How can I find this folder for sure? Is there a function like SoundTrack.getPath()?


    SoundAsset SoundFile = SoundAsset.loadFromFile(getPath() + "/Assets/Music.mp3");


    player.playSound(SoundFile, true, 0.5f, 1f, 0f, 15f, new Vector3f(-4405.1523f, 91.03004f, -2092.8826f));


    Again the files go inside the Assets folder, you need to copy the files here (Assets)

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • This is not my music, It's the official soundtrack of Rising World : https://shop.rising-world.net/…-rising-world-soundtrack/

    I can't put it in my plugin archive.

    yes if you own it my understanding is It contains the game music as separate audio files, you would need to copy those separate audio files to the Assets folder, the Assets folder would be in the same folder as your plugin.jar file then your plugin would play those files for everyone on your server even if they dont own them, but i dont see the point in such a plugin as the game already plays those files oO

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!