Jump to content

[SOLVED] Issues trying to reference stock textures from MODEL tag


Recommended Posts

I'm experimenting with making my own parts, and reusing the stock textures to reduce memory usage like what SXT does, but I'm getting a NullReferenceExeption when it attempts to compile the part with any external texture references in the MODEL flag. When I uncomment the texture lines it will work, but falls back to the dummy textures.

In unity I have a few materials that use the dummy textures I set up. I'm wondering if I need to use specific shaders or something? I'm using the KSP/specular shaders for them

Here are the errors I'm getting:

[LOG 09:38:07.498] PartLoader: Compiling Part 'KBM/Parts/Rack/KBM_4U_RCS/KBM_4U_RCS'
[ERR 09:38:07.498] PartLoader: Encountered exception during compilation. System.NullReferenceException: Object reference not set to an instance of an object
  at PartLoader.ReplaceTextures (UnityEngine.GameObject model, System.Collections.Generic.List`1 textureNames, System.Collections.Generic.List`1 newTextures) [0x00000] in <filename unknown>:0 
  at PartLoader.CompileModel (.UrlConfig cfg, .ConfigNode partCfg, Single scaleFactor, .AvailablePart partInfo) [0x00000] in <filename unknown>:0 
  at PartLoader.ParsePart (.UrlConfig urlConfig, .ConfigNode node) [0x00000] in <filename unknown>:0 
  at PartLoader+<CompileParts>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0 

[ERR 09:38:07.498] PartCompiler: Cannot compile part

 

The contents of KBM/Parts/Rack:

KBM_4U_RCS.cfg
Rack.mbm
RackRCS.mu
hex.mbm
hexNormal.mbm
rcs.mbm

my Config file

Spoiler

PART
{
    name = KBM_4U_RCS
    module = Part
    author = Andrew Cassidy

    MODEL
    {
        model = KBM/Parts/Rack/RackRCS
        texture = rcs , Squad/Parts/FuelTank/RCSTankRadial/model000
        texture = hex , Squad/Parts/Command/probeCoreHex/ksp_m_hexProbe_diff
        texture = hexNormal , Squad/Parts/Command/probeCoreHex/ksp_m_hexProbe_normal
        scale = 1.0, 1.0, 1.0
    }

    scale = 1.0
    rescaleFactor = 1.0
    node_attach = 0.0, 0.0, 0.22, 0.0, 0.0, -1.0
    TechRequired = advFlightControl
    entryCost = 6200
    cost = 200
    category = FuelTank
    subcategory = 0
    title = #autoLOC_500610 //#autoLOC_500610 = Stratus-V Roundified Monopropellant Tank
    description = #autoLOC_500611 //#autoLOC_500611 = Despite its fanciful name, the Stratus-V is quite simple - a small, radially attachable RCS tank.
    manufacturer = #autoLOC_6004000 //#autoLOC_6004000 = Stratus Corporation
    attachRules = 0,1,0,0,1
    mass = 0.02
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.2
    angularDrag = 2
    crashTolerance = 12
    maxTemp = 2000 // = 2900
    bulkheadProfiles = srf
    tags = #autoLOC_500612 //#autoLOC_500612 = fuel fueltank mono propellant rcs

    RESOURCE
    {
        name = MonoPropellant
        amount = 60
        maxAmount = 60
    }
}

 

Edited by cineboxandrew
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...