Released [1.0] Beams and Nodes custom colors + Better weight info

Discussion in 'Utilities and programming' started by Sopze, Aug 16, 2019.

  1. Sopze

    Sopze
    Expand Collapse

    Joined:
    Nov 30, 2017
    Messages:
    19
    Hello people, Everytime that I spend a long time Jbeaming and testing I end up with my eyes burnt due to that green/magenta combination of beam/nodename colors chosen by the devil itself, so I've made something to define custom colors per-node/beam in the easiest and mod-friendly way possible.

    This adds 4 new Debug visualization modes, 1 for beams and 3 for node text. Modes can be accessed the same way as the original ones: In the Debug menu and with Ctrl+B/N mode cycle.

    Important: This is not a common mod, don't install this mod directly throwing the zip into your mods folder, it may or may not work installing it that way.

    Also Important: Any game update can broke this, if that occurs debug mode will give an in-game error and no .jbeam will be loaded, but don't panic because you'll just need to remove the mod file in order restore the original debug modes.

    nodecolor.png beamcolor.png weights2.png



    Beam Visualization mode

    Color
    Just like 'Simple' mode but with custom colors defined inside your .jbeam files in the same way you define deformGroup, so it can be assigned inside the beams section both globally and inline, just writing an HEX rgba color as value: {"beamColor":"RRGGBBAA"}. Also remember that if you're setting it globally you'll need to restore it to its default value as you do with deformGroup by writing: {"beamColor":"default"}.

    The 'default' color cannot be edited and it is C0C0C0FF(middle gray).

    Note 1: If the HEX rgba color is bad written it will be shown as FF00FFFF (magenta)
    Note 2: The transparency setting under debug only affects the 'default' beam color, defined colors have its own alpha value.

    Node Text modes

    Color
    Shows node names in color, this works like 'Color' beams but must be placed in nodes section and the property here is 'nodeColor'.

    The 'default' color cannot be edited and it is C0C0C0FF(middle gray).

    Note 1: If the HEX rgba color is bad written it will be shown as FF00FFFF(magenta)
    Note 2: Defined colors have its own alpha value.

    Color and numbers
    Exactly like 'Color' mode but it also show node numbers
    Weights 2
    This is a tweaked version of the original 'Weights' mode: values are trimmed when possible to avoid showing too many annoying zeroes in screen and the unit label is not shown anymore. Also it's more colorfull and colors are better distributed based on node weight, going from light nodes in skyblue -> green -> yellow to finally reach red at some point around 25Kg.​



    This is fully compatible with any game version without the mod, meaning that 'beamColor' and 'nodeColor' assignments will be just ignored if you don't have this mod installed. However I strongly recommend to remove all color definitions from the release versions of your mods as maybe the color values are probably loaded per-beam/node in the system memory and that values in memory are useless if the user is not developing that mod.

    How to install
    Just place the 'lua' folder inside the zip into Documents\BeamNG.Drive\. Note that after installing or uninstalling you'll need to reopen the game to get it working as reloading Lua in-game doesn't work with this.​

    Now let's mod!
     

    Attached Files:

    • 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