Solved deformMaterial acting weird

Discussion in 'Mod Support' started by BB93, Jul 13, 2023.

  1. BB93

    BB93
    Expand Collapse

    Joined:
    May 17, 2023
    Messages:
    23
    Hello everyone, I haven't yet presented myself here other than having written in a single thread a few times. Someone might know me from the VStanced.com community, as I used to modify SLRR for years, but now I'm trying to modify beam just for the heck of it. lol

    So, short presentation done, I am here to ask if anyone has a clue why am I getting this little weird issue with a car I'm working on, where the deformMaterial line/s are acting up and modifying a second material other than the one I set them to.

    Pics for reference, code below:

    Code:
    "MODNAMELOL_bumper_F_revo_foglights": {
        "information":{
            "authors":"",
            "name":"Fog Lights",
            "value":200,
        },
        "slotType" : "MODNAMELOL_bumper_F_revo_fogs",
        "flexbodies": [
             ["mesh", "[group]:", "nonFlexMaterials"],
             ["MODNAMELOL_bumper_F_revo_projectors", ["MODNAMELOL_bumper_F"]],
             {"deformGroup":"foglight_R_break", "deformMaterialBase":"MODNAMELOL_glass_headlights_eu", "deformMaterialDamaged":"MODNAMELOL_glass_headlights_eu_dmg"},
             {"deformGroup":"foglight_L_break", "deformMaterialBase":"MODNAMELOL_glass_headlights_eu", "deformMaterialDamaged":"MODNAMELOL_glass_headlights_eu_dmg"},
             ["MODNAMELOL_bumper_F_revo_glass", ["MODNAMELOL_bumper_F"]],
        ],
        "glowMap":{
                //glass
                "MODNAMELOL_glass_headlights_eu_fogs": {"simpleFunction":{"fog":100}, "off":"MODNAMELOL_glass_headlights_eu", "on":"MODNAMELOL_glass_headlights_eu_on", "on_intense":"MODNAMELOL_glass_headlights_eu_on_intense"},
      
            //internal
                "MODNAMELOL_headlights_eu_fogs":         {"simpleFunction":{"fog":100}, "off":"MODNAMELOL_headlights_eu", "on":"MODNAMELOL_headlights_eu_on", "on_intense":"MODNAMELOL_headlights_eu_on_intense"},
        },
        "props": [
            ["func"      , "mesh"              , "idRef:", "idX:", "idY:"            , "baseRotation"        , "rotation"                 , "translation"        , "min", "max", "offset", "multiplier"],
            {
                "lightInnerAngle":20,
                "lightOuterAngle":179,
                "lightRange":60,
                "lightColor":{"r":255, "g":255, "b":140, "a":255},
                "lightAttenuation":{"x":0, "y":1, "z":1},
                "lightCastShadows":false,
                "flareName":"vehicleHeadLightFlare",
                "cookieName":"vehicles/MODNAMELOL/MODNAMELOL_foglight.dds",
                "texSize":512,
                "shadowSoftness":0.4,
            },
            //foglights
            ["fog" ,         "SPOTLIGHT"        , "fb3rr", "fb3r", "fb2rr", {"x":-161.549, "y":173.369, "z":-19.588} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.806, "y":0.863, "z":-0.063},"flareScale":0.00,"lightBrightness":12,"deformGroup":"bumpersignal_break"}],
            ["fog" ,         "SPOTLIGHT"        , "fb3ll", "fb3l", "fb2ll", {"x":18, "y":-5.3, "z":-20} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.806, "y":0.863, "z":0.063},"flareScale":0.00,"lightBrightness":12,"deformGroup":"bumpersignal_break"}],
         ],
    },

    I don't have a single reference to the mesh/grille material, anywhere, so I'm currently clueless about why this is happening. Any idea would be greatly appreciated.

    ps: please stick to this topic, I am aware that I still have to work on the nodes, but that's not what I'm currently focusing on, thanks <3
     
    #1 BB93, Jul 13, 2023
    Last edited: Sep 1, 2023
  2. BB93

    BB93
    Expand Collapse

    Joined:
    May 17, 2023
    Messages:
    23
    Please don't push with all these helpful answers
     
  3. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,488
    Nobody will want to help you with that attitude.
    Not sure what you are trying to do with the deform materials here but it's clear that you don't know how they work. Look at the vanilla cars for reference. Every mesh that you want to apply the deform material to needs to have only 1 material. That material you state in the deformGroup section above that mesh. You can apply it to several flexbodies with the same material, but if they have the same deformGroup they will break at the same time. And make sure to close the deform material section properly after you apply them to all the parts you want. I hope it's not too confusing, it's better to look at vanilla cars as reference.
     
  4. BB93

    BB93
    Expand Collapse

    Joined:
    May 17, 2023
    Messages:
    23
    I have done several parts with deformGroups, this is the first that is causing me issues and it's in a way that doesn't make any sense either, given the fog lights and the grille are two separate objects attached to the bumper, not just flexbodies into it.

    So far I've successfully made headlights, taillights, and windows, they all work perfectly.

    I have tried using single and double deform groups for the fog lights, as they're two separate meshes into a single 3d object(for 3d object I don't mean file, I literally mean the object in the 3d scene), either way, the game ends up changing the official grille material together with the lights, which is what is leaving me weird out given the lack of connection between the two objects and materials.


    Code:
    > Bumper
       > Fog lights(two pieces as a single object on the 3d scene)
       > Grille(a single object using the default grille material from the game)
    
    I'll add my grille jbeam down here;

    Code:
    "MODNAMELOL_bumper_F_revo_g": {
        "information":{
            "authors":"",
            "name":"Front Bumper Mesh",
            "value":40,
        },
        "slotType" : "MODNAMELOL_bumper_F_revo_g",
        "flexbodies": [
             ["mesh", "[group]:", "nonFlexMaterials"],
             ["MODNAMELOL_bumper_F_revo_g", ["MODNAMELOL_bumper_F"]],
        ],
    },
    

    This is how they were till now, grille and glass are two different objects, but I just tried making the fog glasses be two split objects and adding them separately to see how that won't change why the game is changing the material from an unrelated object with unrelated material.

    Now the jbeam looks like this:
    Code:
    ["MODNAMELOL_bumper_F_revo_projectors", ["MODNAMELOL_bumper_F"]],
    {"deformGroup":"foglight_R_break", "deformMaterialBase":"MODNAMELOL_glass_headlights_eu", "deformMaterialDamaged":"MODNAMELOL_glass_headlights_eu_dmg"},
    ["MODNAMELOL_bumper_F_revo_glass_R", ["MODNAMELOL_bumper_F"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>glassbreaksound2", "deformVolume":0.3}],
    {"deformGroup":"foglight_L_break", "deformMaterialBase":"MODNAMELOL_glass_headlights_eu", "deformMaterialDamaged":"MODNAMELOL_glass_headlights_eu_dmg"},
    ["MODNAMELOL_bumper_F_revo_glass_L", ["MODNAMELOL_bumper_F"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>glassbreaksound1", "deformVolume":0.3}],
    

    And here's the result in game:

    I'll keep doing tests until I figure it out, I guess.
     
    #4 BB93, Jul 15, 2023
    Last edited: Sep 1, 2023
  5. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,488
    If all the other stuff you made works perfectly, then why don't you just replicate the same thing, what you are doing with the syntax here is still weird.
     
  6. BB93

    BB93
    Expand Collapse

    Joined:
    May 17, 2023
    Messages:
    23
    I will check it again, but I'm pretty sure I have used as base the bumper itself, stripping it of everything except information, slot type, and flex bodies, after which I added glow maps and props from headlights(adjusting where needed, such as coordinates, nodes used for the props, etc).

    Could you point out what part feels weird to you?

    I checked the foglights from covet and they look 1:1 like this.
     
  7. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,488
    The whole section with the deformgroups is weird, unless you are not showing the whole thing.
     
  8. BB93

    BB93
    Expand Collapse

    Joined:
    May 17, 2023
    Messages:
    23
    I am, and it's 1:1 covet's(well, edited with my parts and textures names, and removing the exceeding bits).

    Covet's jbeam down here:

    Code:
    "covet_foglights_fl": {
        "information":{
            "authors":"BeamNG",
            "name":"Fog Lights",
            "value":30,
        },
    
        "slotType" : "covet_foglights_fl",
        "flexbodies": [
            ["mesh", "[group]:", "nonFlexMaterials"],
            {"deformGroup":"bumpersignal_L_break", "deformMaterialBase":"covet_glass", "deformMaterialDamaged":"covet_glass_dmg"},
            ["covet_foglightglass_L_fl", ["covet_bumper_F"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>glassbreaksound2", "deformVolume":0.3}],
            {"deformGroup":"bumpersignal_L_break", "deformMaterialBase":"covet_lights", "deformMaterialDamaged":"covet_lights_dmg"},
            ["covet_foglight_L_fl", ["covet_bumper_F"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>glassbreaksound1", "deformVolume":0.3}],
            {"deformGroup":"bumpersignal_R_break", "deformMaterialBase":"covet_glass", "deformMaterialDamaged":"covet_glass_dmg"},
            ["covet_foglightglass_R_fl", ["covet_bumper_F"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>glassbreaksound2", "deformVolume":0.3}],
            {"deformGroup":"bumpersignal_R_break", "deformMaterialBase":"covet_lights", "deformMaterialDamaged":"covet_lights_dmg"},
            ["covet_foglight_R_fl", ["covet_bumper_F"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>glassbreaksound1", "deformVolume":0.3}],
            {"deformGroup":""},
        ],
        "props": [
            ["func", "mesh", "idRef:", "idX:", "idY:", "baseRotation", "rotation", "translation", "min", "max", "offset", "multiplier"],
            {
                "lightInnerAngle":0,
                "lightOuterAngle":120,
                "lightBrightness":0.55,
                "lightRange":100,
                "lightColor":{"r":255, "g":255, "b":170, "a":255},
                "lightAttenuation":{"x":0, "y":1, "z":1},
                "lightCastShadows":false,
                "flareName":"vehicleHeadLightFlare",
                "flareScale":0.09,
                "cookieName":"art/special/BNG_light_cookie_headlight.dds"
                "texSize":512,
                "shadowSoftness":0.4,
            },
            ["fog" , "SPOTLIGHT", "fb2rr", "fb2r", "fb1rr", {"x":180, "y":0, "z":0}, {"x":0, "y":0, "z":0}, {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.2, "y":0.30, "z":0.05}"deformGroup":"bumpersignal_R_break"}],
            ["fog" , "SPOTLIGHT", "fb2ll", "fb2l", "fb1ll", {"x":0, "y":0, "z":0},   {"x":0, "y":0, "z":0}, {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.2, "y":0.30, "z":-0.05}"deformGroup":"bumpersignal_L_break"}],
         ],
    },
     
  9. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,488
    I see, you copied the code from the Covet and deleted half of it. Now that I look at it, you have many issues including wrong deformGroups on the props and syntax issues in the flexbodies. Please pay close attention to what you are editing and deleting.
    In case you don't understand the syntax: https://documentation.beamng.com/modding/vehicle/intro_jbeam/jbeamsyntax/
     
  10. ghost_cauli

    ghost_cauli
    Expand Collapse

    Joined:
    Jul 14, 2022
    Messages:
    1,250
    The code above is not complete, so it's kinda difficult to see where the issue is exactly (though it's easier to just drop many issues everywhere and refuse to elaborate), but here's the solution (provided, arguably, that the rest of this code works).

    Code:
        "flexbodies": [
             ["mesh", "[group]:", "nonFlexMaterials"],
             ["MODNAMELOL_bumper_F_revo_projectors", ["MODNAMELOL_bumper_F"]],
             {"deformGroup":"foglight_R_break", "deformMaterialBase":"MODNAMELOL_glass_headlights_eu", "deformMaterialDamaged":"MODNAMELOL_glass_headlights_eu_dmg"},
             {"deformGroup":"foglight_L_break", "deformMaterialBase":"MODNAMELOL_glass_headlights_eu", "deformMaterialDamaged":"MODNAMELOL_glass_headlights_eu_dmg"},
             ["MODNAMELOL_bumper_F_revo_glass", ["MODNAMELOL_bumper_F"]],
             {"deformGroup":""},
        ],
    When you're using the "deformGroup" thingamajig to add damaged material, make sure to add an empty {"deformGroup":""} on the bottom of the flexbodies section. Otherwise the game will freak out and swap out materials on the consequent part. Cherrier Vivace SV Series has the same issue, I've already contacted the author.
     
    • Like Like x 1
  11. BB93

    BB93
    Expand Collapse

    Joined:
    May 17, 2023
    Messages:
    23
    Thanks, you're the real mvp. I guess this now can be marked as solved ^^
     
  12. SSRG

    SSRG
    Expand Collapse

    Joined:
    Jun 17, 2023
    Messages:
    4,338
    So
    Can it?
     
  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