Jump to content

Why doesn't PART{MODEL{}} in a .cfg file act like subclassing?


Recommended Posts

I've been trying to do some fairly simple 'modding'. Okay, EXTREMELY simple modding. I wanted to join a bunch of trusses together to reduce part count. (Yes, I'm aware of the 'UbioWeldingLtd' mod, and it sounds excellent, but for some reason it is broken for me in 24.2 with MechJeb, InfernalRobotics, and TweakScale.) Turns out even a stack of four trusses was too complicated for starters. So I tried what I thought would be The Very Simplest Thing : Make a 'new' truss that is basically a re-badged clone of a stock truss. That's right, an 'assembly' of one part, changing none of its parameters. I had imagined that what would go in my config file would be something like this:

PART {
name = trussClone
module = Part
author = NovaSilisko, Jamin
MODEL {
model = Squad/Parts/Structural/trussPiece1x/model
}
title = Clone of the 1x1 Truss
manufacturer = Jamin Corporation
description = Nothing at all like a plain 1x1 truss, except for everything.

[INDENT]}[/INDENT]


In my fantasy-land, everything else would be inherited in some smart fashion when it was noticed that PART{} contained one or more MODEL{}. So maybe the default cost and mass could be the sum of all the costs of the MODELs within, the strength and temperature of the assembly could be that of the least strong and most melty components within, and maybe there's some wise way to combine attachRules of all the pieces into default attachRules for the new part.

I was very astonished to learn that the minimum needed to accomplish my goal of make a clone of the 1x1 truss was more like this (and it still might not be quite right):

PART {
name = trussClone
module = Part
author = NovaSilisko, Jamin


MODEL {
model = Squad/Parts/Structural/trussPiece1x/model
}
rescaleFactor=1.0 // default is something like 2, why???


node_stack_bottom = 0.0, -0.5592728, 0.0, 0.0, 1.0, 0.0, 1
node_stack_top = 0.0, 0.5592728, 0.0, 0.0, 1.0, 0.0, 1
node_attach = 0.0, -0.5592728, 0.0, 0.0, -1.0, 0.0


cost = 25
category = Structural
subcategory = 0
title = Clone of the 1x1 Truss
manufacturer = Jamin Corporation
description = Nothing at all like a plain 1x1 truss, except for everything.
attachRules = 1,1,1,1,0


mass = 0.1
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 1
crashTolerance = 80
breakingForce = 200
breakingTorque = 200
maxTemp = 5000
}

I think the greatest offender might have to be 'rescaleFactor'; lacking inheritance, I would have expected the default to be 1.

Link to comment
Share on other sites

default rescaleFactor in KSP is 1.25.

MODEL{} only works for mesh and textures. it works that way because the part isn't compiled until after the model, textures, and config files have been loaded. trying to inherit part modules from the MODEL{} would just get you alot of NREs.

if you use rescaleFactor with MODEL{}, there's a bug that applies rescaleFactor twice. i.e. to get half size you need rescaleFactor set to 0.707; double you need rescaleFactor set to 1.414. best to force rescaleFactor to 1; and use the scale = x,y,z within MODEL{}

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