Jump to content

[1.4.x-1.8.x] Airplane Plus - R26.4 (Fixed issues/Github is up to date) (Dec 21, 2019)


blackheart612

Recommended Posts

7 minutes ago, ColdJ said:

. The module index is for pointing the the animation module, if you don't do this your animation wont work.

The cargobay state is controlled by the state of the animation module, not the opposite. So the animation will work but the cargo bay won't. I've seen some malfunctional cargobays with the index pointing at the wrong PartModule and none of them had a working DragShielding.

Link to comment
Share on other sites

Don't have the time to experiment fully at the moment, but have decided I am ignorant at this point. Tried with and without animation and didn't seem to get a different result.

Here have a new Drag Cube for now for that part. It will gain an extra 30 plus metres per second.

    DRAG_CUBE
    {
        cube = A, 6.109,0.7438,1.345, 6.109,0.7438,1.345, 4.853,0.1682,0.6645, 4.853,0.7086,0.652, 6.109,0.7493,1.345, 6.109,0.7497,1.345, 0,0.007023,0, 2.5,2.997,2.5
        cube = B, 6.109,0.7438,1.345, 6.109,0.7438,1.345, 4.853,0.1682,0.6645, 4.853,0.7086,0.652, 6.109,0.7493,1.345, 6.109,0.7497,1.345, 0,0.007023,0, 2.5,2.997,2.5
    }

Link to comment
Share on other sites

@Manul you were right. I freely admit when I am wrong.

@Lisias After much swearing and pulling of hair. I have totally rebuilt the model. Placed a non visible cube in it and given it a 100 frame animation. There were many no nos in the original. Always remember if you build your own to make sure the scale of all the pieces have been set to 1 using the apply scale function, when exporting your final model.

I have then followed all the cues given in the stock Mk3 cargo bay. Though the size 2 parts aren't quite as big they really should be size 3 external nodes and size 2 internal nodes. The internal nodes need to be inset slightly from the external, in this case by 0.02. The allowed attachments and having the model set to interact with itself is also important. Though there are no visually obvious cues, the model is considered open when spawned and setting it to closed will make it act correctly. I have also done away with the FStexture switch and made it so it works with the stock part variant module, so you can switch between the flat floor and the sloped floor. And finally it works as wanted. I changed my Non Commercial Size 2 cockpit and Tail ramp to have size3 externals so I could test it out.

Here is the config for the rebuild. I will send you the model with the config via PM.
 

Spoiler

PART
{
    name = S2HullCJ
    module = Part
    author = blackheart612/neistridlar
    rescaleFactor = 1
    node_stack_top = 0.0, 0.9375, 0.0, 0.0, 1.0, 0.0, 3
    node_stack_top2 = 0.0, 0.9175, 0.0, 0.0, -1.0, 0.0, 2
    node_stack_bottom = 0.0, -0.9375, 0.0, 0.0, -1.0, 0.0, 3
    node_stack_bottom2 = 0.0, -0.9175, 0.0, 0.0, 1.0, 0.0, 2
    node_attach = 1.25, 0.0, 0.0, 0.0, 0.0, 1.0, 1
    TechRequired = supersonicFlight
    entryCost = 2500
    cost = 250
    category = Payload
    subcategory = 0
    title = Structural Hull S2 CJ
    manufacturer = Kerbal Standard
    description = A standard Size 2 Hull. Used for carrying cargo and carries no fuel; is there merely as a structural element. As such, it's lighter and more solid due to reinforcements.
    attachRules = 1,0,1,1,1
    mass = 0.1
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.3
    angularDrag = 1
    crashTolerance = 50
    breakingForce = 300
    breakingTorque = 300
    emissiveConstant = 0.87
    maxTemp = 2700 // = 3000
    fuelCrossFeed = True
    bulkheadProfiles = size2, size3, srf
    tags = aircraft airplane hollow jet size2 pipe plane tube

    

    DRAG_CUBE
    {
        cube = A, 6.109,0.7438,1.345, 6.109,0.7438,1.345, 4.853,0.1682,0.6645, 4.853,0.7086,0.652, 6.109,0.7493,1.345, 6.109,0.7497,1.345, 0,0.007023,0, 2.5,2.997,2.5
        cube = B, 6.109,0.7438,1.345, 6.109,0.7438,1.345, 4.853,0.1682,0.6645, 4.853,0.7086,0.652, 6.109,0.7493,1.345, 6.109,0.7497,1.345, 0,0.007023,0, 2.5,2.997,2.5
    }
    MODEL
    {
        model = AirplanePlus/Parts/Structure and Fuel/size2cargo/PartS2Rebuild
        //texture = size2cargotex1 , AirplanePlus/Parts/Structure and Fuel/size2cargo/size2cargotex1
    }

    MODULE
    {
        name = ModuleAnimateGeneric
        animationName = Box
        startEventGUIName = Close
        endEventGUIName = Open
        actionGUIName = Toggle Box
        allowDeployLimit = true
        revClampDirection = false
        revClampSpeed = true
        revClampPercent = true            
    }

    MODULE
    {
        name = ModuleCargoBay
        DeployModuleIndex = 0
        closedPosition = 1
        lookupRadius = 3.0
        partTypeName = Cargo bay
        
        nodeOuterForeID = top
        nodeOuterAftID = bottom
        nodeInnerForeID = top2
        nodeInnerAftID = bottom2
    }
    MODULE
    {
        name = ModulePartVariants
        baseVariant = Flat
        baseThemeName = Flat
        baseDisplayName = Flat
        useMultipleDragCubes = false
        VARIANT
        {
            name = Flat
            primaryColor = #999999
            secondaryColor = #b08b39
            displayName = Flat
            themeName = Flat
            GAMEOBJECTS
            {
                Flat = true
                Slope = false

            }
        }
        VARIANT
        {
            name = Slope
            displayName = Slope
            themeName = Slope
            primaryColor = #999999

            GAMEOBJECTS
            {
                Flat = false
                Slope = true
            }
        }

    }

}

 

Link to comment
Share on other sites

5 hours ago, ColdJ said:

you were right. I freely admit when I am wrong.

That doesn't make me happier though :( If this trick did work, it would be a lifesaver.

5 hours ago, ColdJ said:

@Lisias After much swearing and pulling of hair. I have totally rebuilt the model. Placed a non visible cube in it and given it a 100 frame animation. There were many no nos in the original. Always remember if you build your own to make sure the scale of all the pieces have been set to 1 using the apply scale function, when exporting your final model.

I have an idea how to make it easier but I've not tested it yet. My idea was to create a new mu model with an empty game object that has some animation and add this model to every part that needs a dummy animation. You can have multiple MODEL nodes in a single part like this:

	MODEL
	{
		model = AirplanePlus/Parts/Engine/Modern/raptorjet/model
	}
    MODEL
	{
		model = Squad/Parts/Engine/jetEngines/turbineInside
		scale = 0.95, 1.0, 0.95
	}

That would eliminate the need to mess with All Rights Reserved assets but it will force mod maintainers to put the dummy model into every mod package (not a big deal with few kilobytes file but it might be annoying).

 

UPD: I'm not old enough to have an Alzheimer but I totally forgot that I had already done this :confused:

https://drive.google.com/file/d/1OhT_a0BKNVhwsU4c5hkcC0xmCuPf4qsp/view?usp=sharing
here is the dummy model (it's 503 bytes, not even kilobytes) and here is an example how to use it (animation name is Dummy)

Spoiler

PART
{
    name = med2mUtility
    module = Part
    author = nli2work

    rescaleFactor = 1

    MODEL
    {
        model = RetroFuture/Structural/med2mUtilityLong/med2mUtilityLong
        texture = rectFuselage_DIF , RetroFuture/Textures/rectFuselage_DIF
        texture = rectFuselage_NRM , RetroFuture/Textures/rectFuselage_NRM
        texture = med2mFuselage_DIF , RetroFuture/Textures/med2mFuselage_DIF
        texture = med2mFuselage_NRM , RetroFuture/Textures/med2mFuselage_NRM
        scale = 0.6,0.6,0.6
    }
    
    MODEL
    {
       model = MSRP/Parts/Cargo/Dummy
    }

    node_stack_fwd = 0.0, 0.9, 0, 0, 1, 0.0, 2
    node_stack_aft = 0.0, -0.9, 0, 0.0, -1, 0.0, 2

    TechRequired = advAerodynamics
    entryCost = 6000
    cost = 1200
    category = Structural
    subcategory = 0
    title = Med. Rectangular Cargo Bay/Utility Section
    manufacturer = Ark Propulsions
    description = 2.1m wide Structural Utility section. Can be configured as enclosed cargo section; open sides section; or Fully open section with structural spine.

    // attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
    attachRules = 1,0,1,1,0

    mass = 0.45
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.3
    angularDrag = 1
    crashTolerance = 50
    maxTemp = 2700 // = 3000
    emissiveConstant = 0.873600
    fuelCrossFeed = True

    #autoLOC_500911 //#autoLOC_500911 = contain convey equipment freight hold hollow payload (stor transport utility
    bulkheadProfiles = mk1rect
    MODULE
    {
        name=ModuleAnimateGeneric
        animationName=Dummy
        startEventGUIName=DummyOn
        endEventGUIName=DummyOff
        actionGUIName=Dummy
        eventAvailableEditor=false
        eventAvailableFlight=false
        eventAvailableEVA=false
    }
    MODULE
    {
        name=ModuleLiftingSurface
        deflectionLiftCoeff=1
        dragAtMaxAoA=0.1
        dragAtMinAoA=0.001
        useInternalDragModel=False
    }
    MODULE
    {
        name=ModuleCargoBay
        DeployModuleIndex=0
        closedPosition=0
        lookupRadius=2.9
        nodeOuterForeID=fwd
        nodeOuterAftID=aft
        //nodeInnerAftID=bottom2
        //nodeInnerForeID=top2
    }
    MODULE
    {
        name = FSmeshSwitch
        buttonName = Next Type
        previousButtonName = Prev Type
        objectDisplayNames = Standard; OpenSides; AllOpen
        objects = frameBottom, sideFrame1, sideFrame2, frameTop; frameBottom, frameTop; frameTop
        selectedObject = 0
        showInfo = false
    }
    
    
    
    DRAG_CUBE
    {
        cube = A, 3.475,0.8724,1.143, 3.475,0.8727,1.294, 2.853,0.9374,1.02, 2.853,0.9913,1.561, 3.985,0.8795,1.027, 3.985,0.8836,1.019, 8.404E-05,-4.363E-05,-0.0004319, 2.209,1.8,1.895
        cube = B,  3.466,0.8711,1.148, 3.466,0.8699,1.309, 3.896,0.925,1.3, 3.896,0.9444,1.292, 3.974,0.881,1.067, 3.974,0.8843,1.018, -1.431E-06,0.004321,4.399E-05, 2.219,1.808,1.894
         
    }
}

 

 

Edited by Manul
Link to comment
Share on other sites

@Manul

That is called part stacking. My very first mod, which was config only, used that to make marine engines out of reversed cone intakes, with a shrunk mini jet inside to provide the thrust transform. So much I had no idea about back then. 3D modeling wasn't even a thought back then.

It was @SnarkI believe, who first introduced the concept to the forum.

The one problem I envision is that because they are hollow parts, you will need 1 for each size of diameter to hide in the wall. Although.if you made it small enough and calculated where the wall is you could probably use the model config to move it into the wall of any part as long as you calculated right for each model.

Link to comment
Share on other sites

16 minutes ago, ColdJ said:

The one problem I envision is that because they are hollow parts, you will need 1 for each size of diameter to hide in the wall. Although.if you made it small enough and calculated where the wall is you could probably use the model config to move it into the wall of any part as long as you calculated right for each model.

It's just an empty GameObject with no meshes and no colliders, it's meant to solve the cargo bay problem, not to mess with DrabCubes. This is why I used a DragCube of a solid fueltank as a cube for the "closed" position of the cargobay.

33 minutes ago, ColdJ said:

My very first mod, which was config only, used that to make marine engines out of reversed cone intakes, with a shrunk mini jet inside to provide the thrust transform.

I know that you know, just explaining for those who don't know :D  (Further explanation is also meant for those who don't know  but might find it useful)


Drag shielding and drag occlusion are entirely different mechanics:
1) Drag shielding excludes parts from drag calculations entirely and it is controlled by ModuleCargoBay. When the cargobay is closed and sealed it casts rays that come from the lookupCenter and travel until they hit colliders of the cargo bay walls/doors, go beyond the OuterNodes or exceed lookupRadius. Every part that has it's center positioned within those boundaries is shielded entirely (even if it is actually 50% out of the cargo bay, only the center matters)
2)Drag occlusion is controlled by DragCubes and every part that has a DragCube can partially shield other parts from drag.  Parts should be attached by attachment nodes and only the side that has attachment nodes can be occluded. The nosecone can have only it's rear surface occluded. Fuel tank can have both it's front and rear ends occluded and the structural hub can be occluded from all 6 sides having no drag at all.

 

Link to comment
Share on other sites

15 minutes ago, Manul said:

It's just an empty GameObject with no meshes and no colliders, it's meant to solve the cargo bay problem, not to mess with DrabCubes. This is why I used a DragCube of a solid fueltank as a cube for the "closed" position of the cargobay.

Well if you can do it successfully. My experience is the game doesn't like zero vertices and no material setup. You could make a tiny 4 sided pyramid that uses the Depth Mask shader, and you won't see it as far as I am aware. As to drag cubes, if you place your own in the config then it will force the game to use what you want, though at that size, I doubt it would register enough to be noticed.

P.S, the reason I said use the Depth Mask shader is because it requires no texture pic.

Link to comment
Share on other sites

28 minutes ago, ColdJ said:

My experience is the game doesn't like zero vertices and no material setup.

No mesh no pain :cool:  This happens if you create a 3d mesh, if you just use Add=>Empty=>PlainAxes as you do for intake/thrust/whatever transforms you are fine as long as there is a proper NLA track that can be fed to ModuleAnimateGeneric.

V9azzxB.jpeg

The Dummy animation is a single frame animation that changes the scale of D2 transform from 1 to 1

Edited by Manul
Link to comment
Share on other sites

40 minutes ago, ColdJ said:

As to drag cubes, if you place your own in the config then it will force the game to use what you want, though at that size, I doubt it would register enough to be noticed.

Replacing the DragCube of a hollow part with a DragCube of a fueltank having exactly the same outer dimensions is a common trick used by many modders. Actually I had to paste the same dragCube twice, both for cube A and cube B that represent the "Open" and "Closed" state.

Edited by Manul
Link to comment
Share on other sites

48 minutes ago, Manul said:

Replacing the DragCube of a hollow part with a DragCube of a fueltank having exactly the same outer dimensions is a common trick used by many modders. Actually I had to paste the same dragCube twice, both for cube A and cube B that represent the "Open" and "Closed" state.

I just successfully prototyped using the pyramid with depth mask. It is in the micrometre range of scale, doesnt show in game. I used it to convert the stock structural tube in to a cargo bay. If you set closed to 0 then you don't need to touch the animation in game. Apart from adding the nodes, and 2 required modules, I didn't neet to change anything else. The .mu file is 2 kb.

Shout out to @Lisias Thanks to Manul you have a way to turn any hollow into a cargo bay.

Manul, have you started a thread somewhere to share what you have been learning? Lots including myself would find it very useful.

P.S

As long as it is the right way around, a Mk1 cargo bay would do better with the Drag Cube from the Mk1 plane cockpit. Pointy nose means smoother flows. Doesn't matter if technically it would stick out if you could see it, only the shape matters.

Edited by ColdJ
Link to comment
Share on other sites

5 minutes ago, ColdJ said:

If you set closed to 0 then you don't need to touch the animation in game.

If it is set up like this, it won't even show up in the game:

Quote

MODULE
    {
        name=ModuleAnimateGeneric
        animationName=Dummy
        startEventGUIName=DummyOn
        endEventGUIName=DummyOff
        actionGUIName=Dummy
        eventAvailableEditor=false
        eventAvailableFlight=false
        eventAvailableEVA=false

    }

All credits for this fix go to @K.Yeon or @JadeOfMaar or whatever genius who fixed aerodynamics of every single hollow part in OPT spaceplanes.

Link to comment
Share on other sites

3 minutes ago, Manul said:

All credits for this fix go to @K.Yeon or @JadeOfMaar or whatever genius who fixed aerodynamics of every single hollow part in OPT spaceplanes.

Very nice. Like I said a thread with this type of info would be very good. If you don't want to start your own then just chuck it on mine

Link to comment
Share on other sites

4 hours ago, Manul said:

Replacing the DragCube of a hollow part with a DragCube of a fueltank having exactly the same outer dimensions is a common trick used by many modders. Actually I had to paste the same dragCube twice, both for cube A and cube B that represent the "Open" and "Closed" state.

Using the same drag curve for open and close states is... well... "cheating". Open cargo bays should have significantly more drag!

Link to comment
Share on other sites

5 hours ago, Lisias said:

Using the same drag curve for open and close states is... well... "cheating". Open cargo bays should have significantly more drag!

There is no "Open" state because there are no doors and the fake animation to open nonexistent doors is disabled :D So the second drag cube will never be used.

Edited by Manul
Link to comment
Share on other sites

15 hours ago, Manul said:

There is no "Open" state because there are no doors and the fake animation to open nonexistent doors is disabled :D So the second drag cube will never be used.

Duh. :blush:

Anyway, allow me to try to save (some) face here... :D

I think I found a quick&dirty way to salvage all the parts in need of ModuleCargoBay without the need of reworking the models (mu files), and it would be easily added by MM patches to any part in need.

It looks too good to be true, so I'm going to do some tests tonight soon(tm) before pushing the idea ahead. :)

Edited by Lisias
Got my cheeks bitten by DayJob this night... need some time to recover...
Link to comment
Share on other sites

Something I forgot to mention. It appears that the game requires the ends to be sealed off to work. I made the mistake of creating a plane with an open end so I could see the drag triangles easily and thought I had failed, but once I put a part over the end it worked. So if a Kerbal is going to access inside, something with a working cargo door attached to the tube will still be needed.

Link to comment
Share on other sites

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