instrument / gauges lights question for my Prelude

Discussion in 'Content Creation' started by AdR, Jun 9, 2015.

  1. AdR

    AdR
    Expand Collapse
    BeamNG Team

    Joined:
    Feb 6, 2014
    Messages:
    306
    Been trying to figure this out for a while but I can't seem to find what I'm missing to make them work.
    The material setup and mesh is exactly the same for any of the official vehicles, here I've moved the "lighted" panel a little bit forward just for show purposes:

    missing.jpg

    Each polygon has it's unique material assigned for each function.

    The code on the main jbeam is this:

    Code:
    //gauge lights            
                "signal_L":{"simpleFunction":"signal_L", "off":"invis", "on":"lude_decals_gauges"},
                "signal_R":{"simpleFunction":"signal_R", "off":"invis", "on":"lude_decals_gauges"},
                "checkengine":{"simpleFunction":"checkengine", "off":"invis", "on":"lude_decals_gauges"},
                "hazard":{"simpleFunction":"hazard", "off":"invis", "on":"lude_decals_gauges"},
                "battery":{"simpleFunction":"battery", "off":"invis", "on":"lude_decals_gauges"},
                "highbeam":{"simpleFunction":"highbeam", "off":"invis", "on":"lude_decals_gauges"},
                "parkingbrake":{"simpleFunction":"parkingbrake", "off":"invis", "on":"lude_decals_gauges"},
                "lowfuel":{"simpleFunction":"lowfuel", "off":"invis", "on":"lude_decals_gauges"},
                "lowpressure":{"simpleFunction":"lowpressure", "off":"invis", "on":"lude_decals_gauges"},
    And the material.cs file has the "lude_decals_gauges" mat defined there:

    Code:
    singleton Material(lude_decals_gauges){
       mapTo = "lude_decals_gauges";
       diffuseMap[1] = "vehicles/preludesn/lude_decals_gauges.dds";
       
       diffuseMap[0] = "vehicles/preludesn/lude_decals_gauges.dds";
       
       specularPower[0] = "16";
       pixelspecular[0] = "1";
       emissive[1] = "1";
       glow[0] = "0";
       useAnisotropic[0] = "1";
       useAnisotropic[1] = "1";
       materialTag0 = "beamng"; materialTag1 = "vehicle";
       diffuseColor[0] = "0.75 0.75 0.75 1";
       diffuseColor[1] = "1.5 1.5 1.5 0.8";
    };
    Is there something else I'm missing or what am I doing wrong here? Any help will be greatly appreciated ;)
     
  2. vladmir poopin

    vladmir poopin
    Expand Collapse
    Banned

    Joined:
    Mar 17, 2013
    Messages:
    844
    remove // from before the top code section

    //gauge lights
    should be

    gauge lights
     
  3. AdR

    AdR
    Expand Collapse
    BeamNG Team

    Joined:
    Feb 6, 2014
    Messages:
    306
    But that's exactly how it is on any of the official cars
     
  4. vladmir poopin

    vladmir poopin
    Expand Collapse
    Banned

    Joined:
    Mar 17, 2013
    Messages:
    844
    oh is it?

    on ROR doing // before code would turn that piece of code off try it without tho
     
  5. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    // indicates it as a comment. gauge lights is not a JBeam keyword and would cause an error. It is a comment to the JBeam author that this section of the glowmaps is for gauge lights. A comment lasts for 1 line only.

    Time and time again you need to be reminded. If you don't know, don't advise, more often than not your advice does the complete opposite and will only serve to further confuse.
     
  6. AdR

    AdR
    Expand Collapse
    BeamNG Team

    Joined:
    Feb 6, 2014
    Messages:
    306
    Here it only applies to that line alone. They're used as references or comments on the jbeams so you know wich part is what.
     
  7. SoHigh00

    SoHigh00
    Expand Collapse

    Joined:
    Nov 11, 2013
    Messages:
    506
    Hmm..I can't see the mistake in the code...what happens in game? Did you paint the material right?(white alpha to the parts that should glow)


    Edit:

    Also, did you put "glowMap":{ before your code? and of course close it after?
     
  8. CarlosAir

    CarlosAir
    Expand Collapse

    Joined:
    Nov 16, 2013
    Messages:
    336
    Make sure that a material called "invis" is specified, I don't know if that is the problem, but anyway.

    Also, yeah, what's happening in-game? Check out the console to see if there is any special error message.
     
  9. JackAttak

    JackAttak
    Expand Collapse

    Joined:
    Sep 12, 2013
    Messages:
    567
    This.
    Please stop trying to help with jbeam related posts when you really don't know how to jbeam. I can't really jbeam, so I don't help out here, but at least I know that // indicates a comment and "gauge lights" doesn't mean anything when you're jbeaming gauge lights.
     
  10. AdR

    AdR
    Expand Collapse
    BeamNG Team

    Joined:
    Feb 6, 2014
    Messages:
    306
    Sure, it starts with the "glowMap":{ and closes with }, no errors in the jbeam or console.

    Here's the .dds (diffuse and alpha)

    lude_decals_gauges.jpg

    Nothing shows up in game

    No errors in the console either. It's like it's invisible all the time but doesn't "triggers" when using any of the functions.
     
  11. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,685
    try commenting out non existing sources (lowpresure, etc), until you have parkingbrake, lowbeam, etc.
     
  12. AdR

    AdR
    Expand Collapse
    BeamNG Team

    Joined:
    Feb 6, 2014
    Messages:
    306
    Tried that, but after checking that everything was OK for the hundredth time or so, turns out I'm just an idiot, that's all :mad:
    Forgot to attach that bit of geometry to the rest of the dash so the lights were actually working, but didn't show up...

    screenshot_00017.jpg

    Anyway, thanks for the help!
    Now that I got that working there's another issue I'm dealing with, but this time the geometry and function is fine, and it's the instrument cluster light:

    screenshot_00019.jpg

    This is the code for the material:

    Code:
    singleton Material(lude_gauges_on)
    {
       mapTo = "lude_gauges";
       diffuseMap[1] = "vehicles/preludesn/gauges_g.dds";
       diffuseMap[0] = "vehicles/preludesn/gauges_d.dds";
       specularPower[0] = "128";
       pixelspecular[0] = "1";
       specularPower[1] = "128";
       pixelspecular[1] = "1";
       useAnisotropic[0] = "1";
       useAnisotropic[1] = "1";
       castshadows = "0";
       translucent = "1";
       alphaTest = "1";
       alphaRef = "0";
       materialTag0 = "beamng"; materialTag1 = "vehicle"; materialTag2 = "decal";
    };
    So what's the key to actually make the material use the opacity from the alpha channel? in this case is just a simple gradient from black to white on the gauges_d.dds
    The gauges_g.dds alpha channel seems to control the amount of glow, not the transparency.

    I've tried using the same settings from the windows material but no luck.
     
  13. KennyWah

    KennyWah
    Expand Collapse

    Joined:
    Jan 16, 2013
    Messages:
    2,629
    Nevermind [bad post]
     
  14. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,685
    Try adding
    Code:
       translucentBlendOp = "Sub";
    
     
    • Like Like x 1
  15. AdR

    AdR
    Expand Collapse
    BeamNG Team

    Joined:
    Feb 6, 2014
    Messages:
    306
    That worked. Still not quite what I've expected but it's getting there. DDS compression is killing the gradient I believe:

    screenshot_00017.jpg

    This is the code:
    Code:
    singleton Material(lude_gauges_glass){
       mapTo = "gauges_glass";    
       diffuseMap[0] = "vehicles/preludesn/gauges_g.dds";
       diffuseMap[1] = "vehicles/preludesn/gauges_ga.dds";
       translucent = "1";
       translucentBlendOp = "Sub";
       specularPower[0] = "16";
       pixelSpecular[0] = "1";
       glow[1] = "1";
       emissive[1] = "1";
       materialTag0 = "beamng"; materialTag1 = "vehicle";
    };
    
     
  16. AdR

    AdR
    Expand Collapse
    BeamNG Team

    Joined:
    Feb 6, 2014
    Messages:
    306
    Having another problem. Can't make the console lights (and buttons) turn on with the headlights. For some reason it just won't work and I've tried and checked everything I could.

    This is the jbeam line that refers to them:

    Code:
    "instruments_d":{"simpleFunction":{"lowhighbeam":0.2}, "off":"instruments_d", "on":"instruments_on"},
    That means that the "instruments_d" material should change to "instruments_on" when the headlights are ON.

    The code is basically a copy paste from the hatch jbeam, only changed texture names:

    Code:
    singleton Material(instruments_d)
    {
       mapTo = "instruments_d";
       diffuseMap[1] = "vehicles/preludesn/instrument_g.dds";
       specularMap[1] = "vehicles/preludesn/instrument_s.dds";
       normalMap[1] = "vehicles/preludesn/instrument_n.dds";
       diffuseMap[0] = "vehicles/preludesn/instrument_d.dds";
       specularMap[0] = "vehicles/preludesn/instrument_s.dds";
       normalMap[0] = "vehicles/preludesn/instrument_n.dds";
       specularPower[0] = "16";
       pixelSpecular[0] = "1";
       glow[1] = "0";
       emissive[1] = "1";
       useAnisotropic[0] = "1";
       useAnisotropic[1] = "1";
       materialTag0 = "beamng"; materialTag1 = "vehicle";
       diffuseColor[0] = "0.75 0.75 0.75 1";
       diffuseColor[1] = "1.5 1.5 1.5 0.2";
    };
    
    
    singleton Material(instruments_on)
    {
       mapTo = "instruments_on";
       diffuseMap[1] = "vehicles/preludesn/instrument_g.dds";
       specularMap[1] = "vehicles/preludesn/instrument_s.dds";
       normalMap[1] = "vehicles/preludesn/instrument_n.dds";
       diffuseMap[0] = "vehicles/preludesn/instrument_d.dds";
       specularMap[0] = "vehicles/preludesn/instrument_s.dds";
       normalMap[0] = "vehicles/preludesn/instrument_n.dds";
       specularPower[0] = "16";
       pixelSpecular[0] = "1";
       glow[1] = "1";
       emissive[1] = "1";
       useAnisotropic[0] = "1";
       useAnisotropic[1] = "1";
       materialTag0 = "beamng"; materialTag1 = "vehicle";
       diffuseColor[0] = "0.75 0.75 0.75 1";
       diffuseColor[1] = "0.5 1.7 1.3 0.2";
    };
    
    The assigned material to the 3D mesh is called "instruments_d", thing is, it just won't turn on when I press the N key. Got the same line for the "gauges glass" and that works perfect:

    Code:
    "gauges_glass":{"simpleFunction":{"lowhighbeam":0.2}, "off":"invis", "on":"gauges_glass"},
    I fail to see where the problem is?:(
     
  17. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,685
    Are you sure there's no material in docs\BeamnG.drive\vehicles\prelude?
     
  18. AdR

    AdR
    Expand Collapse
    BeamNG Team

    Joined:
    Feb 6, 2014
    Messages:
    306
    Yes, always keep an eye there (I guess that's a bug?) so right now there aren't any files. Happened more than once before.


    Btw, the glow material works fine, this is what happens when I change the "mapto" so it's on all the time:

    screenshot_00019.jpg
     
    #18 AdR, Jun 11, 2015
    Last edited: Jun 11, 2015
  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