Jump to content

[1.4.*] [2.5.3] (2018-04-06) UbioZur Welding Ltd. Continued


girka2k

Recommended Posts

So, I've just started trying this mod out, and hit an issue. I've read thru the first 15 pgs, and the last few of this thread, and cant find anything similar to my issue. I'm kind of at a loss...

I AM running heavily modded, but I've double checked the OP for incompatabilities, and I (think) I understand what can/can not be welded.

Anyway, I've welded a station core together (mostly just pods, modules, & adapters to join them)...When I load the part, the right-click menu disappears (as in no longer shows up at all), until I leave the VAB, then comes back when I re-enter...

Does this sound familiar to anyone?...This is v2.2.0, and I'm running KSP 1.0.4 Linux 64bit...

EDIT: Oh, and struts dont seem to save with the weldments for me?

Guessing is not good, please enable the advanced debugging and weld the part again, and then post a link to the log file.

Link to comment
Share on other sites

Negative, and negative. Go and read my post again.

Or..here are the relevant bits:

"For many parts using one of each unique part will be okay - EXCEPT in cases where they used the same transform or animation name in both parts (which is quite a few stock parts)." I guess I should have added the info to that exception that stated in those cases (of multi same-named transform/animation) that it will NOT work right (only one will function).

ONE of each unique part -might- work (e.g. one spot-light and one wide-angle light). Quite often though you will run into problems due to the model or module setup for those parts having conflicts (e.g. if those lights have their light-emitting object named the same, only one will work).

Two of each will NOT work properly (only one will function). Four of something will most definitely NOT work (again, only one will function).

I'm on the trail to find out why that doesn't work.

Apparently the way KSP lays out its part files, it only allows one instance of a specific named PartModule per part. If the PartModule is declared multiple times, only the first declaration is used and all other declarations are ignored.

I first suspected this would not work because of identical transform and animation names, but even after editing the mesh file from the Gigantor XL to have a unique transform name for each sub-mesh in the part, I still could not get my welded part to work. This means the limitation is in KSP's way of loading PartModules in the database.

Here's the snippet generated by UbioWelding after I built two unique, but identical, Gigantors:

MODEL    {
model = Squad/Parts/Structural/trussGirderXL/model
position = 0, 0.001, 0
scale = 1, 1, 1
}
MODEL
{
model = Squad/Parts/Electrical/gigantorXlSolarArray/model
position = -0.325, -0.009, 0
scale = 1, 1, 1
}
MODEL
{
model = Squad/Parts/Electrical/gigantorXlSolarArray - Copy/model
position = 0.325, 0.008, 0
scale = 1, 1, 1
rotation = 0, 180, 0
}
MODULE
{
name = ModuleDeployableSolarPanel
animationName = bigsolarpane1
raycastTransformName = suncatche1
resourceName = ElectricCharge
chargeRate = 24.4
}
MODULE
{
name = ModuleDeployableSolarPanel
animationName = bigsolarpanel
raycastTransformName = suncatcher
resourceName = ElectricCharge
chargeRate = 24.4
}

Now there are two ModuleDeployableSolarPanel instances declared in the part file, but only the first one is executed by KSP, presumably because the names are identical. This is also the reason that welding docking ports won't work, the ModuleDockingNode gets messed up when it is combined into a part which has more than one mesh.

If there is a way to make multiple "instances" (identical, but differently-named copies) of an existing PartModule, you could make multi-part welds function. In that case, the step-by-step method to weld parts would simply be:

* Scan the part files for any declarations of a PartModule that occur more than once (or, multiple instances of an identical part).

* If this is the case, make temporary copies of the part's mesh files, replacing the original names with unique names which are tagged (e.g. 'solarpanel_weld1') so the modules can target their respective part animation.

* Repeat the same with the names of the PartModules. This may require some fiddling around with .NET typing to make it work.

* Set the properties of each PartModule to reference their respective sub-part.

Edited by Stoney3K
Link to comment
Share on other sites

I'm on the trail to find out why that doesn't work.

Apparently the way KSP lays out its part files, it only allows one instance of a specific named PartModule per part. If the PartModule is declared multiple times, only the first declaration is used and all other declarations are ignored.

I first suspected this would not work because of identical transform and animation names, but even after editing the mesh file from the Gigantor XL to have a unique transform name for each sub-mesh in the part, I still could not get my welded part to work. This means the limitation is in KSP's way of loading PartModules in the database.

Here's the snippet generated by UbioWelding after I built two unique, but identical, Gigantors:

MODEL    {
model = Squad/Parts/Structural/trussGirderXL/model
position = 0, 0.001, 0
scale = 1, 1, 1
}
MODEL
{
model = Squad/Parts/Electrical/gigantorXlSolarArray/model
position = -0.325, -0.009, 0
scale = 1, 1, 1
}
MODEL
{
model = Squad/Parts/Electrical/gigantorXlSolarArray - Copy/model
position = 0.325, 0.008, 0
scale = 1, 1, 1
rotation = 0, 180, 0
}
MODULE
{
name = ModuleDeployableSolarPanel
animationName = bigsolarpane1
raycastTransformName = suncatche1
resourceName = ElectricCharge
chargeRate = 24.4
}
MODULE
{
name = ModuleDeployableSolarPanel
animationName = bigsolarpanel
raycastTransformName = suncatcher
resourceName = ElectricCharge
chargeRate = 24.4
}

Now there are two ModuleDeployableSolarPanel instances declared in the part file, but only the first one is executed by KSP, presumably because the names are identical. This is also the reason that welding docking ports won't work, the ModuleDockingNode gets messed up when it is combined into a part which has more than one mesh.

If there is a way to make multiple "instances" (identical, but differently-named copies) of an existing PartModule, you could make multi-part welds function.

That is only partial correct, the animationName is the same at both parts, and that is confusing the game.

Link to comment
Share on other sites

That is only partial correct, the animationName is the same at both parts, and that is confusing the game.

I explicitly edited one of the mesh files (the model.mu) to make the animation name unique and edited the part.cfg for that part accordingly, so it worked as a unique "Gigantor XL Solar Array 2" with different transform and animation names (bigsolarpane1 instead of bigsolarpanel and suncatche1 instead of suncatcher).

This worked fine when the part was used individually like any other part and when welding, two ModuleDeployableSolarPanels showed up, each producing an equal amount of EC. When I try to weld two Gigantors (which have the same part and animation name), they are lumped together into one ModuleDeployableSolarPanel instance.

Next, I edited the craft file to allow different action names for each of the solar panels. Again, this worked fine when the panels were attached individually, with "Extend Panels 1" and "Extend Panels 2" as actions, but on the welded version, only "Extend Panels 1" showed up even though the other action and its associated module were defined in the craft file.

This leads me to believe that when multiple, identically-named PartModules are defined in the same ConfigNode, only the first is executed, because it is the first hit on Part.Modules[<your class name here>].

Link to comment
Share on other sites

I explicitly edited one of the mesh files (the model.mu) to make the animation name unique and edited the part.cfg for that part accordingly, so it worked as a unique "Gigantor XL Solar Array 2" with different transform and animation names (bigsolarpane1 instead of bigsolarpanel and suncatche1 instead of suncatcher).

This worked fine when the part was used individually like any other part and when welding, two ModuleDeployableSolarPanels showed up, each producing an equal amount of EC. When I try to weld two Gigantors (which have the same part and animation name), they are lumped together into one ModuleDeployableSolarPanel instance.

Next, I edited the craft file to allow different action names for each of the solar panels. Again, this worked fine when the panels were attached individually, with "Extend Panels 1" and "Extend Panels 2" as actions, but on the welded version, only "Extend Panels 1" showed up even though the other action and its associated module were defined in the craft file.

This leads me to believe that when multiple, identically-named PartModules are defined in the same ConfigNode, only the first is executed, because it is the first hit on Part.Modules[<your class name here>].

Editing the cfg alone is not enough you will need to rename the transforms there at runtime in the game, most likly even before the module is loaded and initialized. Editing the mesh file is nah I don't know if it is sooo nice.


MODULE
{
name = ModuleDeployableSolarPanel

animationName = rotary
raycastTransformName = sunCatcherRight
pivotName = Main_Rotary_Pivot
resourceName = ElectricCharge

chargeRate = 200

trackingSpeed = 0.1

powerCurve
{
key = 206000000000 0 0 0
key = 13599840256 1 0 0
key = 68773560320 0.5 0 0
key = 0 10 0 0
}
}

MODULE
{
name = ModuleDeployableSolarPanel

animationName = open_panel
raycastTransformName = sunCatcherLeft
pivotName = ArmLeft01_main
resourceName = ElectricCharge

chargeRate = 200
trackingSpeed = 0.1

powerCurve
{
key = 206000000000 0 0 0
key = 13599840256 1 0 0
key = 68773560320 0.5 0 0
key = 0 10 0 0
}
}

This is the equivalent from the balka solar panels of Kosmos, they do work with their native cfg.

Link to comment
Share on other sites

Editing the cfg alone is not enough you will need to rename the transforms there at runtime in the game, most likly even before the module is loaded and initialized. Editing the mesh file is nah I don't know if it is sooo nice.

(...)

This is the equivalent from the balka solar panels of Kosmos, they do work with their native cfg.

The animation is stored in the mesh file so renaming the animation (and all occurrences of it) in the mesh should change the animation reference. In your example, the ModuleDeployableSolarPanel still only offers one action for opening the panels (it's impossible to open or close either panel animation individually, only simultaneously) because they both use the same PartModule which responds to the same actions.

What you'd ideally want is to have a single part (which has a single, lumped physics simulation), which carries the functionality of a lot of individual parts that are attached to it. However, right now it's not possible to address an individual instance of a PartModule because they are not identified in-game by name.

I've already thought of making a PartModuleContainer class that stores all identical instances of a PartModule in a list, so a user can address them by tag, and adding actions from the parts contained in the list, taking the solar panels as an example, this would be "Extend Panels 1", "Extend Panels 2" and "Extend Panels All" as actions which are exposed by the PartModuleContainer class at run time, and forwarded to the respective module instance.

Such a class can also take care of multiple instances of a MODEL{} confignode, and rename the associated animations accordingly.

Link to comment
Share on other sites

The animation is stored in the mesh file so renaming the animation (and all occurrences of it) in the mesh should change the animation reference. In your example, the ModuleDeployableSolarPanel still only offers one action for opening the panels (it's impossible to open or close either panel animation individually, only simultaneously) because they both use the same PartModule which responds to the same actions.

What you'd ideally want is to have a single part (which has a single, lumped physics simulation), which carries the functionality of a lot of individual parts that are attached to it. However, right now it's not possible to address an individual instance of a PartModule because they are not identified in-game by name.

I've already thought of making a PartModuleContainer class that stores all identical instances of a PartModule in a list, so a user can address them by tag, and adding actions from the parts contained in the list, taking the solar panels as an example, this would be "Extend Panels 1", "Extend Panels 2" and "Extend Panels All" as actions which are exposed by the PartModuleContainer class at run time, and forwarded to the respective module instance.

Such a class can also take care of multiple instances of a MODEL{} confignode, and rename the associated animations accordingly.

Yeah editing the msh file should work but is it so safe? it sompiled stuff.

Well ideally it would be only one action for multiple meshes at once. so the container in basic sounds not bad, but a single action for each mesh, wow, that is not good.

Welding only combines the meshes and tries to reduce the number of modules.

Do you know the internal work of the module, because I still believe that the module is simple not able to handle multiple transforms for the same Animation. It just looks for the first it can find by name and that is it then.

So for welded parts the ultimate answer would be an module with same functionallity that replaced the animated module but handles the same mechanic but for all transforms with the same name.

Link to comment
Share on other sites

Yeah editing the msh file should work but is it so safe? it sompiled stuff.

Well ideally it would be only one action for multiple meshes at once. so the container in basic sounds not bad, but a single action for each mesh, wow, that is not good.

Welding only combines the meshes and tries to reduce the number of modules.

Do you know the internal work of the module, because I still believe that the module is simple not able to handle multiple transforms for the same Animation. It just looks for the first it can find by name and that is it then.

So for welded parts the ultimate answer would be an module with same functionallity that replaced the animated module but handles the same mechanic but for all transforms with the same name.

When you can change the name of animations on the fly (which is possible if you have control over the contained PartModules and Models), you can control each attached part individually and their animations would function correctly. If it is possible in code, it would be nice to not have to change the transform and animation name, and just go by them in the order they are declared, but that will only work if Part.Modules[<ClassName>] returns an array of all the modules with the same name, instead of the first, and the same goes for Part.Models.

There is a method called Part.FindModelAnimators[] (and correspondingly FindModelTransforms[])which returns all animations with a specific name. It is quite possible that, through a lazy implementation of specific PartModules, only the first is used because part programmers assume that there are no identical models used in a specific Part.cfg file. To fix it, you would need a separate PartModule which, as you said, catches a call to a specific transform and forwards it to all named transforms in the list.

An alternative approach is to get all the parts and find out which animations (and transforms) have identical names, and re-name them at load time.

One action for multiple meshes works for a few part groups such as resources (solar panels, fuel cells) or landing legs, but it's not always a good default behavior. It would be useful to replace the "default" action which was bound to the singular part, but in some situations, like docking ports, you will want separate actions for specific parts.

Link to comment
Share on other sites

When you can change the name of animations on the fly (which is possible if you have control over the contained PartModules and Models), you can control each attached part individually and their animations would function correctly. If it is possible in code, it would be nice to not have to change the transform and animation name, and just go by them in the order they are declared, but that will only work if Part.Modules[<ClassName>] returns an array of all the modules with the same name, instead of the first, and the same goes for Part.Models.

There is a method called Part.FindModelAnimators[] (and correspondingly FindModelTransforms[])which returns all animations with a specific name. It is quite possible that, through a lazy implementation of specific PartModules, only the first is used because part programmers assume that there are no identical models used in a specific Part.cfg file. To fix it, you would need a separate PartModule which, as you said, catches a call to a specific transform and forwards it to all named transforms in the list.

An alternative approach is to get all the parts and find out which animations (and transforms) have identical names, and re-name them at load time.

One action for multiple meshes works for a few part groups such as resources (solar panels, fuel cells) or landing legs, but it's not always a good default behavior. It would be useful to replace the "default" action which was bound to the singular part, but in some situations, like docking ports, you will want separate actions for specific parts.

Sounds soulid as an attempt, but I do not know if all the required parameters are available.

Link to comment
Share on other sites

Does this mod allow you to weld multiple drills/fuel cells? I have a mining ship with a lot of parts that I would like to weld, if possible.

Drills are animated, so nope, the fuel cells will be no problem.

Link to comment
Share on other sites

i am trying to weld a 300 part aircraft carrier, and i am getting a bug i only used to get for 1000+ part ships, which is where the possition line for all the parts in the config is just NaN, is there anyway to get this to weld correctly, it is all just tweekscaled wings and structual parts

Link to comment
Share on other sites

Greetings! Thanks for working on this great mod!

I've loaded this mod and after working with it for 20 minutes I'm getting mixed results.

When I weld tanks with nosecones things are beautiful. Part shows up after reloading the game - and it even has a thumbnail in the item list.

When I weld three Octagonal Struts, then reload, I don't have a thumbnail for the new part. Also it does not show up when I click the part and sometimes makes everything disappear and show just sky.

Trying to build a vanilla KSP and try again. Does KAS conflict? I know it is not on the list....

I'm trying to get a clean

Link to comment
Share on other sites

i want to start using this mod, but i have one question that bugs me:

if i weld some parts together, then use this new part to build a craft, launch the craft, then DELETE the welded part... what happens to the launched craft?

Link to comment
Share on other sites

second attempt with a part branch resulted in all the parts orientation being screwey

VAB or SPH?

Greetings! Thanks for working on this great mod!

I've loaded this mod and after working with it for 20 minutes I'm getting mixed results.

When I weld tanks with nosecones things are beautiful. Part shows up after reloading the game - and it even has a thumbnail in the item list.

When I weld three Octagonal Struts, then reload, I don't have a thumbnail for the new part. Also it does not show up when I click the part and sometimes makes everything disappear and show just sky.

Trying to build a vanilla KSP and try again. Does KAS conflict? I know it is not on the list....

I'm trying to get a clean

There is a bug with some structural parts that cause the position data to be NaN and so the complete weldment gets screwed.

i want to start using this mod, but i have one question that bugs me:

if i weld some parts together, then use this new part to build a craft, launch the craft, then DELETE the welded part... what happens to the launched craft?

The launched craft will get deleted from the game as it can not locate all the parts that are contained.

Edited by Alewx
Link to comment
Share on other sites

  • 3 weeks later...

Not sure if I'm seeing a bug or a usage issue. When I weld with the Structural Fuselage or the MK1 fuel tank they shrink.

update... i think it is doing it with all fuel tanks.

update... sorry i was silly. forgot one of the basic rules of troubleshooting: is the version up to date? changed to 2.2.1 and the problem went away.

Edited by steuben
Link to comment
Share on other sites

Not sure if I'm seeing a bug or a usage issue. When I weld with the Structural Fuselage or the MK1 fuel tank they shrink.

update... i think it is doing it with all fuel tanks.

update... sorry i was silly. forgot one of the basic rules of troubleshooting: is the version up to date? changed to 2.2.1 and the problem went away.

Great to hear you managed to solve the problem.

1.0.5 support soon? Or does it work in 1.0.5 just fine?

Should work so far, but will release an official 1.0.5 build soon.

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