Giter Club home page Giter Club logo

b9partswitch's People

Contributors

blowfishpro avatar fitiales avatar hebarusan avatar leonardfactory avatar liancastro avatar linuxgurugamer avatar lisias avatar politas avatar sooll3 avatar stonesmilegit avatar tinygrox avatar tony48 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

b9partswitch's Issues

Add configuration property for the number of steps in a tank's UI slider

In some situations it would be very handy to have a greater degree of precision when adjusting the amount of resources in a tank while working in the VAB/SPH. Right now the increments are (IIRC) 1/6th the tank's volume, which is particularly problematic when trying to adjust the mass of heavier tanks.

Two examples where this would be useful:

  1. Balancing the mass of asymmetrical vehicles, such as a Space Shuttle.
  2. Ballast parts, which could be used to keep large vehicles stable at a desired angle during reentry, or as a mass simulator to test the performance of launch vehicles.

The latter example is of particular interest to me, as I've been working on a set of mass simulator parts. The initial version is nearly ready to go, but without the ability to fine-tune the mass, they're not of much use. I'm already using this mod since it allows switching between different ballast materials, and also displays the exact mass of the parts via ModuleB9PartInfo.

I don't know any C#, otherwise I'd make a pull request. Looking at the official API documentation, it seems like this might be possible to implement using the stepIncrement property of UI_FloatRange, though I'm pretty far out of my element here.

Localize hard-coded strings

Hi, thank you for your KSP modding efforts. This is my favorite part switch mod and I would like to see localisation support in it.
KSP now supports many languages and, even if this plugin has not much text in it, it would be really nice to be able to translate it. So everyone can have a UI in their language without mixed words here
and there.
Thank you in advance (even if you are not interested in such a feature) and keep up the good work.

Investigate module switching

This is risky but potentially incredibly useful. As far as I can tell there are two patterns

  • Module exists and we just want to switch some data but not ever remove it
  • Module exists for some subtypes but not for others (and maybe we also want to switch some data).

Track subtype by name, not just index

Useful to be able to re-order subtypes without breaking craft. Determining the subtype would go like this:

  • If name is present, find subtype with that name
  • If name is blank or invalid, fall back to index
  • If index is invalid, set to zero.

Index would be something like -1 to begin with.

Should also add a uniqueness constraint on subtype names.

Refactor subtype switching to put more logic in subtype

When switching (i.e. from UI), old subtype should just be given a message to deactivate. It will deactivate transforms and nodes and remove resources.

New subtype will be given a similar method to activate.

First time subtype setup will be similar to current methods. Switcher module should probably still hold logic for removing managed but not active resources.

This should fix #22

Switching 'Ladder' transforms results in undesired collider behaviour in the VAB/SPH

While using a ladder transform/collider as a switcher target works very well in the flight scene, in the VAB the colliders used to specify the ladder become collidable and affect surface attachment.

Repro steps:

  1. Install SSPX Redux (https://github.com/ChrisAdderley/StationPartsExpansionRedux)
  2. Enter VAB
  3. Create a PXL-1 'Hostel' Habitation Module
  4. Select a surface attachable part and notice it attaching to ladder colliders located along the EVA rails. Notice it not being affected by the ladder collider near the main airlock.

Hang at the VAB and crash at startup

I've originally posted bugs on KSP bugtracker, but then realized that the only mod that causes this issue is B9PartSwitch (with many configurations of mods adding B9PartSwitch causes bugs, removing it makes KSP run perfectly).

There are logs, sampling, used mods and other info:
http://bugs.kerbalspaceprogram.com/issues/9721
http://bugs.kerbalspaceprogram.com/issues/9725

This reproduces on OSX (all info is in those invalid bugreports for vanilla KSP).

If you need more info, ask me.

Removing PartModule at runtime causes index mismatching

Removing modules (ModuleB9PartInfo for example) causes index mismatch errors if another module occupies the missing module's indexed location. (anything after the missing module is shifted upwards).

When it appears in the prefab but is missing in flight mode, KSP tries to compensate by relocating the loaded modules to another location but this can be disastrous if there was more than one module by that name (multiple generator modules for example. KSP sees that the loaded module occupies a spot that MB9PI occupied in the prefab so it looks for a slot with an identically named module and loads into the first eligible slot that it finds)

If there IS more than one module by that name then they end up getting the wrong data loaded in.

So as an alternative to removing modules outright, how about just disabling it? You can save someone maybe five days worth of troubleshooting.....

Missing value breaks parsing of .version file

The current download has:

  "KSP_VERSION" : {
    "MAJOR" : 1,
    "MINOR" : 5,
    "PATCH" : 
  }

PATCH is missing. This causes an error if you try to parse it:

Unexpected character encountered while parsing value: }. Path 'KSP_VERSION.PATCH', line 18, position 2.

Catastrophic failure when a B9_TANK_TYPE contains an invalid resource

Easy to reproduce. Create a B9_TANK_TYPE with a resource that does not exist and start KSP. The first exception is thrown at B9PartSwitch.B9TankSettings.ModuleManagerPostLoad() and there after every part containing a ModuleB9PartSwitch fails to load with System.InvalidOperationException: The tank definitions have not been loaded yet (done after game database load). Perhaps ModuleManager is missing or out of date?.

I'm hesitant to call this a bug, better to make the game unplayable and force the problem to be fixed, however when the parts fail to load any vessels inflight containing those parts are unloaded potentially ruining a save game. Perhaps it could fail a bit more gracefully. Users commonly overlook dependencies which may contain the needed resource definitions when installing mods.

ResourceUnitCost not correctly calculated

It needs to take into account the unitsPerVolume of each resource as well, so line 61 should be:

public float ResourceUnitCost => resources.Sum(r => (r.resourceDefinition.unitCost) * (r.unitsPerVolume) );

Clear log entry for B9PS fatal errors

It's well known to me by now that B9PS crashes when it determines that it's attempting to assign subtypes to any ModuleB9PartSwitch before the associated tank type exists (in which case, B9PS finds itself adding a null or otherwise invalid subtype). My humble request is for an indication of at least:

  • The subtype being parsed at that point
  • The part config being read at the moment

Currently, KSP.log is dumped on with a load of ๐ŸŸ bones lol

Switch in flight - tanks should not be filled

Just getting around to playing with this feature - very nicely done.

One gripe. In the editor normal and expected behavior when switching types should be filling tanks (unless the type is specifically setup not to be filled), but in flight I can't think of any scenario where filling tanks with a resource that was not already present is desirable. This is basically a cheat since tanks can be refilled by switching. I realize I could avoid this by defining the tank types to be empty by default, but that would leave the user with the annoyance of having to manually fill tanks in the editor.

Mod does not load AT ALL

So I noticed that the actual mod doesn't work AT ALL...
From what i saw in the logs, despite the fact it was in the GameData folder, it did not load at all, as if it didn't exist...

KSP.log.txt

Advanced tweakables option

It would be useful to have an option in the module to hide the switcher behind the Advanced Tweakables mode.
This would facilitate complex multi switcher setups and reduce PAW clutter.

Add animation support

Drag cube currently only rendered for initial state, so animating meshes won't work with stock aero

Stock style node jumping

In the stock 1.4 mesh switching, switches that change a node's location rebuild the rocket to reconnect the nodes (instead of leaving them at the original offset). This functionality has been duplicated by DMagic for the Universal Storage plugin, and would be useful for B9 Part Switch.

Texture switches are reset when procedural drag cubes are rendered

In the editor, rendering drag cubes for a part or any part above it in the hierarchy will cause its texture switches to get reset. It doesn't change the subtype, and switching to a different subtype and back corrects it.

Reason is that we reset texture switches before the part is cloned, and the part is cloned to produce drag cubes. When the part is cloned normally in the editor, KSP calls OnCopy which then tells the original to re-apply its texture switches, but this doesn't happen when rendering drag cubes.

Log warning with only one subtype

Should I be concerned about this?

[WRN 19:53:49.699] [WARNING] [Part bluedog.Apollo.AARDV.Cargo] [ModuleB9PartSwitch 'cargoSwitch'] Only one subtype found, this may lead to unexpected behavior

We use Ore as a placeholder to define the volume on cargo parts. What gets added to the SUBTYPE's depends on what life support mods are installed, if any are.

Resources sometimes change order

STR

  • Have two adjacent subtypes sharing their second resource, e.g. LiquidFuel + Oxidizer and Liquid Hydrogen + Oxidizer
  • Switch from one to the other

O

  • Second resource will appear first

D

  • Resource order is maintained

Explanation: The second resource already exists, so it is left alone, then the first resource is added to the end of the list, so it appears after

Add info module

Useful to see part's current info:

  • Current mass, wet and dry
    • Only display if a subtype has tank types or changes mass
    • Don't differentiate wet/dry if no tanks
  • Current cost, same as above
  • maxTemp, if managed by any module
  • skinMaxTemp, if managed by any module
  • crashTolerance, if managed by any module

ModuleJettison no longer works with drag cube re-rendering

Steps to Reproduce

  • Have a part with ModuleJettison affecting drag cubes and ModuleB9PartSwitch affecting drag cubes
  • Have a craft that has this part and a part attached to the ModuleJettison node (so that the jettison object will appear)
  • Load the craft in the flight scene

Observed

  • Jettison object is missing

Desired

  • Jettison object is present

Notes

  • In KSP 1.4+, ModuleJettison now moves the jettison object to the attached part when the scene loads rather than when it detaches. This means that it cannot affect drag cubes if they are re-rendered, but also since it's outside the part's hierarchy, it won't get duplicated for rendering drag cubes and AssumeDragCubePosition will disable/enable the real one, causing it to get disabled.
  • Will have to re-architect the procedural drag cube implementation to handle this

Preload type configurations

It doesn't take much time to begin with, but nice to have them all loaded first, rather than when the first object of that type needs to load

Support for changing stack symmetry

It would be useful to change the stackSymmetry parameter when using different Subtypes, a PART-level variable which defines the symmetry number that is used when stack attaching to a part.

This would allow better functionality for symmetric engine clusters with variable node counts, which currently must be set to the lowest common denominator of all available variants for symmetry to work even partially.

"Serious Warning" on startup - "Subtype has no name: PartSubtype"

When launching the game, I get this warning:

b9 serious warning

The game does seem to function fine after loading, however.

Relevant portion of the log file:

PartLoader: Compiling Part 'NearFutureConstruction/Parts/Truss/truss-spinal/truss-spinal-01/truss-spinal-01'

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.

(Filename: Line: 481)

Warning on PartSubtype: Subtype has no name

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Warning on PartSubtype: Subtype has no name

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Warning on PartSubtype: Subtype has no name

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.

(Filename: Line: 481)

[ERROR] [Part truss-spinal-01] [ModuleB9PartSwitch 'meshSwitch3'] Duplicate subtype names detected: System.String[]

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Warning on PartSubtype: Subtype has no name

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Warning on PartSubtype: Subtype has no name

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Warning on PartSubtype: Subtype has no name

I can provide the full log if you want it, should I also bring this up with NearFutureConstuction?

Having ModuleB9PartSwitch on root part messes things up

STR

  • Launch a new vessel with root part having ModuleB9PartSwitch
  • Exit to space center
  • Return to new vessel

Physics now break and the ModuleB9PartSwitch has no subtypes.

Will have to investigate if root parts are loaded differently.

Current workaround: use something else as the root part.

Allow one module to add volume to another

Keeps number of subtypes down on many switchers, aids ease-of-use

Current thinking: each child module registers itself to the "parent" to which it adds volume. Subtype changes on the child trigger a volume update on the parent.

Things to consider

  • The parent shouldn't really create any resources until all the children are initialized. Likely move resource creation/whatever to Start() so that OnStart() will be run on all modules first
  • Each subtype should have a new volumeAddedToParent field that specifies the volume it adds to the parent (different from its actual volume)
  • Volume update trigger: either keep track of parent and send method directly, or use part message

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.