Jump to content

Hacking your libraries: Fuel tank CFG editing


Recommended Posts

Oh god I have no idea where to post this. I guess the tutorials would be fitting.

So me and you are about to break the rules. Ever wanted to customize your game, but don't know how? Well, starting with the basics, we're going to go in and change the part functionality. To start off, we'll do some fuel tanks. They're easy to work with, and are all around a good starter piece. So, let's get to it.

If you're not already running for the hills, go ahead and find the part files for your T-100 fuel tank. Once interfaced with, you should see this:

PART{
name = fuelTankSmallFlat
module = Part
author = Squad
mesh = model.mu
rescaleFactor = 1.0
node_stack_top = 0.0, 0.3125, 0.0, 0.0, 1.0, 0.0, 1
node_stack_bottom = 0.0, -0.3125, 0.0, 0.0, -1.0, 0.0, 1
node_attach = 0.5, 0.0, 0.0, 1.0, 0.0, 0.0
TechRequired = basicRocketry
entryCost = 1200
cost = 150
category = FuelTank
subcategory = 0
title = FL-T100 Fuel Tank
manufacturer = Jebediah Kerman's Junkyard and Spacecraft Parts Co
description = The T100 is a miniature fuel tank made to be even more adorable than its bigger brother, the T200. Handle stoically and with care.
attachRules = 1,1,1,1,0
mass = 0.0625
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 6
maxTemp = 2000 // = 2900
breakingForce = 50
breakingTorque = 50
bulkheadProfiles = size1, srf
RESOURCE
{
name = LiquidFuel
amount = 45
maxAmount = 45
}
RESOURCE
{
name = Oxidizer
amount = 55
maxAmount = 55
}
RESOURCE
{
name = PressurizedAir
amount = 70
maxAmount = 70

Right away, if you've never seen this before, it may look a little complicated, but trust me, it's not that bad. ...No, I mean, I may be experienced, but I'm

telling you, you'll get it! Why the face?

No, that's okay, hide your enthusiasm. You're doing a great job. I see that smirk... Or is it just me? Whatever. Anyway, on with the demonstration.

To make this as easy as possible, I'll run down the entire file and explain every function that you can safely change 1 by 1. As that implies, there are some

parts that I wouldn't recommend editing, unless you're changing the physical characteristics of the part.

name = [insertNameHere] 
The name of your part in this field is very important. Format it like this: fuelTankName. Each word is capitalized, except the first. All of the words are grouped together. The name of your part is what data in your Persistent.sfs and quicksave.sfs files reference whena part name matches. To put it less confusingly, if your tank's name was "oxyTank" or something like that, when you stick that part on a craft, the craft file uses that name as a reference. It searches through the part files to find anything with a name of "oxyTank". After it finds the match, it uses the other various data to position it on your craft.
The name of the tank you opened is fuelTankSmallFlat. If you were to change that, any crafts you have that are using that part will despawn from the game, because the part will be missing. Any more insights you need? Let me know above.

module = Part
Every part, except compound parts, will have this listed. Struts and fuel lines, for example, have this: module = CompundPart. Unless you're creating/editing those, always list module = Part.

mesh = model.mu
Ever part comes with a .mu file. It is to tell the game where the part's colliders are, as well as textures. This cannot be edited without specific part tools, and Unity, so I wouldn't bother with it.

rescaleFactor = 1.0
This line tells each part how scaled it is. For example, 1.5 would multiply the model's size by 1.5 extending from the center. This also includes colliders and textures. Basically Tweakscale without the mod.

node_stack_top = X.X, X.X, X.X, X.X, X.X, X.X, X
node_stack_bottom = X.X, X.X, X.X, X.X, X.X, X.X, X
Large green marks are on the top and bottom of your tanks. These are your attachment nodes. All these 0.0s, 1.0, or something crazy like that... to put it simply, here's what's going on:

node_stack_top/bottom = X axis, Y axis, Z, axis, angle X, angle Y, angle Z, nodeScale
Node stack top dictates where you're node attachment is on the top of your part. Bottom does the same for the bottom.
Right now, with every value at 0.0, the nodes are at the center of the model. To change that, here's a quick rundown:
To add to your X axis will push your tank's node to the left[?]. To subtract from it will push your node the opposite direction.
To add to your Z axis will push your tank's node forward. To subtract from it will push your node backward.
If you want your part to be inline, keep these at 0.0.

To add to your Y axis will lift your node upwards relative to the ground. To subtract from it will push it downward.
This is what you want to change. Whatever value you set your node_stack_top Y value to, put the negative equivalent of that number in the node_stack_bottom field. You can even look back at your tank to check that.

If you're not changing your X and Z axes, then leave your angle X and angle Z values at 0.0.
Leave your angle Y value intact, unless you're looking to make a radial part, in which case, why are you here?

Your node scale is the last digit, and dictates how large your attachment node will be. Your digits are 0, 1, and 2.

Any more insights you need? Let me know above.

TechRequired = [Tech tree catagory]
Editing this will let you change how early or how late a part can be unlocked in the tech tree. Either you can have everything right away, or nothing.

cost = [$] This will dictate how much money you spend per part you purchase. Perfect for economic crash scenarios!

catagory = [name of subsection]
This will allow you to change where the part is located in your library.

title = [part name]
Here, you can name any part whatever you want. It is really of no significance other than having something to call it.

description = []
The flavor text for each part. Be sure to make it witty and humorous, otherwise it will never be fun. DO IT!!!

attachRules = X,X,X,X,X
Each variable is represented by either 1, or 0. 1 = True. 0 = False. The variables, in order, represent:
Stack, surface attachment, allow stack, allow surface attachment, allow collision.
I highly recommend that your settings be 1,1,1,1,0. If you change that 0 to a 1, bad things will happen. Trust me. This is basically
useful for if you want to
allow part to attach to others based on the surface, rather than the nodes, or if you want a part to only link radially, or be linked to radially.

mass = X.X
This is your part's structural mass. The number is represented in tons. This amount will not be displayed in the game.

crashTolerance = X
How much force the part can endure before exploding.

maxTemp = X
How hot your part can get before exploding. Can be influenced in many ways.

RESOURCE
Underneath here is what you put in the tank. If it was a liquid fuel tank, then your resource's name would be "liquidFuel"
You can then input the amount it can hold, and the amount it has. This will affect the part's overall mass in the VAB/SPH. Each unit of fuel has a density
[mass per unit]. Keep that in mind while changing this.
You can add resources to any tank, or remove them all to use it as a fuselage.

So those are the basics for the contents of the fuel tank CFG. Did I miss anything? Let me know above. Later on, we might get to different parts, provided I remember to sleep.

Edited by Xannari Ferrows
Link to comment
Share on other sites

<knocks on door>

Hello, sir, I'm here today to talk to you about our Lord and Savior ModuleManager. Ialdaboth and Sarbian died for our direct editing sins so that we may enjoy the benefits of a single script file. Thank you.

Link to comment
Share on other sites

<knocks on door>

Hello, sir, I'm here today to talk to you about our Lord and Savior ModuleManager. Ialdaboth and Sarbian died for our direct editing sins so that we may enjoy the benefits of a single script file. Thank you.

"You must spread some reputation around before giving it to regex again." +1 for Sarbs witnesses. :P

Link to comment
Share on other sites

<knocks on door>

Hello, sir, I'm here today to talk to you about our Lord and Savior ModuleManager. Ialdaboth and Sarbian died for our direct editing sins so that we may enjoy the benefits of a single script file. Thank you.

Go forth and and integrate.

Link to comment
Share on other sites

Go forth and and integrate.

∫ex= f(un)

Now that that's out of the way...

OP, do you know if modding the attachment points of wings will cause anything screwy to happen? I hate that the structural swept wings attach at the rear corner, and I'd like to move it to the middle of the attachment edge. I assume this will completely screw up how Center of Lift is determined. There's about 20-30 parts I want to mod the attachment points for because they're completely unintuitive. They're also lousy for Editor Extensions' Vertical Snap.

How about rotating the attachment points of all the control surfaces? I think 1.x swapped a few axes, and I'd like to put them back in pre-1.0 position, and make them all consistent.

Does the size of the node determine occlusion, or joint strength? I'd set everything to 0 or 1, because the size 2's are hell in the editor.

Link to comment
Share on other sites

OP, do you know if modding the attachment points of wings will cause anything screwy to happen? I hate that the structural swept wings attach at the rear corner, and I'd like to move it to the middle of the attachment edge. I assume this will completely screw up how Center of Lift is determined. There's about 20-30 parts I want to mod the attachment points for because they're completely unintuitive. They're also lousy for Editor Extensions' Vertical Snap.

Unfortunately this is not a part issue. I don't know exactly why the Swept elevon starts going nuts, but I do know that it is an issue with the functionality of Angle snap rather than the part itself. I get the same thing with swept wings as well, but I don't know if that's a common thing. You'll have to look into far more advanced modding to fix this bug.

EDIT: ...Or you would turn them perpendicular to the structure, then it will work like a regular wing. Jeez

How about rotating the attachment points of all the control surfaces? I think 1.x swapped a few axes, and I'd like to put them back in pre-1.0 position, and make them all consistent.

Good question. If I remember correctly, change your Angle X to 0.0, and your Angle Y to 1.0 in the node_attach parameter.

Does the size of the node determine occlusion, or joint strength? I'd set everything to 0 or 1, because the size 2's are hell in the editor.

Now this I'm not sure about for radially attached parts. The test results turned up the same for each, so I'm assuming no. I'd personally just keep it at 1.

Edited by Xannari Ferrows
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...