Tutorial: How to add your own music to the Ford Focus NA2/Gavril Vertex

Discussion in 'Content Creation' started by Inn0centJok3r, Jun 19, 2020.

  1. Inn0centJok3r

    Inn0centJok3r
    Expand Collapse

    Joined:
    Jul 16, 2018
    Messages:
    1,482
    If you have NO prior coding experience, please make sure to follow each step AS SHOWN in this tutorial. Reference existing code for syntax. DO NOT remove any " or change anything that is not a value or "inside these"

    This tutorial is for Version 2.15+ of the Vertex and Version 1.2+ of the Tuner LeGran.

    Heya!
    This thread is what the title says. It's only useful if you have the described mod (Ford Focus NA2 or Gavril Vertex) in version 2.15 or above. (the Vertex may take a couple days to update due to the approval progress, the Focus can get instand updates however.)

    Anyways, as you might know, my mod has working radio that's controlled by some lua code. The earlier versions were a bit rough but it should be good now. Many have asked the question of how one can add music to it... and as I unfortunately never really set up a reasonable tutorial, I'll just make one now!
    First off, If you want to have a more pleasing experience while editing the code slightly (Don't worry, it are just a few minor things that have to be changed), I recommend downloading Notepad++ https://notepad-plus-plus.org/
    It's a free program, but it's not required.

    Step 1:
    So, lets start off. First of all, you have to unpack the mod file. You can safely do that by starting BeamNG and then going into the mods menu like shown here
    tut1.png
    Find the Ford Focus/Gavril Vertex file, click on it and click on "unpack" I know, the image says pack on it, I just took the image after I unpacked it

    tut2.png
    Step 2:

    After that is out of the way, you have to go into your mods folder.
    Follow the path shown here! (or whatever path you have set it to)

    radio1.png
    Go into the Vertex/Focus folder and find the radio.lua file, which is found here
    radio7.png
    Step 3:
    Now, open said file. The code may make it look like there's a lot to do, but it really isn't. I've put notes all over the file to make things clearer. The second playlist is already laid out for adding new music!
    radio2.png
    Scroll a bit down...
    radio3.png

    Here you see the second list. There are mainly 2 things that have to be changed. And 2 more that can be changed if you want to.
    You can enter a custom name for the playlist and also enter a custom name for the music that you're editing ("Your Song Name Here" marking), even an author can be displayed if you want!
    Now, to make it actually work, you gotta change the file path (art/sound/music/YourFileHere)
    Only change the last step of the path!
    Don't forget to remove the -- in front of --play_song_dir! Otherwise the lua won't play anything as it can't read the file path!


    The code can look like this once you're done:
    radio4.png

    -----------------Only when you want to add more than 8 songs----------------------

    If you add more songs than the 8 layouts that I have made, you gotta increase the song limit (described in the notes) and also have to copy paste the song blocks that are already there aaand the change all the if song == X values. Just increase them by 1 every time.
    Make sure that you do NOT place the new songs below the "end" marker in the code. Your code should look somewhat like this once you're done:
    radio5.png
    -----------------------------------------------------------------------------------------------------


    Step 4:
    Now you need the actual music file. Drop it in here
    radio6.png

    Step 5:

    When you're done, save the file and go back into your game
    Load a map and spawn the car, mess with the radio to ensure that your changes have worked.
    Once it all works, go back into the menu and "Pack" the car file again
    tut2.png
    I recommend making a backup of your edited radio.lua file as well as all the music you installed, in case of any future updates to the mods! They would overwrite the code. However, please watch out for the update changelog in case there will be any further changes to the code!

    Tadaaa! Now you have added your own music to the radio. Have fun and enjoy your music!

    If you have any questions, feel free to ask them.

    Here the mod links again:
    https://www.beamng.com/resources/gavril-vertex-na2.13061/
    https://www.beamng.com/threads/ford...ation-export-with-8-months-put-into-it.70962/
     
    #1 Inn0centJok3r, Jun 19, 2020
    Last edited: Dec 6, 2023
    • Like Like x 9
    • Agree Agree x 1
  2. andrzejserafin5

    andrzejserafin5
    Expand Collapse

    Joined:
    Apr 23, 2020
    Messages:
    1,069
    Please help me,i added the music to a good place and it don't shows in the game. What type of a file is accepted?
     
  3. Inn0centJok3r

    Inn0centJok3r
    Expand Collapse

    Joined:
    Jul 16, 2018
    Messages:
    1,482
    All sound files should be accepted... like ogg, mp3, flac etc. Make sure you also saved the file and did everything like it's explained in the tutorial
     
  4. andrzejserafin5

    andrzejserafin5
    Expand Collapse

    Joined:
    Apr 23, 2020
    Messages:
    1,069
    I followed the every steps and it still don't works.
     
  5. Kenichi Koay

    Kenichi Koay
    Expand Collapse

    Joined:
    Apr 4, 2020
    Messages:
    48
    me too, i put the song and edit the radio.lua file, but it did not work
     
    • Agree Agree x 1
  6. Inn0centJok3r

    Inn0centJok3r
    Expand Collapse

    Joined:
    Jul 16, 2018
    Messages:
    1,482
    Would you mind sending an image of what you edited in the lua file?
     
  7. Kenichi Koay

    Kenichi Koay
    Expand Collapse

    Joined:
    Apr 4, 2020
    Messages:
    48
    upload_2020-6-30_11-39-10.png
    here is what I edited.
    upload_2020-6-30_11-42-50.png
    and here is the song i putted
     
  8. Inn0centJok3r

    Inn0centJok3r
    Expand Collapse

    Joined:
    Jul 16, 2018
    Messages:
    1,482
    I sadly can’t view the images as you have copy pasted them in. Please save them on your computer and then upload them, as otherwise you can’t view the images in a bigger view than... what you got there
    --- Post updated ---
    Actually, ignore that, apparently they are so high res that I can just zoom in on mobile. I have found your issue. It’s very very simple..
    FBA2C2CC-BD34-471A-9126-DCECE0D88361.jpeg
    you forgot to remove the — in front of the code that actually plays the music
     
  9. Kenichi Koay

    Kenichi Koay
    Expand Collapse

    Joined:
    Apr 4, 2020
    Messages:
    48
    I removed the -- but still the music is not playing
     

    Attached Files:

  10. Inn0centJok3r

    Inn0centJok3r
    Expand Collapse

    Joined:
    Jul 16, 2018
    Messages:
    1,482
    Actually, ignore that, apparently they are so high res that I can just zoom in on mobile. I have found your issue. It’s very very simple..
    OH you just didn’t go into the Next Playlist! Press CTRL 5 to switch to the next playlist, or just look up the controls. Your music is in a new playlist. It should play when you go into it and switch the songs around
     
  11. Kenichi Koay

    Kenichi Koay
    Expand Collapse

    Joined:
    Apr 4, 2020
    Messages:
    48
    Thanks, now I got the song playing
     
    • Like Like x 1
  12. Inn0centJok3r

    Inn0centJok3r
    Expand Collapse

    Joined:
    Jul 16, 2018
    Messages:
    1,482
    You just change the last thing to the name of your sound file
     
  13. Inn0centJok3r

    Inn0centJok3r
    Expand Collapse

    Joined:
    Jul 16, 2018
    Messages:
    1,482
    Die you remove the — in front of the code
     
  14. Inn0centJok3r

    Inn0centJok3r
    Expand Collapse

    Joined:
    Jul 16, 2018
    Messages:
    1,482
    Send me a screenshot of what you did, perhaps we can then work out what’s wrong
     
  15. Inn0centJok3r

    Inn0centJok3r
    Expand Collapse

    Joined:
    Jul 16, 2018
    Messages:
    1,482
    Did you put the rest of that into the next line? Like did you split it yourself or is that some weird thing notepad did? If you did it yourself, Please get it all back Into one line like all the examples.
     

    Attached Files:

    • E2FA753A-4C65-47B2-9BAB-C932438046AD.jpeg
  16. maxbraam

    maxbraam
    Expand Collapse

    Joined:
    Dec 26, 2016
    Messages:
    2
    All it did was corrupt the entire mod
     
  17. Inn0centJok3r

    Inn0centJok3r
    Expand Collapse

    Joined:
    Jul 16, 2018
    Messages:
    1,482
    Be careful with syntax. Check for wrong brackets, symbols or commas
     
  18. maxbraam

    maxbraam
    Expand Collapse

    Joined:
    Dec 26, 2016
    Messages:
    2
    It still does not work but i shall look more into the file
    --- Post updated ---
    An update i gave up so the mod will now just be installed but never used

    Update 2: i reinstalled the mod and did not remove the dashes it works fine removed the dashes first song its fine now the second song It works now fully
     
    #18 maxbraam, Nov 10, 2020
    Last edited: Nov 10, 2020
  19. Inn0centJok3r

    Inn0centJok3r
    Expand Collapse

    Joined:
    Jul 16, 2018
    Messages:
    1,482
    You can delete it and download a new file
     
  20. rfwretgertgfdc

    rfwretgertgfdc
    Expand Collapse

    Joined:
    Nov 4, 2020
    Messages:
    18
    playlist 2 does not show up. idk if i corrupted the file while changing the extension but it doesn't do anything
    edit: i forgot to press next list! thank you, the Gavril Vertex NA2 is my fav car!
     
    #20 rfwretgertgfdc, Nov 30, 2020
    Last edited: Nov 30, 2020
    • Like Like x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice