Skip to content

August 17, 2013

7

DriveEditor – Vehicle config editor for BeamNG Drive

Another desktop application! This one was actually challenging, (which makes a change from other desktop applications I’ve made) and I learned a lot while creating a useful tool at the same time!

Well, useful if you like smashing cars in BeamNG’s Drive: a softbody car physics simulator which is much more fun than it sounds! Here’s the kind of stuff you can do after editing your vehicles:

If that’s sold you already, click here to go to the download.

So how does it work?

First, you might need to tell it where your BeamNG Drive vehicle directory is located (just go into Options->Settings), and then it will scan the chosen directory for vehicle config files. The config files are stored as .jbeam, which is some variant of JSON that I had lots of fun regex-ing to convert to valid JSON. After that, you get a screen with a huge tree on the left, and an editor on the right. You can edit values to your liking:

It saves automatically as you type, so you can hop back into BeamNG Drive and hit “CRTL+R”, and the config will be loaded!

 

Features

  • Automated scanning for .jbeam files
  • Full .jbeam parsing, allowing for total flexibility of input
  • Smart lookahead (so common config arrays will be presented in a multi-column format for easy editing)
  • Type detection for boolean values (so that editing is a checkbox) and decimal/integers (so that saving them does not save them as a string, and maintains the original type)
  • Tab index to allow you to quickly move between edit boxes by pressing tab
  • Auto update checker (can be disabled)
  • Component creation by duplicating existing components
  • Node deletion
  • Custom node adding directly from the editor

Planned features

  • (done) Type detection (so numbers will be a number box, booleans will be a check box, etc.)
  • (done) Custom node adding (So you can create vehicles from within the editor)
  • (done) Tab index (So you can tab your way through values to edit them easily)

Download

v0.5

  • Added node adding
  • Recoded a major portion of the code, improving editing speeds

DriveEditor
DriveEditor
DriveEditor-v0.5.zip
Version: 0.5
181.6 KiB
1275 Downloads
Details

 

 

Older releases:

v0.4:

  • Fixed bug where fullsize.jbeam would be incorrectly parsed
  • Added “Create component from…” function, so that parts can be duplicated and modified without editing the original
  • Patch v0.4.1: Made the “add new component” create JSON friendly validated names
  • Patch v0.4.2: Added automatic update checking (can be disabled) and “Delete node” option (right click on a node to open the menu)

DriveEditor (179.0 KiB)

(August 19th, 21:00)

v0.3:

  • Improved (but not perfected) jbeam parsing. At least now all default files should be able to be parsed
  • Added tab indexes to text boxes, so you can easily move between edit boxes by pressing tab
  • Fixed bug where text would be truncated on long labels (oops)
  • Added type detection, so values will be loaded, presented, and saved as their original types (e.g booleans will be checkboxes, integers will be saved without quotes, etc.)
  • Allowed for window resizing

DriveEditor (176.0 KiB)

v0.2:

  • Added loading screen, made it easier to browse arrays (useful for BeamNG’s use of arrays)

DriveEditor (176.3 KiB)

 

v0.1 – Initial release

7 Comments Post a comment
  1. estama
    Aug 17 2013

    Hello,

    Below you’ll find a python script (that only runs regexes) to convert jbeams to json (fixes the optional commas in jbeam):

    import re
    import sys
    import os

    for fn in sys.argv[1:]:
    if not os.path.isfile(fn):
    print “file not found: “, fn
    continue
    f=open(fn, “r”)
    j=f.read()
    f.close()

    j = re.sub(r’\r\n’,”,j)
    j = re.sub(r’\n’,”,j)

    j = re.sub(r’((?:(?:”[^"]*?”|-?[\d.]+[eE]?[+\-]?\d?)[\s\n]*:[\s\n]*(?:”[^"]*?”|-?[\d.]+[eE]?[+\-]?\d?|[\[{]|false|true|null))|”[^"]*?”|[\]\[{}]|-?[\d.]+[eE]?[+\-]?\d?|false|true|null)’, r’\1,’, j)

    j = re.sub(r’,([^[\]{}\\”\-\dtfn]*?),’, r’,\1′, j)
    j = re.sub(r’,([^[\]{}\\”\-\dtfn]*?),’, r’,\1′, j)

    j = re.sub(r’\[,([^[\]{}”\-\dtfn]*?)\]’, r’[\1]‘,j)
    j = re.sub(r’\{,[^[\]{}”\-\dtfn]*?\}’, r’{\1}’,j)

    j = re.sub(r’([[{]),(?=[^[\]{}]*?[[{"\-\dtfn])’, r’\1′, j)
    j = re.sub(r’([\]}]),(?=[^[\]{}]*?[\]}])’, r’\1′, j)
    j = re.sub(r’(["\-\dle]),(?=[^[\]{}”\-\dtfn]*?[\]}])’, r’\1′, j)
    j = re.sub(r’,$’,”,j)

    j = j.replace(”, ‘\n’)

    f=open(fn, “w”)
    f.write(j)
    f.close()

    Reply
  2. estama
    Aug 17 2013

    Also nice work on the editor!

    Reply
    • Oliver
      Aug 17 2013

      Thank you very much for the regex, and thanks for the compliment! I’ll use this in the next update.

      Reply
  3. topias123
    Feb 15 2014

    It doesn’t work, says it can’t find the vehicle files. Could it be because i didn’t install the game in C:/?

    Reply
    • topias123
      Feb 15 2014

      Nevermind, it was just loading slowly :p

      Reply
  4. Bonbm
    Mar 30 2014

    Can it change the color of a car?

    Reply

Trackbacks & Pingbacks

  1. BeamNG Drive: Einsteiger-Tutorial für den Editor - Trolltest.de

Share your thoughts, post a comment.

(required)
(required)

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments