Jump to content

Makin' part mods. need insight on local transforms for mirrored parts


REDACT3D

Recommended Posts

hey guys.

 

I'm just makin' a bunch of new parts and suddenly have hit a wall of confusion related to the Origin Points on each game object that's nested in each part hierarchy.  For example, here's what a wing part hierarchy would look like to me in blender.

--------eg:---------

-Wing

------- WingMesh

                        | _____ wing.collider

 

Wing is an empty game object at world position 0,0,0 with a rotation of 0,0,0,0,  (is the root .mu used for attaching and scale)

 WingMesh is the actual mesh with the UV's, textureing and mesh renderer and filter and material. basically what you see.

and wing.collider a child of the Wing mesh. this is the convex hull or collider used to raycast for clicking and for drag? 

 

 

 

Can load up each kind of wing and look at how it's set up. but each one is not the same.

As in: does not follow the same standard structure of hierarchy lol

 

anyone have info how the rotations are actually supposed to be set up?

it appears that the root is always 000000 but sometimes wings use a PointOfLift empty game object to define the forward vector for the lift i guess?

 

the "documentation" that i can find, is just a big list of namespcaes. but they don't even say what they do lol

Kerbal Space Program: PartModule Class Reference

 

 

is "lift" calculated globally and always Y positive? lol 

basically im asking what way is up and forward haha

 

 

What I do now is just set the angles to some arbitrary 90 dagree value and litrally load and run the entire game to see if the lift applies correctly and the mirroring works. but maybe some insight from a fellow nerd may save some time. 

Edited by REDACT3D
spelling and formatting
Link to comment
Share on other sites

13 hours ago, REDACT3D said:

hey guys.

Hi.

It is always good to look at the config file for a part at the same time you are looking at the .mu file in Blender, to get an idea of what relates to what.

The top of the heirachy, an empty, will always be at 0,0,0 which is the world origin. It's rotation will always be (when using Quaterions(which you always should for parts in KSP)) 1,0,0,0

Anything lower will hold it's rotation position based on what is higher up the heirachy. So you must always have an empty at the top, because it will always load the same way around, even if you rotated it before export. This way what you rotate in your mesh or other empties inside the top of the heirachy will remain in the orientation you had them on export. Best practice is to have 2 empties at the top, one inside the other, and in some meshes this is essential for certain things to work. Retractable landing gear is an example where it is a hard requirement.

Having your mesh and everything else inside the second empty  acts as a buffer if you have any animations, it also means everything can be rotated, moved or rescaled as one whole model.

The collider, that in your example has the mesh as its parent, is required for being able to select the part both in editing and out in world, also for a Kerbal, or a part that is not part of the craft that it is attached to, to physically interact with. It has no affect on drag or any other calculation in game. If you forget to give a mesh a collider, then even though you can select it from the part list, once placed you won't be able to click on it again.

Drag, buoyancy and all other calculations are derived from the mesh itself.

A collider does not need to be a child to the mesh but generally is created as a child so that if you move the mesh or rescale it in the Main workspace, the collider moves and rescales with it.

So lets start with the squad wing called "connector1" in the folder structure. Kerbal Space Program\GameData\Squad\Parts\Aero\wings\

In Blender we can see it's heirachy is

connector1 (which is an empty)

                 >Connector1(the mesh)

                 >COL(which is the collider)

Notice that in this case the collider is not a child of the mesh.

We can also see that the top of the heirachy at world origin is on an edge of the wing.

Without parameters in the config file to adjust this, the centre of lift, centre of mass and centre of pressure would be considered to be at the world origin.

So this gets adjusted in the config as can be seen in the spoiler below.

Spoiler

PART
{
    name = wingConnector
    module = Part
    author = Porkjet
    rescaleFactor = 1
    node_attach = 0.008, 0.0, 0.0, 1.0, 0.0, 0.0, 1
    CoMOffset = -0.9309626, 0.07127571, 0
    CoLOffset = -0.9309626, 0.07127571, 0
    CoPOffset = -0.9309626, 0.07127571, 0

    TechRequired = aerodynamicSystems
    entryCost = 6400
    cost = 500
    category = Aero
    subcategory = 0
    title = #autoLOC_500229 //#autoLOC_500229 = Wing Connector Type A
    manufacturer = #autoLOC_501624 //#autoLOC_501624 = C7 Aerospace Division
    description = #autoLOC_500230 //#autoLOC_500230 = A vaguely wing shaped board. Use at your own risk.
    attachRules = 0,1,0,1,1
    mass = 0.2
    thermalMassModifier = 8.0
    // heatConductivity = 0.06 // half default
    emissiveConstant = 0.95
    dragModelType = none
    maximum_drag = 0.02
    minimum_drag = 0.02
    angularDrag = 2
    crashTolerance = 15
    maxTemp = 2400
    explosionPotential = 0.1
    fuelCrossFeed = True
    bulkheadProfiles = srf
    tags = #autoLOC_500231 //#autoLOC_500231 = aero aircraft fligh foil lift plane
    MODEL
    {
        model = Squad/Parts/Aero/wings/connector1
    }
    MODULE
    {
        name = ModuleLiftingSurface
        useInternalDragModel = True
        deflectionLiftCoeff = 2.0
        dragAtMaxAoA = 0.5
        dragAtMinAoA = 0.0
    }    
    MODULE
    {
        name = ModuleCargoPart    
        stackableQuantity = 1
        packedVolume = -1
    }
}

The wing is designed to surface attach on it's right hand edge, based on the way it is spawned in to the SPH or VAB.

The Bolded parameters tell the game to adjust the centre for those factors to the left, to roughly the centre of the wing surface.

If you make new wings, make sure to keep the orientation of your wings the same as stock, so the game knows which sides are meant to be the lift surface and which the edge.

I will copy this reply to my thread incase it is of any help to anybody else. If you have other questions that my thread doesn't cover then feel free to post a question there and I will see if I can help.

 

 

 

Edited by ColdJ
Link to comment
Share on other sites

Wow thank you very much ColdJ, this helps quite a bit.

Of course, this spawns more questions but you have confirmed that the hierarchy system works as expected in both unity and blender.  with how parenting game objects works in relation to local transforms and world transforms.

 

About those Rotations being a Quaternion instead of Euler Angles. Do you mean you have to manually change the "tool" from Euler to Quaternion within blender?   I've noticed that for things like payload door animations, you have to change the rotations otherwise it uses the Euler and only operates the door a small rotation amount equivalent to that rotation angle From Quaternion to Euler.   I assume this is because of how the unity engine uses those values and no conversions are being done as that would run slower. idk but yeah so you just set everything to Quat's eh?

 

And thank you for explaining that the offset was for  the lift point.  And for telling me that it's the right hand side default. 

of course I'm using the left.  I was considering that as an issue but I was like "nah that's too dumb" lol interesting. guess I need to pay closer attention lol

 

how do you define the correct center of lift by referencing a game object?

i see at the top the hardcoded position

but it would be easier setup  imo to reference an object origin in blender you know?

 

Appreciate your input bud 

 

 

Link to comment
Share on other sites

8 hours ago, REDACT3D said:

About those Rotations being a Quaternion instead of Euler Angles. Do you mean you have to manually change the "tool" from Euler to Quaternion within blender?   I've noticed that for things like payload door animations, you have to change the rotations otherwise it uses the Euler and only operates the door a small rotation amount equivalent to that rotation angle From Quaternion to Euler.   I assume this is because of how the unity engine uses those values and no conversions are being done as that would run slower. idk but yeah so you just set everything to Quat's eh?

Yes... I guess you can "fix" this, if you've set your keyframes using Euler... but its quite a pain in the butt.
So, yes, before inserting your keyframes, make SURE your rotations are set to Quarts first.

Edited by Stone Blue
Link to comment
Share on other sites

beauty thanks Stone Blue.

Quick question: Is it possible to use 'Animation Tracks' to animate Attachment Node positions?  or are those just baked as a static location point and cannot be set dynamically?

 

For example, a piston that has a "shaft boot" that "scales" like an accordion. or bellows, while the Cap translates along a linear axis. Giving the effect that the rubber boot is expanding.  Rather than multiple several telescopic tubes that translate along the same axis. 

 

I can get the animation to work just fine, as in it will extend and retract and can even attach parts to the top of a piston however the attached part does not follow the attachment node when it is animating.  I would expect that parenting the node_stack_top  to the part of the piston that moves would also make the attachment point move with it. But doesn't?

 

I guess that's why we don't see attachment nodes on payload doors and stuff eh?

Can make a regular piston just fine, but it's trying to mix the animation with the piston thing that's gettin' me.

Here's a piston I made last night that works great for example. but doesn't use the scale thing on a boot :(

PART {
    name = Actuator
    module = Part
    author = REDACTED
    mesh = Actuator.mu
    rescaleFactor = 1
    scaleFactor = 1
    TechRequired = none
    entryCost = 0
    cost = 0
    category = 0
    subcategory = 0
    title = Actuator
    manufacturer = REDACTED
    description = An actuator.
    attachRules = 1,1,1,1,0
    mass = 0.001
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.3
    angularDrag = 1
    crashTolerance = 50
    breakingForce = 50
    breakingTorque = 50
    maxTemp = 2500
    emissiveConstant = 0.8
    bulkheadProfiles = 0
    tags = Piston
    MODULE {
        name = ModuleRoboticServoPiston
        servoTransformName = Shaft
        servoSrfMeshNames = CapCOL.collider
        baseTransformName = Motor
        servoAttachNodes = top
        traverseVelocityLimits = 0.1, 1
        hardMinMaxLimits = 0,1
        softMinMaxExtension = 0,1
        mainAxis = Y
        servoMass = 0.25
        maxMotorOutput = 100
        positionSpringMutliplier = 100
        positionDampingMutliplier = 20
        motorizedMassPerKN = 0.0002
        motorizedCostPerDriveUnit = 1
        efficiency = 0.75
        baseResourceConsumptionRate = 0.01
        referenceConsumptionVelocity = 1
        RESOURCE {
            name = ElectricCharge
            rate = 0.1
        }

    }

    MODULE {
        name = ModuleResourceAutoShiftState
        affectedResourceName = ElectricCharge
        affectedModuleName = ModuleRoboticServoPiston
        resourceShutOffHandler = true
        resourceStartUpHandler = true
        resourceShutOffStartUpUsePercent = true
        resourceShutOffAmount = 0
        resourceShutOffPercent = 0
        resourceStartUpAmount = 0
        resourceStartUpPercent = 5
    }

    NODE {
        name = top
        transform = node_stack_top
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = bottom
        transform = node_stack_bottom
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

}

 

 

Also LOL,

I would like to play audio when my items move but not sure how to set that up from scratch.

for parts that normally have sound like landing gear. I can just coppy the FX event stuff but still not sure how to set that up.

 

in unity it's fairly easy to make an Audio Clip Play, just don't understand how to set that up in the .cfg file lol

Would be nice to add motor servo sounds that has the pitch change relative to the speed of the motor.

 

I noticed BD Armory has some parts with sound that do this. but I guess the actual events are in some other file? hum.

I'll get it.. lol 

 

 

Link to comment
Share on other sites

51 minutes ago, REDACT3D said:

Quick question: Is it possible to use 'Animation Tracks' to animate Attachment Node positions?  or are those just baked as a static location point and cannot be set dynamically?

Its totally possible from a modelling standpoint. However, I am pretty sure animating attachment nodes (with stuff attached to them), is either not possible, or pretty tricky IIRC, from the way KSP itself is coded.
There is a mod, that did some stuff with animated attachment nodes. Not sure if it works in 1.12.+ or not, or if it would suit your needs:
 

 

55 minutes ago, REDACT3D said:

For example, a piston that has a "shaft boot" that "scales" like an accordion. or bellows, while the Cap translates along a linear axis. Giving the effect that the rubber boot is expanding.  Rather than multiple several telescopic tubes that translate along the same axi

*THIS*, you can absolutely do... as long as you're talking about gameobjects *within the same model/part*... MANY mods do this. And yes, you can also have them *translate* as well... again, as long as they are in the same model/part.

Link to comment
Share on other sites

1 hour ago, REDACT3D said:

I can get the animation to work just fine, as in it will extend and retract and can even attach parts to the top of a piston however the attached part does not follow the attachment node when it is animating.  I would expect that parenting the node_stack_top  to the part of the piston that moves would also make the attachment point move with it. But doesn't?

Yeah.. there again... KSP itself doesnt allow animating of attachment points. i mean, the nodes probably *are* animating like you want... just any *other* parts attached to them *wont* move with them.
Again, if you *do* need that functionality, mebbe tae a loo at that modlink i potsed. It *would* require that mod, to be a hard dependency for *your* stuff, tho

As to your part cfg, you dont need this line:

module = Part

Also, the model definition key has been deprecated. (ie the `mesh = Actuator.mu`)
Look at a recent part mod cfg, and you'll see a node, that replaces that deprecated key.
Looks like:
MODEL
{
       model = <URL path to model filename>
}

You also dont need the `scaleFactor = 1' line... *unless*, you want to rescale the part by a factor *other* than 1... 1 is already default

 

Edited by Stone Blue
Link to comment
Share on other sites

Oh perfect bud thanks!

I will have to experiment with this Animated Attachment Module.  Says it just makes it work automatically so should be easy to test lol

this is the only code I can read from that file:

// Add AnimatedAttachment modules to Squad assets 
@PART[*]:HAS[@MODULE[ModuleAnimateGeneric]]:NEEDS[AnimatedAttachment] {  %MODULE[AnimatedAttachment] { } }
@PART[*]:HAS[@MODULE[ModuleGimbal]]:NEEDS[AnimatedAttachment] {  %MODULE[AnimatedAttachment] { } }
@PART[*]:HAS[@MODULE[ModuleControlSurface]]:NEEDS[AnimatedAttachment] {  %MODULE[AnimatedAttachment] { } }
@PART[*]:HAS[@MODULE[LaunchClamp]]:NEEDS[AnimatedAttachment] {  %MODULE[AnimatedAttachment] { } }

Not a lot to work "with" (4 lines of code) but if it's automatic I guess all it has to do is toggle the metaphorical enable button.  Good because it works. Bad because I don't know how it works. lol

If I could get the stock game to scale the "boot" in the Y Axis while the "Cap" translates inside the Servo Module that would mean I don't have to use the module for that particular part.  That would be a bonus in my eyes. Less to go wrong.

You mentioned that it's possible to scale the game object dynamically with code along with the transform translation. Thats good news! But how is this accomplished?   Is there a variable I can add that does this? 

I see the ModuleRoboticServoPiston has the Public variable "MainAxis = Y" That should define the Axis of translation. but is there a similar value that I can use to control the relative scale in the same axis? or can you think of a part that does both the piston movement, with dynamic attach point locations and also scales along a definable axis?  

 

Also just want to say thanks for helpin' me out here. really appreciate it. 

It's nice to chat about it with someone else who doesn't look at you like you're speaking a different language lol  

 

 

 

 

Link to comment
Share on other sites

 

Oh, Awesome, thanks for the formatting tips!

Oh yeah lol, that scaleFactor was accidently left in lol. I was trying to rescale the part after exporting the .mu like a lazy person.. Spoilers. it didn't work. messes up the transforms.  goes all whacky. But learned that there's a difference between the build view and the world view. As in, it appears to rebuild (and rescale) the part when you load the craft. I'd never even thought about that before. But obviously has to instantiate the gameobjects in non kinematic mode lol.  Good eye man.

Okay, I'll use the directory point method of defining the .mu asset files from now on.   It seemed easier to just type mesh = demo.mu then to type the file location for each one at first.  Like makes it easy to look at for my new eyes. less stuff going on. But if it's the new standard, why not.   Seems like more work but must be used for somthin' .

 

OH

can you re-order the variables? does the order of operations apply to how the variables are laid out?

Like could i do this instead? : 

PART {
    mesh = Actuator.mu // I know now this is not the right way
    name = Actuator
    manufacturer = REDACTED
    author = REDACTED
    title = Actuator
    description = An actuator.
    category = 0
    subcategory = 0
    TechRequired = none
    entryCost = 0
    cost = 0
    TechRequired = none


    attachRules = 1,1,1,1,0
    mass = 0.001
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.3
    angularDrag = 1

    crashTolerance = 50
    breakingForce = 50
    breakingTorque = 50
    maxTemp = 2500
    emissiveConstant = 0.8
    bulkheadProfiles = 0
    tags = Piston
    MODULE {
        name = ModuleRoboticServoPiston
        servoTransformName = Shaft
        servoSrfMeshNames = CapCOL.collider
        baseTransformName = Motor
        servoAttachNodes = top
        traverseVelocityLimits = 0.1, 1
        hardMinMaxLimits = 0,1
        softMinMaxExtension = 0,1
        mainAxis = Y
        servoMass = 0.25
        maxMotorOutput = 100
        positionSpringMutliplier = 100
        positionDampingMutliplier = 20
        motorizedMassPerKN = 0.0002
        motorizedCostPerDriveUnit = 1
        efficiency = 0.75
        baseResourceConsumptionRate = 0.01
        referenceConsumptionVelocity = 1
        RESOURCE {
            name = ElectricCharge
            rate = 0.1
        }

    }

    MODULE {
        name = ModuleResourceAutoShiftState
        affectedResourceName = ElectricCharge
        affectedModuleName = ModuleRoboticServoPiston
        resourceShutOffHandler = true
        resourceStartUpHandler = true
        resourceShutOffStartUpUsePercent = true
        resourceShutOffAmount = 0
        resourceShutOffPercent = 0
        resourceStartUpAmount = 0
        resourceStartUpPercent = 5
    }

    NODE {
        name = top
        transform = node_stack_top
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = bottom
        transform = node_stack_bottom
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

}

 

Edited by REDACT3D
added stuff
Link to comment
Share on other sites

https://i.imgur.com/655nYoP.mp4

https://i.imgur.com/VgsHGlH.png

https://i.imgur.com/TzBe6lB.png

Oh my god the Animated Attached works haha

 

PART {
    name = SquarePiston
    module = Part
    author = REDACTED
    mesh = SquarePiston.mu //temp
    rescaleFactor = 1
    TechRequired = none
    entryCost = 0
    cost = 0
    category = 0
    subcategory = 0
    title = SquarePiston
    manufacturer = REDACTED
    description = A square piston.
    attachRules = 1,1,1,1,0
    mass = 0.001
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.3
    angularDrag = 1
    crashTolerance = 50
    breakingForce = 50
    breakingTorque = 50
    maxTemp = 2500
    emissiveConstant = 0.8
    bulkheadProfiles = 0
    tags = Piston
    MODULE {
        name = ModuleAnimateGeneric
        animationName = NlaTrack
        actionGUIName = TogglePiston
        startEventGUIName = Retract Piston
        endEventGUIName = Extend Piston
        actionAvailable = true
        animationIsDisabled = false
        allowManualControl = true
        allowAnimationWhileShielded = true
        allowDeployLimit = true
        revClampDirection = false
        revClampSpeed = true
        revClampPercent = true
    }

    NODE {
        name = top
        transform = node_stack_top
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = bottom
        transform = node_stack_bottom
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

}

woot!

 

Link to comment
Share on other sites

* Typing intensifies * 

Going to make a bunch of interesting shapes. since the animation thing works. that swings the door open for all kinds of stuff.

Mabe some arch shapes that move along an arch shaped path. 

oh and some interesting air intakes that can deploy.  or supersonic nose cones wow beauty haha

 

Looks like you can also toggle if the attached part "sticks" to the local position or not.   so you can use the commands to 'inch' a motor along a track.  or control the position of an object like a grabber.   looks like it unparents the game object when toggled.

Can actually make payload doors with attach points nice!

 

thanks again for the insight!

I guess now I can focus on the best way to distribute and format it all.  BEFORE I texture everything.  Will Bake the diffuse textures at 1024 into a single atlas. and all that jazz. for testing I'm just using separate ,png's for each material.  (at 4096 resolution lol)  and that thing with the folders.

could you please point me in the direction of how to get a mod package approved for others to consume?

I know it's common to use Git, but what is the official way?

standby. 

Edited by REDACT3D
added question about how to distribute
Link to comment
Share on other sites

@REDACT3D lol I'm glad I sparked something.

You'll want to see this thread for what's good (or not) when publishing a mod.

GitHub is not an "official" way (at least, not as far as Squad is concerned). GitHub is the most preferred because it's a revision control service and most mods will have changes and updates to their configs and dll's, not to their textures. It's the best for empowering collaboration and looking back at previous edits of files, and CKAN integrates with it.

Once you're ready to publish a mod, just do it, according to the rules and upload your releases to GitHub (if you want revision control) or SpaceDock. There's no waiting on an admin of something to approve your upload.

 

Link to comment
Share on other sites

Hi @REDACT3D.

Sorry, I have been working and so have not been on for 2 days.

I see you have been kept busy with lots of new info and a mod to add moving attachment points. Just remember that if you want to release your own mods and they are using that mod to work, that you need to make sure people know it is a dependency they need to install as well.

There are a few things that I have a different slant on, compared to what has been said. I don't wish to be at odds but all info gained is good and you should be able to to see the whole in order to make your own decisions.

module = Part

Should not be removed, even if you are using

MODEL
{
       model = <URL path to model filename>
}

Because there are other configuration files that use it to be clear of the intention. Statics files are another type of configuration file used for adding structures to the world that are fixed in place. They use.

    static = true

along with

module = Part

Just look through lots of stock parts and you will see they still use it even though they use the new system. It is better to be in the habit of using it than not and then wondering why something isn't working that might still need it.

When using

mesh = SquarePiston.mu

etc, you need to remember that the config file will use the first .mu in alpha/numerical order that is in the folder with the config file. It does not matter what you put in mesh = .mu, it will just go for the first one in the folder based on the computer filing system. So if you have more than one .mu in the same folder it will always use the one considered first in alpa/numeric order, not the one you specified unless it is named as such that it is picked first.

That is why we use the newer

MODEL
{
       model = <URL path to model filename>
}

Because it defines exactly, so you can have many .mu in the same folder and it will only use the exact one you define, you can even put the .mu in other folders this way.

Do not get rid of

scaleFactor = 1

There are still parts that make use of it. The easiest example off the top of my head is grabbers, also known as Klaws. If you remove it they will load as being 1.25 even though you built them a scale 1 in blender.

As you probably have already worked out.

rescaleFactor = 1

is what you can adjust to change the size of a part and make sure the attach nodes get rescaled with it. It works 99% of the time. Have hit some that refused to scale right but don't know why. Remember to use fractions for average adjustments unless you are wanting to go huge as rescaleFactor = 2 is double the size etc. There was one size that refused to scale, it may have been if you set it to 1.25, but I can't recall for sure.

Do you mean you have to manually change the "tool" from Euler to Quaternion within blender?

When doing from scratch it is best to manualy switch a mesh as soon as it is spawned, so you don't forget later. You can still rotate, move and/or scale by degrees both in the work spaces or animation, but they will automatically be saved in Quaternions.

On 11/17/2022 at 3:52 PM, REDACT3D said:

how do you define the correct center of lift by referencing a game object?

Every part created in blender and I would assume unity, uses the world centre as the centre of everything.

So wherever the top of your heirachy is (which you always keep at world centre) is where the game will use to set centre of mass, lift, pressure etc. Unless you adjust it in the config file. It doesn't matter where your mesh goes, whether it is considered 0,0,0 under its parent or some other numbers, it will be the word centre that is used. This can be used to your advantage if you think it out, depending on what you want to do. It is why some cockpits that you put out into the world by themselves will suddenly stand on their ends. The world centre is at their base and so the empty side is considered heavier. Parts designers tend to do this so that aircraft, when put together, have a more centred mass, without having to work it out. As to the correct part of a wing for centre of lift, that is based on where you want it to be. The stock goes for the centre of the wing as being likely, but if you are making some fancy shape then you can choose to have it on a different section.

And though the orientation needs to be the same, you don't have to have the world centre at the edge, you could have it at the centre if you wanted, but you would then need to redefine the attachment node in the config. Though it is possible to use the plugin template to try to define nodes, and it is even possible to create empties as nodes, I find it best to do them manualy in the config. The easiest for me is to spawn a separate circle mesh outside the heirachy, set to triangle fan, then move it to where I want the node to be and copy its world co-ordinates into the config. Just remember that Y and Z are swapped in blender compared to unity. Triangle fan means I can line it up very accurately.

Quick question: Is it possible to use 'Animation Tracks' to animate Attachment Node positions?  or are those just baked as a static location point and cannot be set dynamically?

As you have seen there is a mod plugin to let you do this, but if you want to do it using Breaking Ground robotics, then you need to know that they don't use animations. They use modules that reference named game objects and move them in game along defined axies by mathematical amounts. So if you have Breaking Ground, open a .mu from robotics in blender, then bring up the config file for that part and compare to see which mesh parts get moved by the modules and by how much, to get the effect. The location of the point considered to be the meshes origin point is very important to how they work. This is why they can move the attachment node positions in game.

On 11/18/2022 at 3:55 AM, REDACT3D said:

I would like to play audio when my items move but not sure how to set that up from scratch.

 

You can use this

https://spacedock.info/mod/2345/ModuleAnimateGenericEffects#info

It gives you a version of AnimateGeneric that you can assign sound to. (Just don't use 0.1.4 as it has a glitch. ).1.3 or 0.1.5 (which is actually 0.1.3 corrected for CKAN) are fine.

Example of a setup used by one of my mods.

Spoiler

    MODULE
    {
        name = ModuleAnimateGenericEffects
        animationName = Fuel
        startEventGUIName = Open Port
        endEventGUIName = Close Port
        actionGUIName = Fuel Hatch
        //defaultActionGroup = Gear
        layer = 2
        deployEffectName = deploy

        postDeployEffectName = deployed
 
        postDeployEffectLength = 5.0
        retractEffectName = retract

        postRetractEffectName = retracted
 
        postRetractEffectLength = 5.0

        animSpeed = 1

    
    }

    EFFECTS
    {
        deploy
        {
            AUDIO
            {
                channel = Ship
                clip = Thunderbirds/Sounds/Gear
                volume = 0 0
                volume = 1 0.7
                pitch = 0.75
            }
            AUDIO_LOOP
            {
                channel = Ship
                clip = Thunderbirds/Sounds/Gear
                volume = 0 0
                volume = 1 0.7
                pitch = 0.55
            }
        }
        deployed
        {
            AUDIO
            {
                channel = Ship
                clip = Thunderbirds/Sounds/Lock
                volume = 0 0
                volume = 1 0.7
                pitch = 0.50
            }
        }
        retract
        {
            AUDIO
            {
                channel = Ship
                clip = Thunderbirds/Sounds/Gear
                volume = 0 0
                volume = 1 0.7
                pitch = 0.60
            }
            AUDIO_LOOP
            {
                channel = Ship
                clip = Thunderbirds/Sounds/Gear
                volume = 0 0
                volume = 1 0.7
                pitch = 0.50
            }
        }
        retracted
        {
            AUDIO
            {
                channel = Ship
                clip = Thunderbirds/Sounds/Lock
                volume = 0 0
                volume = 1 0.7
                pitch = 0.75
            }
        }
    }

The sound in "clip =" is the folder path and the name of the sound file. You don't need the suffix and ".wav",".mp3" and ".ogg" are all valid types"

 

I hope that covers it.

Best advice is open lots of configs and read what they have set up. Compare in game and in blender to see how the configs relate to the .mu

Stock parts are always built to work so they are best to use as examples. Start with the standard Mk1 pod config

Kerbal Space Program\GameData\Squad\Parts\Command\mk1pod_v2\

As it still has some good info in it.

Good Luck.

 

 

 

 

Link to comment
Share on other sites

Hey ColdJ.

Tanks for responding with more great info! Geez no need to apologize! Before this I was sitting around by myself banging my head on the desk by myself lol This is way more help then I expected and is very appreciated thank you!   KSP forums are the best apparently haha

 

15 hours ago, ColdJ said:

module = Part

 

I was actually comin' back here to advise that the 'module = part' seems to be automatically added when I export from Blender. even if I remove it manually from the script before exporting, the blender addon I'm using must add it to the config just like the node attach points. Also realized that I didn't say that I was using a Blender Addon to begin with. I assume everyone uses this addon to make parts.  The Blender addon is called "Mu model format (KSP).  This is the thing that lets me import the .mu files as a 3d object along with the dll textures.

I assume one could create a part without this addon, but sure would be hard to guess the names of game objects and hexarchy. lol

Not a bad way to start off though, getting to open the .mu files and looking at how it's put together helps sooo much compared to visualizing abstract code on a game object that gets all of it's components instantiated at run time.  There's actually stuff to look at.  Neat. Right?

15 hours ago, ColdJ said:

you need to remember that the config file will use the first .mu in alpha/numerical order that is in the folder with the config file.

Ahhhhh, okay. that makes sense.  encountered an issue during testing parts that hinted towards this.  Was one of those times when you change a number of things to see if it works. It worked so didn't look into it more. but this explains it. Awesome!  That's what I get for not doing one thing at a time haha.  But takes a while to load the game so.. you know ^.^ 

 

Currently my file structure looks like:

GameData/ REDACTED/Parts/Robotics/SquarePiston/SquarePison

You can see that I place a folder inside with the same name of the part.  Makes it funny lookin' on the directory point. And got a Category and Parts folder inside Parts (just like how Squad has it) This is where I have my Category.cfg  and tab icon. 

At least this way I have a tab on the main parts screen to dump all of my creations.  Going to get spammed soon and will have to start organizing better.  This format will help with that. Beauty.

 

15 hours ago, ColdJ said:

scaleFactor = 1

I was dreaming of the possibility of creating one standard size part and just duplicating the files and resizing them for added variations, but it's not as easy as you'd think. just because it doesn't seem to work with every style of part.  

for example BD Armory's targeting ball cam. The size will change correctly in the Build view but when you load the craft it reverts back to the stock size.  Had to actually make a new .mu and manually scale the objects down in blender. and that stuck.   But that's like a mod of a mod thing going on. Don't expect stock parts to all act like that.

For BD armory, looks like there's an rescale code that applies to all parts set to 2.5. contained in a settings file located in the parts folder.

so it has special conditions.

 

 

15 hours ago, ColdJ said:

Ohhh awsome just what I'm lookin' for. Perfect thanks bud. I'll experiment with this a little woot.

 

 

My thought proses right now is like: 

What kind of part did I always want but did not exist?

okay, what current part is near that function?

Then will find that part in the list and open the files to observe.

 

A lot of the time It's a combination of more than one.  Like, do I make a standard wing? No. I want to make a wing with built in front and rear flaps that make sound and also is a fuel tank with a drain valve. that's just how I roll. LOL But if I made just a simple wing with separate parts you attach the same every time. it would be easier. 

For example, my f35 style wing. it's always going to need front and rear flaps, not very fun to place those every time. so why not just build it as a single object?

Didn't turn out well because of  how the mirroring in symmetry mode flipped things.  like the deploy was reversed and pressing up makes you go down lol.  For some reason wings are hard for me.    Or one wing will be lifting up while the other pushes down. 

I'll have a spend a bunch more time on this wing thing before getting it working properly.

Need a wind tunnel over here haha

 

Thanks, guys, for all the help really appreciate it :)

 

 

mJfAWvu.png

j8VZ00g.png

9wvbQOq.png

PS: Made some forklift parts.  Forks, Shifting fork mount, lifters and this Skid.  The skid is basically a hollow collider with adjustable friction like a grip pad, also changes color. and has 9 attach points to secure luggage.  Will be makin' standard airline style carco containers to work with this as well.   

 

Figure I should learn to walk before going to the moon.

PART {
    name = Skid
    module = Part
    author = REDACTED
    rescaleFactor = 1
    TechRequired = 0
    entryCost = 0
    cost = 0
    category = 0
    subcategory = 0
    title = Skid
    manufacturer = REDACTED
    description = non-slip, three grip levels.
    attachRules = 1,1,1,1,0
    mass = 0.1
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.2
    angularDrag = 2
    crashTolerance = 99
    maxTemp = 2000
    bulkheadProfiles = 0
    tags = #autoLOC_6011097
    mapActionsToSymmetryParts = false
  
  MODEL {
        model = REDACTED/Parts/Payload/Skid/Skid
    }

    MODULE {
        name = ModulePhysicMaterial
        activePhysicMaterialName = MediumGrip
        PhysicMaterialName = MediumGrip
        PhysicMaterialName = HighGrip
        PhysicMaterialName = ExtremeGrip
        PHYSICMATERIALCOLORS {
            MATERIALCOLOR {
                name = MediumGrip
                color = 1,1,1
            }

            MATERIALCOLOR {
                name = HighGrip
                color = 0.63,0.63,0.63
            }

            MATERIALCOLOR {
                name = ExtremeGrip
                color = 0.38,0.38,0.38
            }

        }

    }

    NODE {
        name = bottom2
        transform = node_stack_bottom2
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = bottom3
        transform = node_stack_bottom3
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = bottom4
        transform = node_stack_bottom4
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = bottom5
        transform = node_stack_bottom5
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = bottom6
        transform = node_stack_bottom6
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = bottom7
        transform = node_stack_bottom7
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = bottom8
        transform = node_stack_bottom8
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = bottom9
        transform = node_stack_bottom9
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = top2
        transform = node_stack_top2
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = top3
        transform = node_stack_top3
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = top4
        transform = node_stack_top4
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = top5
        transform = node_stack_top5
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = top6
        transform = node_stack_top6
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = top7
        transform = node_stack_top7
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = top8
        transform = node_stack_top8
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = top9
        transform = node_stack_top9
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = top
        transform = node_stack_top
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

    NODE {
        name = bottom
        transform = node_stack_bottom
        size = 1
        method = FIXED_JOINT
        crossfeed = True
        rigid = False
    }

}

 

Edited by REDACT3D
Link to comment
Share on other sites

 

Note that when importing an .mu the 3d model will not be all joined togeather and Ngons have been created. so  I just Merge by distance to clean up stuff. and dissolve ngon edges.   it all gets automatically cut up again when exported 

 

 

QPT8idz.png

AQpPZC2.png

0JDOlid.png

 

Alright, so the wings.

The things that cause problems:

-Angled flap rotations. (how the surface of the flap mount is not at 90dagree angles)  Flaps ignore  local rotations and rotate along root X?

-Textures are not flipped when mirrored. (how textures do not auto correct flipping, so words will be reversed like reading in a mirror) 

-Wing generates hardly any lift. feels like a barn door. but has blue lift arrows when toggled on (rotations or semithin)

- Authority limiter and deploy are reversed lol 

Note that this is a .mu file loaded from backup. so the correct origin point and root location have not yet been applied .

 

Now, if I apply a Mirror Modifier in blender, it demonstrates how the textures are mirrored in KSP.  Up is still up and down is still down but everything else is flipped as one would expect. this needs to be corrected for.   The easy way out is to design textures that are identical. Would make it faster to make too. But less room for detail.

LUoVjK1.png

cIS71r9.pngtjkjW35.png

 

And note how the wing tapers out to the tip. It's basically a Dimond shape cross section.

1p75FDS.png

kPdy3zI.png

 

So it's imperative the fins be placed exactly lol 

 

Then the 3 colliders that get parented to the wing. low poly. 90dagree flat face for mounting.

 

 

 

L5KK0Wn.png

 

here you can see how the fins are children of the wing but buffered with an Empty called ___Rotation.  This offsets the rotations so that in theory all I need to do is apply a rotation on the X axis and the flap SHOULD rotate as expected.  because I'm rotating around individual origins and using the local rotation. 

QUixhth.png

And this works in blender.

Note that i've set all rotations to Quats

DyoC0mY.png

 

The wing mesh has it's origin at the center of geometry, then it's pairented to the root Wing empty at 000

u6D0ID5.png

 

 

 

 

Made a new texture so that it can be mirrored. 

But as you can see, the rotations and locations did not work out that well.

gotta fix.

0kluDEz.png

 

All I did, was set the origin of the wing from the center of geometry to the world origin 000.  to fix the offset with the fins.   The center of the wings is now where the attach point is.  But the overall rotation of the wings clearly needs fixin'

R5kN3eh.png 

 

Okay. Graphically the wings appear to be rotated correctly. I rotated the wing mesh object inside the root empty by -180 on the z and -90 on the x.  And it's important to note that i haven't even added flap functionality yet.

 

Checkout the crazy offset and drag going on here.

no lift and lots of drag leading to low speed and just rolling off the runway. if i can avoid the dam lights at the end!

X9rZHvY.jpg

dogdOzS.jpg

dl4iu20.jpg

 

Remember, no flaps yet. but how the heck do yeah fix the lift thing?

PART {
    name = WingK35
    module = Part
    author = REDACTED
    rescaleFactor = 1
    CoMOffset = -1.2, 0.4, 0
    CoLOffset = -1.2, 0.4, 0
    CoPOffset = -1.2, 0.4, 0
    TechRequired = 0
    entryCost = 0
    cost = 0
    category = 0
    subcategory = 0
    title = WingK35
    manufacturer = REDACTED
    description = A wing.
    attachRules = 0,1,0,1,1
    mass = 0.2
    thermalMassModifier = 8.0
    emissiveConstant = 0.95
    dragModelType = none
    maximum_drag = 0.02
    minimum_drag = 0.02
    angularDrag = 2
    crashTolerance = 15
    maxTemp = 2400
    explosionPotential = 0.1
    fuelCrossFeed = True
    bulkheadProfiles = srf
    tags = Wing
    MODEL {
        model = REDACTED/Parts/Aerodynamics/WingK35/WingK35
    }

    MODULE {
        name = ModuleLiftingSurface
        useInternalDragModel = True
        deflectionLiftCoeff = 2.0
        dragAtMaxAoA = 0.6
        dragAtMinAoA = 0.0
    }

}

Clearly it's offsets now as mentioned before.

What is the actual value of the offset? is it a Eular?  and XYZ Quat or a XYZ location with a multiplier on it?

can I just point to a game object to get this offset value or does it need to be manually assigned?

 

It appears like i've finally got the rotations correct. using the Shuttle delta wing as the template.

the x is -90 y is 0 and z is -180. Holy smokes that took like 25 runs of the game to get right >.<

moving onto fins.. lol

yIBXMAy.jpg

 

 

QFD99qM.jpg

 

PART {
    name = WingK35
    module = Part
    author = REDACTED
    rescaleFactor = 1
    node_attach = 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1
    CoMOffset = -1.6, -0.4, 0
    CoLOffset = -1.6, -0.4, 0
    CoPOffset = -1.6, -0.4, 0
    TechRequired = 0
    entryCost = 0
    cost = 0
    category = 0
    subcategory = 0
    title = WingK35
    manufacturer = REDACTED
    description = A wing.
    attachRules = 0,1,0,1,1
    mass = 0.5
    thermalMassModifier = 8.0
    heatConductivity = 0.06
    emissiveConstant = 0.95
    dragModelType = none
    maximum_drag = 0.02
    minimum_drag = 0.02
    angularDrag = 2
    crashTolerance = 15
    maxTemp = 2400
    explosionPotential = 0.1
    fuelCrossFeed = True
    bulkheadProfiles = srf
    tags = #autoLOC_500207
    MODEL {
        model = REDACTED/Parts/Aerodynamics/WingK35/WingK35
    }

    MODULE {
        name = ModuleLiftingSurface
        useInternalDragModel = True
        deflectionLiftCoeff = 5.0
        dragAtMaxAoA = 0.6
        dragAtMinAoA = 0.0
    }

    RESOURCE {
        name = LiquidFuel
        amount = 0
        maxAmount = 300
    }

}

 

Edited by REDACT3D
added images
Link to comment
Share on other sites

4 hours ago, REDACT3D said:

Alright, so the wings.

The things that cause problems:

-Angled flap rotations. (how the surface of the flap mount is not at 90dagree angles)  Flaps ignore  local rotations and rotate along root X?

-Textures are not flipped when mirrored. (how textures do not auto correct flipping, so words will be reversed like reading in a mirror) 

-Wing generates hardly any lift. feels like a barn door. but has blue lift arrows when toggled on (rotations or semithin)

- Authority limiter and deploy are reversed lol 

Hi there. Some OPT Legacy wings have a big issue that you're falling into reproducing here. With such a small fraction of the total area being control surface , it's better to make the control surface into separate parts, and give these  ModuleControlSurface{} (which allows for actuation and steering response). You'll end up with very poor and very weird response, especially when these wings are near the CoM. Control surfaces have reduced effectiveness when near the CoM. The stock shuttle fin and airliner fin use this module but also have a key--value pair that roughly says "half the wing area is the actuating bit" and you'll never have these near to the CoM.

Yes, elevon rotation seems to only respect root X axis. This forces you to design your elevon with no sweep at its point of rotation or you have to export your whole wing with rotation and then counter this rotation via model rotation in the config or giving the proper angle value to the surface attach. (See below.)

Note that there is "blue" as from  ModuleLiftSurface{} and "cyan" from any part that does not have this module. Cyan lines mean "body lift" which can swing around in any direction and can defeat whatever you may employ for yaw control.

 

Feel free to peek into the config of Winglet F of the newer OPT Legacy wing suite. This is the one with four elevons.

ixEDT9c.png

4 hours ago, REDACT3D said:

Now, if I apply a Mirror Modifier in blender, it demonstrates how the textures are mirrored in KSP.  Up is still up and down is still down but everything else is flipped as one would expect. this needs to be corrected for.   The easy way out is to design textures that are identical. Would make it faster to make too. But less room for detail.

About text in textures and mirroring, do one of these:

  • Don't put text. You never see text on parts that need to be mirrored like wings do, anyway.
    Spoiler

    If you do see wings with text then they're either not mirrored (see: SOCK. Its left main wing and right main wing are node-attached distinct parts) or they're built to have meshes that can be toggled automatically (by B9 Part Switch's mirrored subtype feature) or manually (remove from symmetry --> change variant on the opposite wing from where you attached).

  • Make a separate part for use as decals and become familiar with the shader KSP/Alpha/Translucent.

 

4 hours ago, REDACT3D said:

Remember, no flaps yet. but how the heck do yeah fix the lift thing?

Make sure that when you pick up a wing piece (in the VAB, not the SPH) its default orientation is along the XY plain (X+ is out the VAB door, Y+ is skyward, Z+ is ventral/ toward the flag curtain in the VAB). This one has a very slight rotation so that its lift vector is Z-. If you have to rotate your wing 90deg on any axis, it's very broken.

oHEsNqR.png

 

Your config is also missing the key that controls where you hold it from and where it surface attaches:

// not to be confused with node_stack_whatever which is for stack -nodes-
// values are from a stock wing board

           // pos         // vector         // unsure
node_attach = 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1

 

5 hours ago, REDACT3D said:

 

X9rZHvY.jpg

 

dl4iu20.jpg

The position of the drag lines are due to CoPOffset (P for pressure/drag). You don't need those three offset keys since you want the CoL, CoM and CoP to be where the origin is. It's also possible that somehow your wings' visible orientation and their functional orientation are mis-aligned. KSP might be seeing your wings as angled up and serving as open airbrakes. If you cheat your airplane into the sky and dropped it, I'd be amused but not surprised if you generated lift in the direction of thrust rather than skyward.

Link to comment
Share on other sites

Awsome tips thanks JadeOMarr. 

The last time I had worked on this wing, I started off by tryin' to make the base wing first and apply the fins as a separate part.  but since I had the root wing not workin' the fins would not apply correctly. Never really looked into how the lift system works and now I'm payin' for it haha

And I love that OPT mod btw. lots of cool parts.

 

2 hours ago, JadeOfMaar said:

decals

oh! forgot about decals, I use those all the time in HDRP Doh >.<

okay there's actually a system that switches out models for mirrored objects and I'm not just imagining things. beauty good to keep in mind for now.  Clearly it's easy enough to just use regular ol' mirrored uv textures. for basic wings anyhow. Don't need to get crazy just yet with custom switch-outs.  but good to know there's a thing for that. beauty.

 

This is what the current wing that works? looks like in the VAB.

can't be the root object as per attach instructions 

cwcUBLQ.jpg

 

Can see that I'm basically copy pasting the delta wing here

PART {
    name = WingK35
    module = Part
    author = REDACTED
    rescaleFactor = 1
    node_attach = 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1
    CoMOffset = -1.6, -0.4, 0
    CoLOffset = -1.6, -0.4, 0
    CoPOffset = -1.6, -0.4, 0
    TechRequired = 0
    entryCost = 0
    cost = 0
    category = 0
    subcategory = 0
    title = WingK35
    manufacturer = REDACTED
    description = A wing.
    attachRules = 0,1,0,1,1
    mass = 0.5
    thermalMassModifier = 8.0
    heatConductivity = 0.06
    emissiveConstant = 0.95
    dragModelType = none
    maximum_drag = 0.02
    minimum_drag = 0.02
    angularDrag = 2
    crashTolerance = 15
    maxTemp = 2400
    explosionPotential = 0.1
    fuelCrossFeed = True
    bulkheadProfiles = srf
    tags = #autoLOC_500207
    MODEL {
        model = REDACTED/Parts/Aerodynamics/WingK35/WingK35
    }

    MODULE {
        name = ModuleLiftingSurface
        useInternalDragModel = True
        deflectionLiftCoeff = 5.0
        dragAtMaxAoA = 0.6
        dragAtMinAoA = 0.0
    }

    RESOURCE {
        name = LiquidFuel
        amount = 0
        maxAmount = 300
    }

}

 

But when dropped it falls like you'd think it should like a leaf.

But yeah here's the ControlSurf rotating the flaps not using local rotations.. booooooo

dMy2C8P.jpg

 

 

Maximum wootage!

Splitting the fins out was the way to go.

works great now. awesome handling and speed whahooo

 

 

6Vv1Gpr.jpg

K0AwLoG.jpg

Edited by REDACT3D
Link to comment
Share on other sites

18 hours ago, REDACT3D said:

QFD99qM.jpg

As it should be for the main wing. But I don't see any yellow line or red line (or the stumps thereof) for the attached elevons. Obsolete pic?

 

18 hours ago, REDACT3D said:

L5KK0Wn.png

I hope these three meshes here are all present and all serving as colliders. Unity doesn't like concave/ditches/gutters/trenches in a given collider object. Having these separate is also very helpful for placing the elevons as then you don't have to place it on an imaginery filler mesh that would exist if the colliders were a single object, and then offset them inward to visibly fit properly, and you wouldn't have to deal with "the collider blocks you from accessing that child part later."

Link to comment
Share on other sites

Yeah, outdated sorry. I was uploading in real-time as I was doin' it. lol Here is the end result consolidated.

- The full wing is contained within the same folder, using a single texture.  It's comprised of the three parts, WingK35, FinK35 and SlatK35. 

- Simple defuse shader but works nicely for the low glare style paint.  Mirrored identically top and bottom so that no artifacts are seen.

- For now, the front Slat is basically a reversed fin.  add super duper looper control. can pitch 360 going 400m/s on a dime. lol

- onboard fuel capacity but also lighter weight than the standard delta. 

I will deposit the code as well.

 

This is what the hierarchy looks like in blender.  Each collection was exported as a separate .mu (but using the same UV map an texture.

9Wl8Ork.png

 

I do stuff on unity and know all too well about the colliders on there. This darn thing sucks.  Imagine if convex hulls just worked? lol

But yeah. good tips. 

Gx7qNOs.png

 

This is what the final fin collider looks like before it is exported, and Ngons are added.  Just a cube, 4 faces because I hear there's a hard limit on how many faces you can have? 

ax9xA5x.png

 

This is what it looks like fully loaded with every kind of thing

EYb4PVA.jpg

t9dxetI.jpg

 

Can take-off at 60 with all that stuff attached lol.. ^.^

 

Oh and here's a video of 9 AI pilots flying these things simultaneously. 

if the AI pilot can do it. i call that a win!

 

PART {
    name = FinK35
    module = Part
    author = REDACTED
    rescaleFactor = 1
    node_attach = 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1
    CoMOffset = 0, -0.215625, 0
    CoLOffset = 0, -0.215625, 0
    CoPOffset = 0, -0.215625, 0
    TechRequired = 0
    entryCost = 0
    cost = 0
    category = 0
    subcategory = 0
    title = FinK35
    manufacturer = REDACTED
    description = A fin.
    attachRules = 0,1,0,0,0
    mass = 0.01
    thermalMassModifier = 8.0
    emissiveConstant = 0.95
    dragModelType = none
    maximum_drag = 0.02
    minimum_drag = 0.02
    angularDrag = 2
    crashTolerance = 15
    maxTemp = 2400
    explosionPotential = 0.1
    bulkheadProfiles = srf
    tags = #autoLOC_500252
    MODEL {
        model = REDACTED/Parts/Aerodynamics/WingK35/FinK35
    }

    MODULE {
        name = ModuleControlSurface
        useInternalDragModel = True
        dragCoeff = 0.25
        deflectionLiftCoeff = 0.25
        ctrlSurfaceRange = 38
        ctrlSurfaceArea = 2.0 //1
        actuatorSpeed = 80//30
        transformName = FinMesh
    }

}
PART {
    name = SlatK35
    module = Part
    author = REDACTED
    rescaleFactor = 1
    node_attach = 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1
    CoMOffset = 0, -0.215625, 0
    CoLOffset = 0, -0.215625, 0
    CoPOffset = 0, -0.215625, 0
    TechRequired = 0
    entryCost = 0
    cost = 0
    category = 0
    subcategory = 0
    title = SlatK35
    manufacturer = REDACTED
    description = A Slat.
    attachRules = 0,1,0,0,0
    mass = 0.01
    thermalMassModifier = 8.0
    emissiveConstant = 0.95
    dragModelType = none
    maximum_drag = 0.02
    minimum_drag = 0.02
    angularDrag = 2
    crashTolerance = 15
    maxTemp = 2400
    explosionPotential = 0.1
    bulkheadProfiles = srf
    tags = #autoLOC_500252
    MODEL {
        model = REDACTED/Parts/Aerodynamics/WingK35/SlatK35
    }

    MODULE {
        name = ModuleControlSurface
        useInternalDragModel = True
        dragCoeff = 0.25
        deflectionLiftCoeff = 0.25
        ctrlSurfaceRange = 20
        ctrlSurfaceArea = 1.0
        actuatorSpeed = 30
        transformName = SlatMesh
    }

}
PART {
    name = WingK35
    module = Part
    author = REDACTED
    rescaleFactor = 1
    node_attach = 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1
    CoMOffset = -1.6, -0.4, 0
    CoLOffset = -1.6, -0.4, 0
    CoPOffset = -1.6, -0.4, 0
    TechRequired = 0
    entryCost = 0
    cost = 0
    category = 0
    subcategory = 0
    title = WingK35
    manufacturer = REDACTED
    description = A wing.
    attachRules = 0,1,0,1,1
    mass = 0.05 //.5
    thermalMassModifier = 8.0
    heatConductivity = 0.06
    emissiveConstant = 0.95
    dragModelType = none
    maximum_drag = 0.02
    minimum_drag = 0.02
    angularDrag = 2
    crashTolerance = 15
    maxTemp = 2400
    explosionPotential = 0.1
    fuelCrossFeed = True
    bulkheadProfiles = srf
    tags = #autoLOC_500207
    MODEL {
        model = REDACTED/Parts/Aerodynamics/WingK35/WingK35
    }

    MODULE {
        name = ModuleLiftingSurface
        useInternalDragModel = True
        deflectionLiftCoeff = 5.0
        dragAtMaxAoA = 0.6
        dragAtMinAoA = 0.0
    }

    RESOURCE {
        name = LiquidFuel
        amount = 0
        maxAmount = 300
    }

}

 

Edited by REDACT3D
Link to comment
Share on other sites

@REDACT3D Looks good. Just so you know, 2x2m = 1 unit of lift surface area. I say this since your wings will obviously have unique sizes and your F-35 wing surely has a noticeably different amount of surface area. There's an easy way to get a good value. That is by using taniwha's .mu plugin for Blender for its built-in tool for measuring wings for FAR. I believe the value of MAC is the same as deflectionLiftCoeff.

Example config:

@PART[opt_pylon_b]:BEFORE[FerramAerospaceResearch]
{
	@minimum_drag = 0
	@maximum_drag = 0
	@angularDrag = 0
	@dragCoeff = 0
	//Debug check: This part is a wing piece
	MODULE
	{
		name = FARWingAerodynamicModel
		MAC = 11.82
		MidChordSweep = 51.69
		b_2 = 1.48
		TaperRatio = 0.62
		nonSideAttach = 0
	}
}

If you need a tut for it, I can whip one up and post a thread.

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