Jump to content

Decouplers are for babies!


valdimer

Recommended Posts

HELLO MODDING COMMUNITY! First of all I would like to thank all the fellow modders, add-on developers, plug-in writers, just basically everyone, including the game devs for not only making this game, but making it so accessable to the modding community! That being said, Jebediah and I have been working on a decoupler and I have been having a frighteningly hard time trying to get the decoupler to stack in the builder. It stacks fine in the -Y axis but doesn't in the +Y. In fact, now that I've mentioned it, since it only stacks in the -Y it means that the decoupler is upside down when it is selected from the Structural tab. Here is the code in case anyone is wondering.

// --- general parameters ---
name = TestDecoupler
module = Part
author = valdimer

// --- asset parameters ---
mesh = model.mu
rescaleFactor = .04

// --- node definitions ---
// definition format is Position X, Position Y, Position Z, Up X, Up Y, Up Z
node_stack_bottom = 0.0, -1.0, 0.0, 0.0, 1.0, 0.0, 2
node_stack_top = 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 2

// --- FX definitions ---

fx_gasBurst_white = 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, decouple
sound_decoupler_fire = decouple


// --- editor parameters ---
cost = 200
category = Structural
subcategory = 0
title = TestDecoupler
manufacturer = Infinity Space INC
description = Basic branded decoupler.

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

// --- standard part parameters ---
mass = 0.4
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 9
breakingForce = 200
breakingTorque = 200
maxTemp = 3400
fuelCrossFeed = True
stageOffset = 1
childStageOffset = 1

MODULE
{
name = ModuleDecouple
ejectionForce = 250
explosiveNodeID = top
}

Link to comment
Share on other sites

Your bottom attachment point is pointing up into the decoupler (vector 0, 1, 0 is straight up), it needs to be pointing away from your model, please try changing it too

node_stack_bottom = 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 2

Apparently not for decouplers.

Edited by NoMrBond
Link to comment
Share on other sites

NoMrBond: I altered the vectors in the code, and no effect. I'm beginning to wonder i there is another configuration file I should be editing in order to make decouplers work correctly?

BostLabs: Your Jeb is one hardcore mofo, if I could get my Jeb to do that, I wouldn't even bother with my decouplers niether.

Link to comment
Share on other sites

KhaosCorp: Thank you for the speedy reply! So, anywho, I flipped it in max, re-exported to Unity, wrote it out with partools aaaand POOF! No change... I was just as surprised as you were, it doesn't make any sense. It should've at least pointed in the Y+ direction but for some reason it isn't....although Jeb did point out to me that in the code of the stock decouplers, they are labed 1 and 2, yet there is only 1 .mu file but there are 2 texture files while most of the other stock parts that I've flipped through, only have one.... am I missing something? Oh and yes, I double checked the direction of the model in Max just to make sure, and no change.

Link to comment
Share on other sites

Soo, I was searching through another mod called the Deep Space Mining pack, and they had decouplers in their mod as well. They seem to be having the same issue with their decouplers as I am having with mine. There is only one attachment node located on the bottom (-Y) axis. I wonder if this is something that hasn't found a workaround. You know, Jeb really picked a beast of a first part for me to try and create.

Link to comment
Share on other sites

I checked a bunch of examples and they all have both the vectors for the top and bottom nodes pointing up for both separators and decouplers (0, 1, 0), so I guess that'w wrong :\ sorry about that.

That makes me a sad panda....I wonder what could be wrong??? Everything seems to be in working order so why is this being such a bugger.

Link to comment
Share on other sites

KhaosCorp: Thank you for the speedy reply! So, anywho, I flipped it in max, re-exported to Unity, wrote it out with partools aaaand POOF! No change... I was just as surprised as you were, it doesn't make any sense. It should've at least pointed in the Y+ direction but for some reason it isn't....although Jeb did point out to me that in the code of the stock decouplers, they are labed 1 and 2, yet there is only 1 .mu file but there are 2 texture files while most of the other stock parts that I've flipped through, only have one.... am I missing something? Oh and yes, I double checked the direction of the model in Max just to make sure, and no change.

No no, thats not what i said =P Change its orientation in Unity, bugger all whats going on in your modeling software. Unity does odd things with rotation on import based on file type. Also make sure you set all mesh to 1:1 scale in your modeling program before export...good to zero out rotations too when possible (usually only animations bar you from doing this).

I have made a set of hollow stage decouplers and they have 2 nodes, and work rather nice: http://www./download/028dd8v6i2pu7zi/HollowStageDecouplers.zip

Link to comment
Share on other sites

to make your nodes show up, use this:

node_stack_top = 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 2

node_stack_bottom = 0.0, -1.0, 0.0, 0.0, -1.0, 0.0, 2

You have your module set up right because explosiveNodeID = top means it will release the top node, detaching itself and whatever is attached below it from your ship.

Having the model flipped upside down should not affect the function, just the asthetics.

Also:

rescaleFactor = .04

this is an extremely small rescale, how big is the model in your 3d modeling software? That is 4% of its natural size. I have a feeling that the scaling may be off, try setting the scale in Unity to .04 on all three axis if your part is naturally that huge.

Also try adding scale = 1.0 right under the rescaleFactor entry in your config. I have a feeling it may be defaulting to something else and even though your nodes are "2" units apart, they still overlaps due to the huge scale. Or you can try setting the node +/-Y positions to 10 and -10 or even 100 and -100 to see if they are showing up.

Link to comment
Share on other sites

Hello fellow modders! I will be redoing the decoupler from start to finish! As it turns out I completely forgot to reset Xform in max. So to answer your question tiberion I somehow managed to not pay attention to my scale size and ALTHOUGH I thought I was working with the right scale (which by the numbers, I was) as it turns out I did do a universal scale, which Max then saves as a transform in the mesh. So in doing so, I probably could have had both nodes of the decoupler showing up, but after being translated from Unity into Kerbal, the part stack nodes were on TOP of each other. Your right as well Tiberion as the rescale value was at an EXTREMELY small scale. As it turns out, no matter how you rescale your mesh, the code for the nodes MUST still match up to the original size of the mesh, and since I didn't know the original mesh size because of the universal scale FUBAR, I couldn't fix it although I'm assuming my code probably would've looked something like "node_stack_top = 0.0, 47.0, 0.0, 0.0, 1.0, 0.0, 2" (yes my mesh turned out THAT huge! Just goes to show, PAY ATTENTION TO YOUR MESH SIZE WHILE MODELING and DOUBLE CHECK before entering into unity. But I did run a test cylinder model through WITH the correct size parameters and it worked like a charm! Can't be too mad though, it was my first attempt ever, and it wasn't a complete fail, plus you guys were INSANELY helpful! JEB LOVES YOU

Link to comment
Share on other sites

Even going Blender>Unity>KSP i have had some issue with part where i forgot to reset scale of the mesh before export. Mainly with colliders clipping, but some other stuff.....

Its the small stuff what gets ya when moddin....never huge easy to spot problems...always lil gremlins

Link to comment
Share on other sites

KHAOSCORP: I'm really beginning to get the feeling with that, although I'd have to give Squad some credit. Unity has been the most unstable game engines i've ever worked with or played games on (minus Torque), but they're doing a rock solid job with their programming so far.

Also I feel the need to ask, I've noticed some mods need to be installed directly into the KSP/Gamedata folder while others can just go in the KSP/parts folder...why is that?

Link to comment
Share on other sites

Those are some smexy little decouplers you got there, although they do stack a bit wierd when attaching to the bottom node. It's as if the -Y node is set just a smidge to high. Maybe it's just me at 1am but i'll fart around with it and see if it's not just space dementia.

Link to comment
Share on other sites

The way mods worked in earlier versions (0.19 and prior, legacy method) they went into the ..\Kerbal Space Program\Parts or ...\Kerbal Space Program\Plugins etc, but from 0.20 onwards mods are meant to go into their own directories inside the GameData directory (i.e. ...\Kerbal Space Program\GameData\KOSMOS)

I'm sure there are specifics as to why, unfortunately I didn't really start getting into modding until after the changeover the \GameData\mod and the PART{} changes were all in

Link to comment
Share on other sites

Those are some smexy little decouplers you got there, although they do stack a bit wierd when attaching to the bottom node. It's as if the -Y node is set just a smidge to high. Maybe it's just me at 1am but i'll fart around with it and see if it's not just space dementia.

If your talking about the hollow ones i linked you are correct. The bottom node is set up into the decoupler, allowing for the thinest stock probecore to be attached between the decoupler and the tank just below it..usefull for deorbiting stages. Also they have colliders kinda like a faring does, so they are truly hollow, allowing better internal stage struting/fuel sharing, they need work, but due to hard drive mishap i dont have the parts or models or nothing.

Link to comment
Share on other sites

If your talking about the hollow ones i linked you are correct. The bottom node is set up into the decoupler, allowing for the thinest stock probecore to be attached between the decoupler and the tank just below it..usefull for deorbiting stages. Also they have colliders kinda like a faring does, so they are truly hollow, allowing better internal stage struting/fuel sharing, they need work, but due to hard drive mishap i dont have the parts or models or nothing.

If you have the .mu files, Taniwha made a .mu loader for blender, through which you may be able to recover a significant portion of the work

[Edit] here

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