Can I use the Camera Modes in a LUA statement ?

Discussion in 'Programming' started by NOCARGO, Jan 7, 2020.

  1. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    Hi,
    I am trying to make an SFX sound work ONLY INSIDE the vehicle. Is there someone who knows anything
    more about that ? Currently I have surpassed a long list of attempts of which none of them got it working.
    There's a few things I should explain about those attempts :

    1 - I have succeeded in using my sound as soundscape as well as SFXsource. They both sound harder
    outside of the vehicle than inside.
    2 - The soundscape version is NOT responding smooth to the actions of my code as the SFXsource IS.
    3 - I cannot find a single option ,in both cases, to make the sound dependent of one or more camera modes.
    4 - The soundscape sounds that are used for the signal lights, vehicle lights and handbrake are configured
    in copy protected files, just as the fmod engine sounds. At least, that's how it looks to me.
    5 - So far I have looked into a few fairly sophisticated mods and I found LUA code that implies the functioning
    of statements consisting of certain variables connected to the camera files, like cameraMode = "driver" and
    core_camera and core_camera.isInside (or something) to name a few I can remember. However although
    those 'arguments' are accepted when running them they do not function or prevent the sound from
    sounding at all. Also the mods wherein I found code related to camera modes also don't deliver the
    desired effect as far as I checked. Only Animated Wipers Mod seemed to do a trick on the sound of
    the wipers sounding harder inside and softer the further you move away. That would be a perfect solution
    for my sound. But I think in Animated Wipers Mod other files/scripts are created to make that LUA code
    being accepted. I'm not sure about that.
     
  2. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    It's working ! I found the code thanks to a very fine mod made by a very skilled modder :)
    Now I'm still trying to understand the code I discovered but most important is it works.
    Comments or questions are always welcome since the thread is created anyway..
    NC
     
  3. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Replicating interior sounds the way we do it atm is not possible for modders. This is hopefully going to change when fmod is opened to modding sometime in the future.
     
    • Like Like x 1
  4. charl

    charl
    Expand Collapse

    Joined:
    Aug 12, 2016
    Messages:
    90
    I am also working on a mod for more interior sounds- what mod/code helped you play sounds only in the interior? I am trying to check if the game camera is inside a vehicle using GameEngine lua calls but am so far unsuccessful
     
  5. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,514
    OUCH ! My memory ! :D
    I'm quite sure it was the original Better Sounds Mod, but beware : it has been updated, idk if the feature is still in last version.

    To get this done is quite a heavy task though. You also have to register a core module via a modscript file and stuff, there's a lot of
    code involved.
     
  6. charl

    charl
    Expand Collapse

    Joined:
    Aug 12, 2016
    Messages:
    90
    Ok, thanks for the quick reply. I looked at this mod already, I guess I'll have to figure out more about how its LUA works.
     
  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