How to add a custom sound / music?

Discussion in 'Content Creation' started by Frag2000, May 24, 2023.

  1. Frag2000

    Frag2000
    Expand Collapse

    Joined:
    May 22, 2023
    Messages:
    6
    Hi guys,

    in the mission editor, how could I add custom music when the player pass at an exact location.

    I see two way out of this:

    - With a custom LUA trigger, if its the case how do I register the sound and play it? Let's say the file is named "music.wav" and reside at the mission root folder.

    - With the flow chart ... I saw that there is a "Play Sound" but was not able to hear the sound. What format the file should be?

    Could you hint me out please? Seems to be a very basic question, but the doc and example are mostly non existing online. Every step is a struggle.
     
  2. Frag2000

    Frag2000
    Expand Collapse

    Joined:
    May 22, 2023
    Messages:
    6
    Have to say that I am a little disappointed here. I was quite excited about BeamMG mission editing capabilities. But with no examples, no recent tutorials and not answers on the forum on such a basic functionalities points out that every step of mission edition will be a HUGE struggle. I easily wrote large missions in Digital Combat Sims (DCS), Flight Simulator 2020, Arma 3, Stormworks and even wrote a massive Minecraft mod ... first time I hit a wall like that.
     
  3. Barbent Servo GT

    Barbent Servo GT
    Expand Collapse

    Joined:
    Jun 4, 2023
    Messages:
    643
    Hi,
    I have found a way to play sounds from LUA. Place a SFX-emitter with your soundfile selected (can be OGG/WAV/MP3) into your world and start it from within mainLevel.lua with the following code:

    Code:
    scenetree.findObject('SFXEmitter_Name'):play()
    This will be not only for missions but the level itself. Maybe it can be specialized.
    Hope this helps a bit ;-) (I agree BNGDocumentation is horrible (for now), but never give up!)
     
  4. DannyD88

    DannyD88
    Expand Collapse

    Joined:
    Aug 11, 2023
    Messages:
    1
    hey so i know like nothing about these things but i wanna add a custom sound to a sound emitter. could you help me with that?
     
  5. cmokVnash

    cmokVnash
    Expand Collapse

    Joined:
    May 30, 2023
    Messages:
    4
    With the flowgraph audio node:

    First connect the play node to flow

    Click the "o>" files field icon of the audio node and it should open the file dialogue box:

    upload_2023-8-22_21-37-17.png


    Now you can test if your audio node is working.

    if audio node working then

    put a copy of the sound in the user directory gameplay folder and write the full path in the file dialogue with the file extension

    gameplay/audio/mySound.ogg

    Your custom sound should now work with the flowgraph.
     
  6. mikelarson

    mikelarson
    Expand Collapse

    Joined:
    Aug 14, 2023
    Messages:
    1
    In your mission editor, create a trigger zone or area where you want the music to play when the player passes through it. Write LUA Script: Attach a custom LUA script to the tr
     
  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