How does the skinning system work?

Discussion in 'Content Creation' started by mumboking, Dec 21, 2015.

  1. mumboking

    mumboking
    Expand Collapse

    Joined:
    Jun 11, 2015
    Messages:
    1,404
    Firstly, I'm not talking about the one for full car designs... I'm talking about the one used for changing the interior colour.
    I'd really appreciate some clear instructions on how to use this new system. I've been trying to add a skin to a part for hours with no luck.
     
  2. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,657
    gabester pretty much explained it already.
    It's the same system for skins, but now it's applicable to any material.

    Go to the moonhawk folder, and check the main .jbeam file (you will find the interior slots) and the material.cs (you will find the interior 'skins' there).
     
  3. mumboking

    mumboking
    Expand Collapse

    Joined:
    Jun 11, 2015
    Messages:
    1,404
    I know that, but do the materials have to be named a certain way for them to work?

    I've created a part with a slot for the skin and have also created a skin with material for that slot.
    It shows up in the selector, but the skin material doesn't get loaded.
     
  4. gabester

    gabester
    Expand Collapse
    Vehicle Director
    BeamNG Team

    Joined:
    Jun 6, 2012
    Messages:
    2,657
    The slot name needs to be "skin_something" (i.e. skin_interior). The material must then be "materialname.slotname.skinname". For example, "moonhawk_interior.skin_interior.red". Make sure you put quotes around the material name in materials.cs (singleton Material("moonhawk_interior.skin_interior.red")). If it doesn't have quotes, it won't work.
     
  5. mumboking

    mumboking
    Expand Collapse

    Joined:
    Jun 11, 2015
    Messages:
    1,404
    I'm having no luck. :confused:

    Here's the relevant lines in my materials.cs:
    Code:
    singleton Material("pessima.skin_bumper_F.test"){
        mapTo = "pessima.skin_bumper_F.test";
    Here's the skin's jbeam:
    Code:
    "pessima_skin_bumper_F_test": {
        "information":{
            "authors":"mumboking",
            "name":"Test",
            "value":10,
        },
        "slotType" : "skin_bumper_F",
        "skinName" : "test",
    },
    Yes, I have added a "skin_bumper_F" slot to a duplicated front bumper jbeam.

    What am I missing?
     
    #5 mumboking, Dec 21, 2015
    Last edited: Dec 21, 2015
  6. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,966
    Note, the skin starts with skin_ in gabesters example not pessima_

    EDIT:
    ignore me, although you might have typoed the name as you appear to have pessima. rather than pessima_


    EDIT AGAIN:
    Yeah had a look, I see nothing wrong
     
  7. Scepheo

    Scepheo
    Expand Collapse

    Joined:
    Feb 10, 2015
    Messages:
    601
    The "skin_bumper_F" slot doesn't exist. Try applying a skin to a part that actually has a skin slot.
     
  8. mumboking

    mumboking
    Expand Collapse

    Joined:
    Jun 11, 2015
    Messages:
    1,404
    I have already duplicated the front bumper's jbeam and added the slot to it. The skin shows up in the selector but the material doesn't get loaded.
     
  9. Scepheo

    Scepheo
    Expand Collapse

    Joined:
    Feb 10, 2015
    Messages:
    601
    Although for a different reason, my advice stands: it could be that the bumper is simply not UV mapped for it to be correctly shown. If you try to apply these same changes to a part that's already skinnable, that would make them a lot easier to get working. Once they're working, you can actually try to make the bumper skinnable.

    This isn't criticism or me telling you you're being an idiot by the way: it's honest advice about working order. Change only one thing at a time, so that when things break, you know what caused it. If you've already managed to successfully apply skins and make other parts skinnable, I can't help you.
     
  10. gabester

    gabester
    Expand Collapse
    Vehicle Director
    BeamNG Team

    Joined:
    Jun 6, 2012
    Messages:
    2,657
    The skin slot needs to be in the "main" vehicle part (pessima.jbeam). It won't work being in the front bumper part.
     
  11. mumboking

    mumboking
    Expand Collapse

    Joined:
    Jun 11, 2015
    Messages:
    1,404
    AH! It works now! Now I've just got to make some adjustments to the material name so I only skin the particular part.
    It would be nice if the skin selection worked from inside the part, instead of having to modify the main jbeam. You wouldn't have to worry about re-adding the slot after an update then.
    It's actually easier to just duplicate a part's mesh and jbeam, which is what I think I'll do now.
     
    #11 mumboking, Dec 22, 2015
    Last edited: Dec 22, 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