Use LUA to automatically move camera?

Discussion in 'Programming' started by BombBoy4, Jun 12, 2017.

  1. BombBoy4

    BombBoy4
    Expand Collapse

    Joined:
    May 16, 2015
    Messages:
    1,601
    So I'm helping make a mod pack, but can't get the screenshots to look like the stock ones. I'm wondering if there's a way to have a script automatically move the camera in position, so all I have to do is take the picture and it's perfect?
     
    • Agree Agree x 1
  2. Funky7Monkey

    Funky7Monkey
    Expand Collapse

    Joined:
    Oct 12, 2014
    Messages:
    977
    First, I personally don't like the idea of preview images of mod configs to look like official ones. Makes them look, well, official, when they're not.

    Second, I recommend you make your own custom camera mode to get the camera to go where you want. Check my signature for an incomplete, but still very useful tutorial on how to get started doing this.

    You could also use the Relative camera mode, I believe, and give it specific coordinates and direction to look.
     
    • Agree Agree x 1
    • Informative Informative x 1
  3. RyvyLo

    RyvyLo
    Expand Collapse

    Joined:
    May 15, 2014
    Messages:
    438
    I'd like to add to that that the devs seem to have automated the task, looking at the lua\ge\extensions\util\createThumbnails.lua file. It might be a good starting point, the code seems readable and it could be possible to edit it to automatically create custom thumbnails with a different background and camera angle.

    Figuring out what are the parameters to launch it (probably a command line like for the Performance Statistics) and if it works in the current version of BeamNG is another story though.

    And while thinking about automating things, I always have this graph in mind :



    I think that if you haven't got many thumbnails to create, you'll be done quicker if you go the boring and repetitive way of doing everything manually
     
    • Agree Agree x 1
  4. Funky7Monkey

    Funky7Monkey
    Expand Collapse

    Joined:
    Oct 12, 2014
    Messages:
    977
    That would be using the Relative camera mode. It's reasonably quick, easy, and simple.
     
  5. BombBoy4

    BombBoy4
    Expand Collapse

    Joined:
    May 16, 2015
    Messages:
    1,601
    How would I set FOV in the relative camera? I know you can zoom in and out, but not to exact measurements ie. 30.
    --- Post updated ---
    Alright, I see the createThumbnails.lua file, and it looks like it should work. But, how do I activate it? @Diamondback @estama @synsol
     
  6. BombBoy4

    BombBoy4
    Expand Collapse

    Joined:
    May 16, 2015
    Messages:
    1,601
    I've activated it, extensions.loadModule('util/createThumbnails'), but how do I tell it which vehicle/config to use?
     
  7. Destroyer247_52

    Destroyer247_52
    Expand Collapse

    Joined:
    Mar 9, 2015
    Messages:
    188
    I entered that and its doing every config in the game for me. I might need to close BeamNG, XD
     
  8. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,683
    That script is not meant for end-user usage at the moment.

    Although it can be a good starting point to see what is the command that allows you to move/rotate camera by a specific value.
     
    #8 Nadeox1, Jun 14, 2017
    Last edited: Jun 14, 2017
  9. Funky7Monkey

    Funky7Monkey
    Expand Collapse

    Joined:
    Oct 12, 2014
    Messages:
    977
    TBH, you're going to have to figure that out yourself. Have fun!
     
  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