Jump to content

Modding help needed


Recommended Posts

Okay , your first thought might be, Hey this isnt a tutorial!, well your right, it isnt,but since im creating a mod, and im having difficulty, i figured it would be logical to put it somewhere where experienced modders browse.

Okay my mod is a simple engine mod, ive made the model ive textured it, but for some strange reason when i add it to my vessel in the editor, its pointing downwards, but when i let open the throttle, the thrust is going the right way while the model is pointing down, im going t share two code sets, one is working with the warp plugin, and the other uses stock code

  • PART
    {
    name = Warp nacell //This MUST be unique!!!
    module = Part
    author = 
    mesh = Model.mu    //This is case sensitive, and assumed the config is in the same folder as your .mu 
    rescaleFactor = 1.0 // default is 1.25 Use at your discretion. 
    node_stack_top = 0.0, 0, 0, 0.0, 0, 0.0, 0 //this defines a stack node. See Note below. 
    node_stack_bottom = 0.0, -1.0, 0.0, 0.0, 0, 0.0, 0
    node_attach = 0, -1.37, -0.44, 1.0, 0.0, 0.0 //this is the surface attachment node. 
    TechRequired = basicRocketry //defined the tech node 
    entryCost = 120000 
    cost = 150000 
    category = Engine //Only certain categories are pre-defined. Be careful to choose one of them. 
    subcategory = 0 
    title = The mk1 warp 2 naccel //This is what appears in the editor tool tip box 
    manufacturer = Eadge rotary's laboratory
    description = This fine peice of machinery will do one of three things, 1 work, 2 destroy your ship , 3destroy the solarsystem, use at your own risk. 
    attachRules = 1,1,1,1,0 // attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision 
    mass = 9
    dragModelType = default 
    maximum_drag = 0.2 
    minimum_drag = 0.2 
    angularDrag = 2 
    crashTolerance = 20 
    maxTemp = 200000 
    breakingForce = 500000 //how much force before the joint breaks 
    breakingTorque = 500000 //how much twisting before the joint breaks 
    bulkheadProfiles = size3, srf //part size for sorting in the editor. Does not affect part physics. 

    //PART MODULES AND RESOURCE DEFINITIONS GO HERE
    MODULE
    {
        name = USI_ModuleWarpEngine
        WarpFactor = 5
        deployAnimationName = Engage
        warpAnimationName = WarpField
        MinThrottle = 0.05
        DisruptRange = 2000
        BubbleSize = 200
        MinAltitude = 1
        MaxAccelleration = 6
        unfoldAnimationName =
    }

    MODULE
    {
          name = FXModuleAnimateThrottle
          animationName = EngineThrottle
          dependOnEngineState = True
          responseSpeed = 0.05
    }

    MODULE
    {
        name = ModuleResourceConverter
        StartActionName = Start ExoticMatter 
        StopActionName = Stop ExoticMatter
        INPUT_RESOURCE
        {
            ResourceName = ElectricCharge
            Ratio = 10000
        }
        OUTPUT_RESOURCE
        {
            ResourceName = ExoticMatter
            Ratio = 1
        }
    }

    MODULE
    {
        name = ModuleEngines
        thrustVectorTransformName = thrustTransform
        exhaustDamage = False
        ignitionThreshold = 0.1
        minThrust = 0
        maxThrust = 1
        heatProduction = 10
        fxOffset = 0, 0, 0
        PROPELLANT
        {
            name = ElectricCharge
            ratio = 2.9
            DrawGauge = True
        }
        PROPELLANT
        {
            name = ExoticMatter
            ratio = 1
            DrawGauge = True
        }
        PROPELLANT
        {
            name = XenonGas
            ratio = .1
            DrawGauge = True
        }

        atmosphereCurve
         {
            key = 0 15000
           key = 1 7500
         }    
    }


    RESOURCE
    {
     name = ExoticMatter
     amount = 15000
     maxAmount = 15000
    }

    RESOURCE
    {
     name = XenonGas
     amount = 3000
     maxAmount = 3000
    }

    }

  • PART
    {
        name = Warp nacell //This MUST be unique!!!
        module = Part
        author =
        mesh = Model.mu    //This is case sensitive, and assumed the config is in the same folder as your .mu 
        rescaleFactor = 1.0 // default is 1.25 Use at your discretion. 
        node_stack_top = 0.0, 0, 0, 0.0, 0, 0.0, 0 //this defines a stack node. See Note below. 
        node_stack_bottom = 0.0, -1.0, 0.0, 0.0, 0, 0.0, 0
        node_attach = 0, -1.37, -0.44, 1.0, 0.0, 0.0 //this is the surface attachment node. 
        TechRequired = basicRocketry //defined the tech node 
        entryCost = 120000 
        cost = 150000 
        category = Engine //Only certain categories are pre-defined. Be careful to choose one of them. 
        subcategory = 0 
        title = The mk1 warp 2 naccel //This is what appears in the editor tool tip box 
        manufacturer = Eadge rotary's laboratory
        description = This fine peice of machinery will do one of three things, 1 work, 2 destroy your ship , 3destroy the solarsystem, use at your own risk. 
        attachRules = 1,1,1,1,0 // attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision 
        mass = 9
        dragModelType = default 
        maximum_drag = 0.2 
        minimum_drag = 0.2 
        angularDrag = 2 
        crashTolerance = 20 
        maxTemp = 200000 
        breakingForce = 500000 //how much force before the joint breaks 
        breakingTorque = 500000 //how much twisting before the joint breaks 
        bulkheadProfiles = size3, srf //part size for sorting in the editor. Does not affect part physics. 

    //PART MODULES AND RESOURCE DEFINITIONS GO HERE
        {
            name = ModuleEngines
            thrustVectorTransformName = thrustTransform
            exhaustDamage = True
            ignitionThreshold = 0.1
            minThrust = 0
            maxThrust = 65000
            heatProduction = 350
            fxOffset = 0, 0, 1.2
            EngineType = LiquidFuel
            PROPELLANT
            {
                name = ElectricCharge
                ratio = 0.9
                DrawGauge = True
            }
            PROPELLANT
            {
                name = XenonGas
                ratio = 1.1
                DrawGauge = True
            }
        }
        MODULE
        {
            name = FXModuleAnimateThrottle
            animationName = ksp_l_midrangeEngine_anim
            responseSpeed = 0.001
            dependOnEngineState = True
            dependOnThrottle = True
        }
        RESOURCE
        {
            name = ElectricCharge
            amount = 0
            maxAmount = 0
            isTweakable = false
            hideFlow = true
        }
    }

Theres the code, the warp version provides thrust, while the stock coded one doesnt, and i cannot figure out why. Advice and constructive critisism are welcomed. thanks for reading

Edited by Derpistheword
Link to comment
Share on other sites

If you're too lazy to share your pics though, you can try rotate it on your own, it's probably a 90 degree rotate of an axis on Unity. Remember to rotate the model and the collider. Or just rotate its holder. I'm not sure if you can rotate the export holder (empty gameobject placed initially) without having problems though.

The reason is your model is rotated differently when it passed through unity, it's somewhere here in the forums. You've probably had the thrustTransform correct though which explains why it thrusts correctly. If this didn't solve your problem, well, it might be a more complicated problem, you really gotta post a pic. :P

Link to comment
Share on other sites

You only need to rotate the thrustTransform, not the whole model. While it does not necessarily have to be, I find it's generally easier to have an empty object serving as the thrustTransform so you can move it about freely without messing up the model.

It's the Z+ axis in Blender, which I believe becomes the Y+ axis in Unity. I don't have it in front of me though, so naturally I could be wrong.

Link to comment
Share on other sites

Well I suspected that the problem is from the import in unity where you have to be mindfull of the axis. I also think that his thrust transform is in fact facing backward (compared to his model) as he say:

On 2/12/2015 23:50:14, Derpistheword said:

the thrust is going the right way while the model is pointing down

 but without pics, it's only a supposition.

Edited by Hary R
Link to comment
Share on other sites

4 hours ago, Derpistheword said:

that seems like a good idea, ill try both, but i'm at work right now (shhh! dont tell my boss) XD

Although, that still doesnt solve the problem with the stock version not providing thrust, or fuel from the alternator.

You left out the atmosphere curve.

Link to comment
Share on other sites

On 12/4/2015, 12:56:05, Hary R said:

Well I suspected that the problem is from the import in unity where you have to be mindfull of the axis. I also think that his thrust transform is in fact facing backward (compared to his model) as he say:

 but without pics, it's only a supposition.

Well your correct thats whats happening. the models natural direction is down, but the thrust is going the correct way

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...