Glowmap functions for rangebox/diffs?

Discussion in 'Content Creation' started by wrinkle345, Mar 10, 2017.

  1. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    546
    I've been working on a "display" for the D15 that would show whether the truck was in 4WD or 2WD mode, as well as show the current range.

    screenshot_00033.png

    Everything has been done so far, from the normal materials to setting up the emissives.

    screenshot_00034.png

    But, whats missing now are the functions to control the glowmaps. I've tried guessing through it, but they don't work

    "glowMap":{
    "pickup_4wdg":{"simpleFunction":{"lowhighbeam":0.6}, "off":"pickup_4wdg", "on":"pickup_4wdg_on"},
    //gauge lights
    "pickup_4wd_hr":{"simpleFunction":"highrange", "off":"pickup_4wdg", "on":"pickup_4wdg_on"},
    "pickup_4wd_lr":{"simpleFunction":"lowrange", "off":"pickup_4wdg", "on":"pickup_4wdg_on"},
    "pickup_4wd_4wd":{"simpleFunction":"tansfercase4wd", "off":"pickup_4wdg", "on":"pickup_4wdg_on"},
    "pickup_4wd_2wd":{"simpleFunction":"tansfercase2wd", "off":"pickup_4wdg", "on":"pickup_4wdg_on"},
    },

    So my question is, are there any "simpleFunction"s for those powertrain features? And if not, is there any way to code them in manually?
     
    • Like Like x 1
  2. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,841
    I've added two new electrics values for this in the next update :) (only available if using the stock 4wd controller)
    Code:
    electrics.values.modeRangeBox = rangeBox.mode == "low" and 1 or 0
    electrics.values.mode4WD = shaft.mode == "connected" and 1 or 0
     
  3. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    546
    Outstandingly Awesome!
    So, what would the function have to look like next update?

    "pickup_4wd_hr":{"simpleFunction":"low 0", "off":"pickup_4wdg", "on":"pickup_4wdg_on"},?
     
  4. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,841
    Essentially you'd do this:
    Code:
    "pickup_4wd_hr":{"simpleFunction":"modeRangeBox", "off":"pickup_4wdg", "on":"pickup_4wdg_on"},
    "pickup_4wd_lr":{"simpleFunction":"modeRangeBox", "off":"pickup_4wdg_on", "on":"pickup_4wdg"}
     
    • Informative Informative x 2
  5. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    546
    Oh it works in an even better way than I thought.
    Thank you for the help, and the update, whenever it comes.
     
  6. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    546
    Just tested the glowmaps, they don't seem to work
    --- Post updated ---
    Code:
        "glowMap":{
            "pickup_4wdg":{"simpleFunction":{"lowhighbeam":0.6}, "off":"pickup_4wdg", "on":"pickup_4wdg_on"},
               //gauge lights
            "pickup_4wd_hr":{"simpleFunction":"modeRangeBox", "off":"pickup_4wdg", "on":"pickup_4wdg_on"},
            "pickup_4wd_lr":{"simpleFunction":"modeRangeBox", "off":"pickup_4wdg_on", "on":"pickup_4wdg"},
            "pickup_4wd_4wd":{"simpleFunction":"mode4WD", "off":"pickup_4wdg", "on":"pickup_4wdg_on"},
            "pickup_4wd_2wd":{"simpleFunction":"mode4WD", "off":"pickup_4wdg_on", "on":"pickup_4wdg"},   
        },
    Based off of the info given here, and some of the luas, I assume this would have been correct
     
  7. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,841
    How are you toggling the modes? Seems to work fine here.
     
  8. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    546
    I have been and nothing's happened.

    This is how it is always. Shouldn't some of the lights be on at spawn?
    screenshot_00032.png

    I can still turn it all on via the headlights.
    screenshot_00033.png
     
  9. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,841
    No I literally mean *how* are you toggling the modes?
    It should work via the shortcuts, but not via the new app :(
    (It was added quite a bit after I added the required changes for you, so I never came to my mind that it wouldn't work.)
    I fixed this for the next update...
     
  10. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    546
    I am using the shortcuts. Nothing lights up.

    Try it.
     

    Attached Files:

  11. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,841
    Hm, then something about the glow map setup is wrong, it certainly toggles the relevant electrics.
     
    • Agree Agree x 1
  12. StinchinStein

    StinchinStein
    Expand Collapse

    Joined:
    Jul 16, 2014
    Messages:
    736
    Is this the behavior you were looking for?
     

    Attached Files:

  13. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    546
    Almost. It's so close right now.

    I don't know what you did, but you fixed half the problem here.

    The other half is the diagram portion, which also lights up depending on the mode.
     
  14. StinchinStein

    StinchinStein
    Expand Collapse

    Joined:
    Jul 16, 2014
    Messages:
    736
    I renamed the materials in the dae file.. They were all the same, hence the reason why it activated everything when you switched your lights on.

    Should the entire diagram light up or only part of it light up?
     
  15. wrinkle345

    wrinkle345
    Expand Collapse

    Joined:
    Jul 2, 2015
    Messages:
    546
    The diagram is two parts:
    the rear (left) part is for when its in 2wd mode, and in 4wd mode the front (right) part and the rear (left) part both light up

    They use the same material names, so its weird it doesnt go on
     
  16. StinchinStein

    StinchinStein
    Expand Collapse

    Joined:
    Jul 16, 2014
    Messages:
    736
    Been fiddling with it for the past little while and I can't figure it out.
    I'm not a pro at Blender (or JBeam files) so I can only do so much.

    Hope you can figure it out, glad I could fix part of the problem! ;)
     
    • 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