#Patch Manager
1 messages · Page 7 of 1
like, for something like RO configs for parts?
wouldn't it be easier in both these use cases if there was just one definition and then extra patches for the extra cases, though?
Yes, but its still a possibility of something you can do
the best I can think of is if the asset addressing thing was added, you could then very easily create multiple completely different parts using the same model
which for example RO does a lot
Thats gonna be a weird thing to do, for that we would need a way to copy assets to another location (or at least rename them)
Like we can have a base asset, and then copy and rename for every asset made off that model
why would we need to?
you mean in case someone decides to edit the assets at runtime for some reason?
Cuz of how the game searches for the assets
Though I had another idea of injecting the load point of parts to load a superset of PartData that has a "PrefabAddress" and an "IconAddress" field
yeah that's basically exactly what I meant
So we have a RelocatablePartData that extends part data or whatever (or we just look into the json file when loading part data)
Its gonna be a bit of a complex one though
For the patch itself
Harmony patch that is
And then when patching parts, we add this field if it doesnt exist already
So that people can easily select a different model for a part
yeah
this should also enable people to create duplicates of stock parts without distributing the assets
which would be nice
Yep
I can take a look at this thing tomorrow
I would do it right now but I have to at least look over the stuff for tomorrow's exam once lmao
For the purposes of that, just assume every parts_data jsonhas an extra 2 fields called PrefabAddress and IconAddress
@north mist how does this look
looks good!
What do you think of me inlining the tooltips in the comments?
yeah I like that a lot
This took no small amount of formatting work lol
I'm adding an API into KSP2UnityTools btw to output an object as a patch manager patch
But I'll complete that fully tomorrow
I'm wondering, would it be possible (maybe optionally with a toggle) to leave out the fields that have default values?
Maybe, but I don't see the point
You want to see every value in case you want to edit some
Plus it helps others know where to look/patch
yeah I guess
it was mainly because the PartData looks really crowded and the majority of the fields there is not being changed
at least not by current mods
I suppose but meh, it's not too important
though, I have another suggestion, then
how about sorting it alphabetically?
that way it'd be way easier to find what you're looking for
without having to ctrl+f everything
(the top level fields I mean, at least)
I suppose thats possible yeah
Not too hard as well
Except prefab/asset address will always be on top
yeah, that's fine
And the resources/modules always on the bottom
and that makes sense
though I also wonder if it should be more like, the few fields that are absolutely necessary being on top, and then the rest sorted
(I know I'm complicating this, sorry lol)
have fun
Alright so I basically wrote the code for what we were talking about, but of course, it's not going to be as simple as I thought (and honestly it was stupid of me to completely forget this stuff)
The icon part is simple, but the mesh isn't
Because there is no guarantee how many meshes and in what hierarchy there will be in any prefab
Unless we're talking just completely replacing the entire game object
Then it might be doable with just removing its CorePartData and all PartComponentModules and replacing them with the proper ones
I'll continue working on it tomorrow, gotta go sleep now
I said prefabaddress for a reason, its just completely changing out the prefab gameobject
I mean that doesn't really imply changing out the whole object, since the prefab address is the only way to access the new meshes and textures, but yeah, gotcha
@north mist instead of sorting the fields, I instead injected the headers into the file
oh that's awesome!
is the partName field filled in automatically from the @new("...")?
Yes
even better, less room for mistakes
mhm
I just finished lunch so I'll get back to the game object stuff
seems like changing the module manager to internal caused some exceptions
[Error :Patch Manager] System.MissingMethodException: Method not found: void PatchManager.Shared.Modules.ModuleManager.PreLoadAll()
at SpaceWarp.Patching.LoadingActions.PreInitializeModAction.DoAction (System.Action resolve, System.Action`1[T] reject) [0x00050] in <39f0697ba36b449aa19b27f13be09abd>:0
then there's also this one
MissingMethodException: Method not found: void PatchManager.Shared.Modules.IModule.BindConfiguration(SpaceWarp.API.Configuration.IConfigFile)
UnityEngine.GameObject:Internal_AddComponentWithType(GameObject, Type)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:DMD<BepInEx.Bootstrap.Chainloader::Start>()
UnityEngine.Application:.cctor()
UnityEngine.InputSystem.InputManager:InitializeData()
UnityEngine.InputSystem.InputManager:Initialize(IInputRuntime, InputSettings)
UnityEngine.InputSystem.InputSystem:InitializeInPlayer(IInputRuntime, InputSettings)
UnityEngine.InputSystem.InputSystem:.cctor()
uhh
now I just completely deleted the PM folders from my game folder, rebuilt, and I'm somehow getting completely different exceptions that freeze the game loading
what is happening

Just undo it then?
[Error :Patch Manager] System.TypeInitializationException: The type initializer for 'PatchManager.SassyPatching.Execution.Universe' threw an exception. ---> System.ArgumentException: An item with the same key has already been added. Key: list.map
at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x0015a] in <eef08f56e2e042f1b3027eca477293d9>:0
at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <eef08f56e2e042f1b3027eca477293d9>:0
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] keySelector, System.Func`2[T,TResult] elementSelector, System.Collections.Generic.IEqualityComparer`1[T] comparer) [0x0009e] in <de4a1a1490a74771a34fee0d1d586658>:0
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] keySelector, System.Func`2[T,TResult] elementSelector) [0x00000] in <de4a1a1490a74771a34fee0d1d586658>:0
at PatchManager.SassyPatching.Execution.ManagedPatchLibrary..ctor (System.Reflection.IReflect libraryClass) [0x00008] in E:\KSP Stuff\KSP 2 Modding\Mods\PatchManager\src\PatchManager.SassyPatching\Execution\ManagedPatchLibrary.cs:14
at PatchManager.SassyPatching.Execution.Universe..cctor () [0x000fa] in E:\KSP Stuff\KSP 2 Modding\Mods\PatchManager\src\PatchManager.SassyPatching\Execution\Universe.cs:56
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
at PatchManager.Core.Assets.PatchingManager.GenerateUniverse () [0x0004a] in E:\KSP Stuff\KSP 2 Modding\Mods\PatchManager\src\PatchManager.Core\Assets\PatchingManager.cs:41
at PatchManager.Core.CoreModule.PreLoad () [0x00007] in E:\KSP Stuff\KSP 2 Modding\Mods\PatchManager\src\PatchManager.Core\CoreModule.cs:74
at PatchManager.Shared.Modules.ModuleManager.PreLoadAll () [0x00018] in E:\KSP Stuff\KSP 2 Modding\Mods\PatchManager\src\PatchManager.Shared\Modules\ModuleManager.cs:67
at PatchManager.PatchManagerPlugin.OnPreInitialized () [0x00001] in E:\KSP Stuff\KSP 2 Modding\Mods\PatchManager\src\PatchManager\PatchManagerPlugin.cs:71
at SpaceWarp.Patching.LoadingActions.PreInitializeModAction.DoAction (System.Action resolve, System.Action`1[T] reject) [0x00050] in <39f0697ba36b449aa19b27f13be09abd>:0
[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
PatchManager.Core.Assets.PatchingManager.RebuildAllCache (System.Action resolve, System.Action`1[T] reject) (at E:/KSP Stuff/KSP 2 Modding/Mods/PatchManager/src/PatchManager.Core/Assets/PatchingManager.cs:322)
KSP.Game.Flow.GenericFlowAction.DoAction (System.Action resolve, System.Action`1[T] reject) (at <483cd9805b7642b5be13e081b9a5d1b4>:0)
KSP.Game.Flow.FlowAction.Do (System.Action`1[T] resolve, System.Action`2[T1,T2] reject) (at <483cd9805b7642b5be13e081b9a5d1b4>:0)
(wrapper dynamic-method) KSP.Game.Flow.SequentialFlow.DMD<KSP.Game.Flow.SequentialFlow::NextFlowAction>(KSP.Game.Flow.SequentialFlow)
KSP.Game.Flow.SequentialFlow.Update () (at <483cd9805b7642b5be13e081b9a5d1b4>:0)
don't think these are caused by that change
that first error implies its iterating over every type twice
Or that a DLL is being loaded twice
I'll just manually bisect the commits in dev, since main works fine
oh lol
The second error is because I have to create the Universe later than the loading actions...
That's going to be an annoying one to fix
let me fix these 2 and you can do your stuff
alright, thanks
Wait what
PreLoad is called in preinitialize
Which is before any loading actions
This is the line throwing a null reference exception
The Universe is created in PreLoad
Which doesn't finish
because of the other error
makes sense
By the way this is what I've added to the KSP2UnityTools UI
Y'know all we need to add to patch manager is a png loader and an fbx loader ... and uhh yeah, suddenly we have unityless parts mods
yeaaah but I'd rather avoid that
Yeah, and also like loading fbx at runtime seems to require a paid plugin
though I'm thinking it may be worth it trying to somehow benchmark how much of a difference in loading times it would be, and how much of a difference our TextAsset cache already is compared to pure addressables
tbh that probably shouldn't be the biggest issue, we could just support .obj which should be trivial to convert fbx to (for any interested modders)
if it came down to it
theres also .mu
But yeah we could support .obj
The problem then is loading all the materials and such
yeaah that would be the biggest pain point
All I can think of for that is having a json file to define all the materials for each mesh, with the texture file locations and whatever
I guess that could work
But ... text asset loading is leagues faster than image/model assets if I had to guess
but if we were to do this, I would still rather have it in a specialized "dev" plugin
that would make it clear it's not meant for production use, by something like adding a watermark
or, if it is possible, only allowing it to run with debug mode enabled
I think that would be good enough to prevent any misuse
it would give devs a way to do quick iteration without opening Unity
and then they'd just have to open Unity and rebuild addressables once per release
Ill be honest i almost never use debug mode when developing mods
Its too much a hassle
I just always have it enabled on all my game instances lmao
And having multiple installs takes too much space
ok icons are working, time to test the prefabs
tbh the way I did it was extremely easy
at first I was trying to force the custom subclasses of PartCore/PartData into the game systems but it's honestly not worth all the effort of copying all fields from the original objects to the new ones, etc., so I just used a regex to grab the new values directly from JSON and store them in internal dictionaries per partName
I mean that latter thing is basically what I was thinking
Or instead just reading the json file, storing it into a jObject, checking if it has the key or not
and if it doesn't then just default the value to the partName.prefab/partName.png
this is interesting lol
not sure I've seen it before
the loading screen disappears like 2 seconds before the loading bar
I've seen it before
ughhh of course it's full of messy async stuff that's hard to patch
(the prefab loading)
aaaaaaaaaaaaaaaaaaaaaaaaa
I feel like 90% of our issues with Patch Manager would be solved if they just had a AssetProvider.LoadSync(...) method lol
but that's not really on them, it's mostly the way the Addressables API is made
Yeahh
Also once you are done with this, I am going to create a custom adapter for Data_Engine such that you can PM index the engine modes a lot easier
As in you can index the engine modes at the top level just like a module data
Meaning the array here, just becomes a +Engine ... (or +(mode_id))
And I will reflect that in KSP2UnityTools as well
sounds good
It's mostly cuz it irked me how hard it would be to patch engine modes normally
Anyways, I am going to go for now, ping me once you get prefab overriding working and its commited so I can work on this
I mean you probably can, I'm working in a separate branch and I don't think there should be any conflicts
Alright, I still need to go for a bit tho
Alright I created the data_engine adapter
now I am going to test it with that crazy part I made using KSP2UnityTools and see how it goes
I need a nap because I slept for like 4 hours last night, but I'll try to take a look at the issue with the materials after that
That's an interesting one lol
I forgot to add negation for integers into the code
god damn, whats up with this aaaaa
I see now
ffs
I'm just going to skip over all null fields
I got it to generate correctly!
This next patch manager update is gonna be a banger
sweet!
Now I think my next step for documentation is documenting the entirety of parts_data and all the modules
I might generate a script to autodocument the modules
And then do manual editing of data_engine
wouldn't that be better on the regular wiki, with a link to it in the PM docs?
I want to document them in PM terms rather than C# terms
That means describing it in terms of classes and elements and PM types
I guess, but it sounds like something that could be very useful also for people who don't care about using PM at all and just want to make a part in Unity
since the information is exactly the same, just structured slightly differently
It isnt exactly the same
Because im more so documenting the structure of the json file and abstract pm object itself
Whatever its mostly gonna be auto documented anyways
Also before I release the next update, I want to add a tech tree ruleset
one thing I'm kinda worried about is the visual side
like, it doesn't look like there's much room to add any custom nodes
we'll probably have to implement some rescaling
I hope that they made those visuals procedural
Thats gonna be fun to change if so
And then we may want to add more tiers as well
So we might have to add a scrollbar to the top
Or like a [<] and [>] button set
I think that should be relatively easier, since there already is a scrollbar for it on the bottom
Alright then
I just hope that we dont have to add our own procedural ui code into patch manager aaaaaa
at that point it'd probably be better as a separate mod tbh
which registers its own ruleset for PM
Yeah
Something like Tech Tree Patcher
Still one of my first things to do after the update
And maybe ill make a probe start mod for it
hell yeah, that's always good to have
I honestly actually really want to give a try to some sort of a story-driven mod utilizing the missions framework
yeaah
yeah, definitely
custom missions will be very useful for planet packs
but that seems like something with still a long way to go
though I think we should focus on planets after getting all the science stuff done
since it really is like the biggest modding part of KSP after parts
Yeahh
Wtf is this
screw it, I'm going to create a spacewarp mod with a document button
that will work
ALright, guess I'll have to do this another way
@north mist here's an example of autogeneration
damn, that's cool
And a lot more manual work than you would think :p
Sorting through 106 files and touching them up when they need them is a bit of work
As some stuff wasn't properly grabbed or whatever
I added doc comments to all the public stuff that didn't have them so that PM now builds with 0 warnings
however, the new Data_Engine selectable is broken
with the same exception popping up multiple times for every single engine part
Have to update my autogen as it was calling all enums integers
@north mist what think you?
https://pm.kerbal.wiki/part-reference.html
Yes I know it needs completion, but I don't know what every field does
can I just ask what a class selector for a simple type field like partName do?
just store the content of partName in $current/$$?
yes
But basically the point of class selectors are to check if something has an element or field
It's more useful in generic json contexts I suppose
yeah gotcha
oh nice, that's cool
This is going to be fun to update come 0.2.0
nope
I mean @maiden wraith said he would have time for modding in the last two weeks of December so let's pray

all I'm asking for is an update for LOABE and for the plume game objects for Merlin and Raptor in SORRY
:science #tNode_1v_start {
UnlockedPartsIDs: +[
"KLSS_life_support_tank_1v_1x1",
"KLSS_life_support_tank_2v_1x1",
"KLSS_food_tank_2v_1x2",
"KLSS_water_tank_2v_1x2",
"KLSS_oxygen_tank_2v_1x2",
"KLSS_food_pack_0v_radial",
"KLSS_food_pack_0v_radial",
"KLSS_water_tank_0v_radial",
"KLSS_oxygen_tank_0v_radial",
"KLSS_food_pack_2v_radial",
"KLSS_water_tank_2v_radial",
"KLSS_oxygen_tank_2v_radial",
"KLSS_greenhouse_2v_long",
"KLSS_composter_2v_short"
];
}
Copying here, syntax for adding your part to the tech tree
yeah, makes sense
I just hope the way they did the coordinates scales well with resolution
Gods i love that we made this mod
It makes me doing simple patch mods so much easier
An entire programming language to edit the tech tree lol
it also breaks the loading of the SpaceWarp and the whole game
It worked for
me
aaaaaaaaaaaaaaaaaaa
Okay, I can at least fix that bug
I was going to ask why the version number of the DLL is 0.4.0.0
and immediately answered my own question
it's exactly because of the template issue I realized just a bit ago in SpaceWarp
and nevermind, that was an issue on my side
PM works fine
Alright, well, I fixed that error anyways
That wouldn't break anything anyways lol
@north mist can you add gh actions to this as well :3
Redid the science stuff as well to handle tech node deletion, will be working more on this tomorrow in tandem with wmcc
Alright, I'm going to add the mission stuff and release a 0.6.0 soon, such that I can get started on wheres my crew capsule (I want to move the space walk mission later and add a lunar impactor mission in its place)
The sheer amount of wrangling for missions I have to do
So I figured that I'm going to make the element type/name on mission stages _{id}
So that it's easier to index them and such
Makes sense
Aaaaaaaaaa this field is never used so I have to guess at it's usage from code
Ohh its to create more complex missions
that have different branches
but like they are only used in the tutorials\
I'll ignore them for now and add them later
mostly because thats going to be a complex thing to add
Also I'll likely release this at the same time as I release WMCC, because WMCC is going to be my test for it
aaaaaaaaaa
i'm about to just disable syntax validation on this
For the moment it doesn't matter
I'll fix it but for some reason sinons language server hates me
ohh its because of dumb shit again where I have to rename something in the grammar
@frail star can you accept my PR and update the language server extension
Pretty please
🫡
One thing, I didn't update the version in the package itself, I likely shouldve
i can do it, what do you want it to be
just bump up to the next 0.x.0 version
yes please
how long does it take the marketplace to realize there is an update
it shows 0.7 if i look it up
@frail star did you rerun the npm compile step????
because the highlighting is correct
but the error messages are wrong
:/
add grammar and compiler to it please
yeahh, the grammar might be worth it, esp after I sanitized the grammar to not cause errors
could you give me that patch quickly, to see if it worked?
also, what do you think about adding hover-over descriptions to the builtins
@create-config "wmcc-unlocks", "tNode_1v_start": [
"probe_0v_spherical_electricity", /* stayputnik tNode_0v_electronics */
"storage_0v_battery_electricity_radial",
"antenna_0v_16",
"antenna_0v_16s",
"engine_0v_methalox_spark", /* tNode_0v_rockets_01 */
"fueltank_0v_inline_methalox",
];
@define-stage "wmcc_patch": @global;
@stage "wmcc_patch"
:tech {
}
Also, that would be nice
let me get you a list of builtins and their descriptions
Builtins I'd want hover for
@use - Import a library, to import multiple libraries from a mod do mod:*
@function - Define a function to be used in your patches
@mixin - Define a mixin (A reusable selection block)
@set - Set the value of the object being modified
@merge - Merge a dictionary with the object being modified
@delete - Either delete the object being modified, or the variable this is being set to
@require - Perform a boolean expression on the loaded mods to conditionally enable a patch
@stage - Set the stage that a patch is running in
@define-stage - Define a stage to be used with the `@stage` builtin
@include - Include a mixin in your patch
@patch - Define a list of labels to be patched outside of those defined by rulesets
@new - Create a new instance of an object that a ruleset matches
@before - Make this stage run before another stage if that other stage exists
@after - Make this stage run after another stage if that other stage exists
@global - Define this stage to be a global stage (running after all mod stages)
@create-config - Create a config to be used within patches
@update-config - Update a previously created config
@frail star
understood
and tell me when you have this update out so I can use it lol
tonight probably, i have to go to my last day of class rn
gotcha
i have a good idea of how to do it
Damn patch manager has a lot of libraries
looks nice lol
Also, could you add hovers for these rulesets as well
:parts -> Patch the parts in the game (label: parts_data)
:resources -> Patch the games resource definitions (label: resources)
:missions -> Patch the missions in the game (label: missions)
:science -> Patch the tech tree (label: techNodeData)
:json -> Patch any json asset in the game
yeah
so i kinda have two options here
either you write an official langref file, and i parse it to get that data.
or i just embed a langref into the project
just saying, i mean a literal langref.html
I have no clue what that much means in the context of vscode here
it has nothing to do with vscode at all
i think it'd be best for all of us, if we had a official langref file
langrefs are usually written in pure html, so that they can be parsed super easily
aaaaa
here's an example: https://opensource.apple.com/source/lldb/lldb-179.1/llvm/docs/LangRef.html
LLVM Assembly Language Reference Manual.
I'll work on that at some point, I have other stuff I'm working on rn
and then the actual langref: https://opensource.apple.com/source/lldb/lldb-179.1/llvm/docs/LangRef.html.auto.html
you would parse this ^ to get descriptions and such
@upbeat hare pretty sure this was literally the whole fix
when you pull it, just delete the old build and dist folders to get rid of all the old stuff and restore
if you encounter the issues again, lmk
Aight
Anyways, I am currently cooking up a new tech tree
I'm going to reuse old nodes, but I'm likely going to rename them
or rather reorganize them I suppose
that makes me think it would be really nice if tech trees + missions were something that the user can choose at the start of the campaign and be able to have multiple campaigns with different ones
that'd be really hard
at least on the tech tree part
because there is no master tech tree definition
I mean, we could do what we did with the PrefabAddress and IconAddress fields
and add a field for the ID of the tech tree to the nodes
and then in code check for it
I guess yeah
well actually no
at least not that simple
since some would be modifications of the stock ones, and some would be new
we'd have to only allow to make duplicates instead of edits
that way the stock tree could remain intact and mods could reuse nodes from it by duplication or something
yeah this is more difficult than I first thought
we might just have to design a master tech tree definition that is an asset that defines all the nodes in a tech tree
It's just a big list of nodes
yeah, that'd be a better way to go about it
we might also want to actually define node relations there as well
and I suppose positions aaaa
this is a duplication of information, but we need these multiple definitons
@north mist I made a PR
Also the fix (I think)
:missions #KSP2Mission_Secondary_Kerbin_Experiment > missionStages > _0 > ConditionSet > PropertyCondition {
@if ($$Inputstring == "collector_1v_science_general") {
isInput: true;
} @else {
RequireCurrentValue: true;
}
}
To put into community fixes
tho this will add a dependency on patch manager
by the way, I've been seeing lots of requests for some very simple, single-file patches by people who don't care about making a full mod, they just want to tweak some stuff in their install
maybe we could "relax" the swinfo.json requirements
aaaaaaaaa, it uses those to determine a lot of stuff
I was kinda thinking we could mostly autogenerate it
and just add some top-level statements for things like version and ID
to the patch itself
that would be required if there's no swinfo
to enable single-file patches
that's certainly a possibility, but the patch file name given depends on the ID aaaaaaaaa
I'll look into it
is it possible to make jet engines produce more thrust
It is
one word. How?
Can you give me a minute please, I am currently quite busy and focused on fixing a bug
figured it out
one tiny thing
could we do a bit of log cleaning up?
and make stuff like this debug logs rather than info logs?
the logs are getting unbearably long with so many mods logging every small thing tbh
it's fine in debug
but info is a bit much
Are experiments ready to be patched with PM? I see there's ExperimentSelectable inside the Science folder.
Yes
And how is it done (I didn't dig into it yet)? Do you add experiments to parts?
You have to define an experiment definition
ok, I've seen that part
and add a Module_ScienceExperiment to parts
ah there's a module for science experiments, nice
I'll look into it then
I have to see how to trigger them also. I'd like for Orbital Survey (mod) to trigger an experiment at given mapping percentages (like 25%, 50%, 75% and 100%)
I wish they named their "Orbital Survey" experiment differently sigh
Just name yours orbital scan
yeah, was thinking exactly that
and I'd like to add survey missions also, but later, first the experiment
I should add a list.slice method
so I have the whole set of map,filter,reduce,sort,slice
@upbeat hare, I'm trying to replicate what you've shown, but my experiment and science module isn't attached to parts. Don't know what I'm doing wrong. Maybe something in the definition of the experiment.
Experiment:
@new("orbital_survey_visual_mapping")
:experiments {
DisplayName: "OrbitalSurvey/VisualMapping/DisplayName";
DisplayRequirements: "OrbitalSurvey/VisualMapping/DisplayRequirements";
ExperimentType: "Both";
//DataFlavorDescriptions: "Data flavor descriptions text";
//SampleFlavorDescriptions: "Sample flavor descriptions text";
DataReportDisplayName: "OrbitalSurvey/VisualMapping/DataReportDisplayName";
SampleReportDisplayName: "OrbitalSurvey/VisualMapping/SampleReportDisplayName";
DataValue: 6;
SampleValue: 14;
TransmissionSize: 150;
RequiresEVA: false;
}
Part patch:
:parts #antenna* +Module_ScienceExperiment +Data_ScienceExperiment {
ExperimentsStandings: [];
LastKnownValidSituation: {
CelestialBodyScalar: 0.0,
ScienceRegionScalar: 0.0,
SituationScalar: 0.0,
ResearchLocation: null,
};
Experiments: [
{
ExperimentDefinitionID: "orbital_survey_visual_mapping",
CrewRequired: 0,
TimeToComplete: 30.0,
ContextualExperiment: false,
ResourcesCost: [
{
Rate: 1.0,
ResourceName: "ElectricCharge",
AcceptanceThreshold: 30.0
}
],
DenyInterruption: false,
ExperimentUsesResources: true,
DeployedBoolAnimatorParamName: "",
CFXName: "fx_science",
SFXEvent: "invalid"
}
];
NotifyOnCompletion: false;
ResourceThresholdMultiplier: 0.25;
}
You need the pam override for one
Experiment definition gets created, I see it in the cache. Log says that PM is applying a patch to the part.
Also, you need to define the valid situations
(Like the one you do for the orbital survey component)
ok, valid situations are:
"ValidLocations": [
{
"BodyName": "",
"ScienceSituation": "HighOrbit",
"RequiresRegion": false,
"ScienceRegion": ""
},
{
"BodyName": "",
"ScienceSituation": "LowOrbit",
"RequiresRegion": true,
"ScienceRegion": ""
}
],
will do that
PAM override? You mean this:
PAMModuleVisualsOverride: +[
{
PartComponentModuleName: "PartComponentModule_OrbitalSurvey",
ModuleDisplayName: "PartModules/OrbitalSurvey/Name",
ShowHeader: true,
ShowFooter: true
}
];
Yeah but for the experiment
Also there is a bug i need to hunt down with chained +x selectors
Where it doesnt create the second one
So you should nest it
+Module_ScienceExperiment {
+Data_ScienceExperiment {
}
}
PAM override, do you mean where the experiment is defined? So here:
@new("orbital_survey_visual_mapping")
:experiments {
...
}
That sounds strange as I don't see this in any other experiment definition
No
I mean like
PAMModuleVisualsOverride: +[
{
PartComponentModuleName: "PartComponentModule_ScienceExperiment",
ModuleDisplayName: "OrbitalSurvey/VisualMapping/DisplayName",
ShowHeader: true,
ShowFooter: true
}
];
On the part
Ah so on the part, not in the definition of the experiment, ok
Both of those together should show the experiment
It would be nice add warnings if stuff is missing from the patch, like ValidLocations missing. VSCode extension didn't complain about that. Is that possible to do?
That ... is possible but quite complex
Turns out neither PAMModuleVisualsOverride nor ValidLocations are needed to get the experiments to patch successfully.
It was the nested +Module... +Data that prevented patching.
I need to track down that bug
I think its just a bug with how multiple selectors are handled
Honestly it might not be possible to fix with the current semantics of selectors
Because chaining like that is adding both to the parent part, not to eachother individually
No need to solve it imo. I just used it cause I saw you doing it that way. It's more intuitive to me to nest it.
I was writing stuff fast forgetting how semantics woek
Newbie question here... I'm trying to create my first patch file, but PatchManager seems to be scanning my mod directory but not finding the patch file. My mod diretory is in Kerbal Space Program 2\BepInEx\plugins\Dolphin. Inside that I have created a swinfo.json file like the wiki says, and a patches directory. In the patches directory I have a file named "pod_2v_cupola_crew.patch" which has the following content:
* > Module_ReactionWheel {
PitchTorque=*5;
YawTorque=*5;
RollTorque=*5;
}
}```
I have gone into settings->mods->Patch Manager and set "Always Invalidate Cache" to "Yes".
When I restart KSP2, I see the following in BepInEx\LogOutput.log:
...
[Info :Patch Manager] Loading patchers from C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program 2\BepInEx\plugins\Dolphin
[Info :Patch Manager] Loading patchers from C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program 2\BepInEx\plugins\flight_plan
...
[Info :Patch Manager] Registering all patches!
[Info :Patch Manager] 0 patchers registered!
[Info :Patch Manager] 0 generators registered!
You can see above that it didn't find my patcher even though it saw my plugin directory. Am I interpreting that correctly? My changes don't seem to take, and I'm not sure what I am doing wrong.
Also are there any example mods that already use patch manager which I could look at to get a feel for things? The docs actually seem pretty good on technical detail, but I haven't seen a working example and looking at one would probably help a lot.
@hexed yarrow Hmm, everything you mentioned sounds right. Maybe your swinfo isn't properly formatted (https://pm.kerbal.wiki/getting-started-with-patch-manager.html#setting-up-a-modding-environment-to-develop-patch-manager-patches) ? Is the mod present in Main Menu -> Mods and without errors?
Best way is to start is from a SpaceWarp template and go from there; everything should be set up correctly with the template.
You can see examples of working patches in Orbital Survey and Kerbal Life Support System mods.
We definitely need a banner aaaa
best I can offer rn is something very simple like this
(of course, colors can be changed)
or like this, with slighly different proportions and using one of the fonts I have in UitkForKsp2 that mimic the game fonts, that maybe fits a bit better since it's more angular
Hmm that looks decent
any color preference?
A bit of a darker purple
Thanks for your response! Yes, my mod seems to be loading:
and the other color?
Here's my swinfo file, it is taken from the template you linked to, just changing a couple things:
"spec": "2.0",
"mod_id": "DolphinMod",
"author": "Dolphin",
"name": "DolphinMod",
"description": "Does something",
"version": "1.0.0",
"ksp2_version": {
"min": "0.2.0",
"max": "*"
},
"dependencies": [
{
"id": "com.github.x606.spacewarp",
"version": {
"min": "1.5.0",
"max": "*"
}
},
{
"id": "PatchManager",
"version": {
"min": "0.4.0",
"max": "*"
}
}
]
}```
with the beige/peach one?
Not sure on that one, maybe shift its hue more pink
That swinfo is correct
Can I see the patch file you are trying?
I think that looks pretty decent
Here's my original post: #1115274490490929172 message
Put a > Data_ReactionWheel after the > Module_ReactionWheel
Thats the first error I see
ah, ok thanks!
And dont use =
Use :
Thatll cause a syntax error using equals, hence why PM isnt scanning your mod
ha, I told you I was a newbie!
As to why PM isnt outputting syntax errors ... the PM syntax errors would be in KSP2.log due to some stuff I had to do
so this should work
:parts #pod_2v_cupola_crew {
* > Module_ReactionWheel > Data_ReactionWheel {
PitchTorque: *5;
YawTorque: *5;
RollTorque: *5;
}
}
Yes
I really need to see if I can get them in the bepinex log again
though that syntax will likely change soon
from
PitchTorque: *5;
to
PitchTorque *: 5;
@upbeat hare it worked! Thanks so much to you all!!!
I think this looks fine as a logo, too
Dark mode logo for sure
No problem!
lemme get you an actual png
not this screenshot
ehh I uploaded it directly to SD
looks fine I think
Yep, that looks pretty good
you can use the square one as a logo in the docs
Gotcha
like this
https://www.jetbrains.com/help/writerside/styling-and-layout.html#accent-color and the "ruby" accent color might look nice with it
sure, it's definitely not something urgent
Gods we are doing work on christmas
I'm directly back to the mission editor lol
since I have covid, I'm not doing all the family visits this year anyway
Why I made that latest commit lol
@use "builtin:list";
@function not-in($values) {
@return @function($check) {
@each $v in $values {
@if ($v == $check) {
@return false;
}
}
@return true;
};
}
:science #node_id {
UnlockedPartIds: $value:filter(not-in([/* ... */]));
}
lol
Hey it shows how powerful PM can be though
it sure does
Also if someone wants another example of quite a few different types of patches
https://github.com/cheese3660/WheresMyCrewCapsule/tree/main/patches
Im going to be adding a - operation to lists as well
Its just going to remove all the values in the rhs from the lhs
Also I somewhat want to make a free floating identifier (like for a function call) automatically convert into a string
But im not sure
So like
... {
x: y;
}
/* same as */
... {
x: "y";
}
Thoughts?
idk, I think it might lead to some confusion and misuse
Thats fair
Its basically already done on the lefthandside of : exprs in dictionaries though
But yeah i get ya
My thoughts were its something I already try to do when writing patches, and that it would make enum values look cleaner
Like instead of
Category: "Science";
Category: Science;
But i can totally see the confusion
Note: this is something SCSS does
yeah, it's just a basic CSS thing
Im like 65/35 on it myself
Gotcha
I also need to add like #"..." and strings as element selectors as well at some point
Its been on my todo list
do we have escape sequences?
Yes
so something like #"\"hello there\"" should work
Yes
awesome
I should make function names be strings to remove any ambiguity, "hello, I am a function"(5)
It wouldnt even be hard to implement
Plus you already do get-function with the function name as a string
But yeah ill add this all (except for maybe functions as strings) for a PM 0.7.0 release
Maybe I'll do the breaking +: change then as well
Oh I need to write documentation
Awesome!
I ... dont see any argument against allowing this except for why?
how is allowing spaces in function names good practice in any way, shape or form 😭
For when you want your functions to include unicode characters
You might just need to put a BOM in front of your function name
sometimes you truly terrify me Cheese
Good
release action added, project files cleaned up, some code cleanup regarding things like unused imports and such, and all warnings fixed
hopefully the action works, but we'll only know after the next release
Yep
I can add the clean room disclaimer to PM now :3
You should add the release action into the template tbh
yeah I'm going to
Aaa, Im gonna have to make a pr to all existing mods to switch around the prefix expressions
Plus tell the 2 people ive already taught to make patches that its going to change
yeah... that was my other issue with it
though it's better sooner than later
if we really want to make the change
Im still 50/50 on it
Should I add custom mission categories to patch manager?
I am all for it
Alright, aaa, I am going to have to do preanalysis to the patches though
to just extend the enum with the new values?
If I want more than a static set of categories
hmm
everything is done with switching on the enum, including rendering UI and stuff like that
so we'll have to patch everything that touches the enum, one way or another
I feel like it'd be easier to just look up the values in a custom dictionary or something, at that point
I feel like it'd be easier to just change that property to a string
and prepatch a lot of stuff
- What are FTUE missions?
- What would custom missions be? Missions that mods could trigger? How would that be different from secondary missions?
First Time User Experience
they're the PAIGE stuff when you enable the first time user thing in the campaign creation
I think
I meant custom mission categories
so other than Primary, Secondary, Tutorial, and FTUE
for example you could add missions of the type "Scanning"
for Orbital Survey
and they'd get their own box in the mission control
And I'll likely gen the loc key like MissionTypes/Scanning
That's what I meant with my question. Why would we define another category in addition to Secondary? I'm not saying that I wouldn't do that, just curiour what you're aiming at
well, imagine building something like RP-1
and having all contracts in just 2 categories
or if a user installs 10 different mission packs at some point, imagine how cluttered the secondary missions would be
Ok so similar to what KSP1 was doing, mods could have their own category. Might be even something players could toggle off it they don't want them
yep, pretty much that
sounds good
I was going to hide categories that don't have active missions
"CommunityMissionsCatagories"
well, the idea is to let the modders use any string they want
I mean, why would it be community, I was going to allow mods to define any category they want
I was literally going to change the mission type from an enum to a string
I was kidding 🙂
Though there's a point to consider what would we do if different mods define the same string. Merge it or keep them separate.
Merge it obviously
The patches won't know what mod the categories came from
anyways gtg for now
They could know, but ok, there's no reason to do it, I agree.
Not easily no
Aaaa I'm really 50/50 on this : + -> +: change
I'm 100% for +:
It's going to be fun pinging sinon to update the LS again lol
But I have added the following so far
:experiments #"orbital_survey" {
DataType: Both;
}
I'm going to add string interpolation in selectors at some point
(At the same time I add a top level @each)
I'll honestly do it like the following
$"{$xyz:...} + {$y:...}"
Which gets passed to String.Format with like the followint
String.Format("{0:...} + {1:...}",xyz,y);
alright, I'm implementing the +: thing
Why are you crying munix
I don't like it 😢
Alright
let's get these breaking changes out of the way before 1.0
which by the way, I feel like the only puzzle piece that's missing now is celestial bodies and galaxy definitions
and then we're ready for 1.0
Yeah
that's why this next version is 0.7.0 still
Also literally everywhere you can use a string now, you can use the unquoted string form
@define-stage stage;
@stage stage
:parts {
}
Example
alright, let's hope people don't try to use property names there
like
mass: mass + 2
since it kinda invites you to do that
well variables are already known to be $ is the thing
also that would tell you an error
and if we syntax highlight it as a string
yeah, but the fact that the assignment also starts with no $ could lead someone to that conclusion
👍
@frail star new PR for the language server
mmm
btw, don't worry about a lot more things being highlighted as strings
@new("Stormlight")
@new(Stormlight)
Yes
Yes
I was resisting a bit as well, but it makes sense since CSS considers most unquoted strings as strings, too
wait
i just saw a person i know in the member list
from a completely different server
lol
i was trying to ping cheese, and i saw them
anyways
@upbeat hare
i am very mentally invested into optimizing my memeql, and i will do this in a bit
O(log n) best case is for weaklings
O(1) or bust
Just upgrade the CPU to have a 1 terabyte xor gate
O(n) worst case 😬
still would probably be slower than my
simd comes so hard into play here
What I am not looking forward to is string interpolation
Syntactically Awesome Style Sheets
Does the foo: +[bar]; -> foo+: [bar]; change have some level of backwards compatilibity or will all mods using this syntax break?
I was thinking of adding backwards compatibility, but I was just going to go through every mod I know and make the change as a PR before release
there aren't that many, anyway
Just for info I won't be able to update KLSS until the 30th at the earliest
I would however still have access to SpaceDock & the forums so I can upload a zip if someone else builds the release
what if we submit a PR for it and give you a zipped release
yeah, that was my thoughts as well
I'm going to be heading to grab breakfast for now tho
I have a ... really stupid idea

if file is older than release date
file.replace(": +"," +: ")
file.save()

I dont foresee any issues with this
I also fixed the build script to work with the action, and added the two other actions from the new template version
let's see what it does
it fails at finding the antlr dll
aaaaaaaaaaaa
I forgot we do this sort of magic bullshit
can we just... copy them into plugin_template and commit them?
I suppose we could
I was hoping to avoid that
~/.local/share/NuGet/plugins-cache is the nuget cache location on linux
huh why does MSBuild set the autogenerated property wrong
but also I just tried that on WSL Ubuntu after restoring the solution and the folder doesn't exist
aafsjhsdfgjl
I know the issue
it's because we capitalize the folder name
and Linux is case sensitive

thats an easy fix then
yeah that was the whole issue
now it finds the file
lmao ok another easy fix
I just used the template's nuspec name which is Package.nuspec
but we have PatchManager.nuspec
Oh lol
nice
Anyways my next project is to make SW compile without warnings and have doc comments
we really just need a doxygen site for spacewarp
I already started work on it
so I'll at lease push what I have and you can continue, and I'll get on with the mission editor
though, could you please try to make the mission debug thing first, so I can release CF?
Oh I was just going to write a patch to give myself that mission at the start
Lol I can use the standalone patch system I just wrote
it's nice to have actions back for PM
I'm glad I put the effort into making all the nuget and powershell stuff work
Testing the release action now
ooh I know exactly what that is
Yep
it's the SW specific path
I'm half tempted to delete the release and try again lmao
why not tbh, you can just copy the markdown
Going to force merge
lmao I made a PR but yeah, that's fine
Attempt no. 2
WOOOO
Everything worked!
it wasn't without some small hiccups, but nothing major, I'm glad
there was a deprecation warning in one of the steps
oh yeah I already have that action replaced in the template
let me make that change in dev
it's pretty cool that this also allows us to very easily do something like fix some small mistake in the code, just push the change into main, and create a release and then just grab it and upload it to spacedock (which we will also be able to automate), and all that without any dev environment set up or KSP2 installed
for example in situations like Safarte's right now, on vacation
in fact I think that in the next template version, I'd like to add a SpaceDock upload action
to make this complete
and I'm still very interested in this: https://game.ci/docs/github/builder
Building the project as part of a workflow may help to create mind-space and focus on the project
it could allow us to fully automate even solutions with Unity projects
like automatically building SpaceWarpUI
That would be awesome
yeah I need to update to the latest version of the template for my mods when I come home
honestly out of everything I do here, the template is like my passion project
It also prevents any malware from getting into the release zips in case the devs computer is compromised
not that that is a big concern
Hey Guys, long stint of absance but I am back. New update if fantastic, is it a known issue with the update that there is a bug with rebuilding the cache?
not that I'm aware of, what is it specifically?
I also hit it
EXC 15:07:43.710] NullReferenceException: Object reference not set to an instance of an object
PatchManager.Core.Assets.PatchingManager.RebuildAllCache (System.Action resolve, System.Action1[T] reject) (at <8466f18cf3c7417f87d171cc831cb24e>:0) KSP.Game.Flow.GenericFlowAction.DoAction (System.Action resolve, System.Action1[T] reject) (at <dd6137ea2e634c0ba20d8eb5ac23d499>:0)
KSP.Game.Flow.FlowAction.Do (System.Action1[T] resolve, System.Action2[T1,T2] reject) (at <dd6137ea2e634c0ba20d8eb5ac23d499>:0)
(wrapper dynamic-method) KSP.Game.Flow.SequentialFlow.DMDKSP.Game.Flow.SequentialFlow::NextFlowAction(KSP.Game.Flow.SequentialFlow)
KSP.Game.Flow.SequentialFlow.Update () (at <dd6137ea2e634c0ba20d8eb5ac23d499>:0)
[EXC 15:07:53.216] NullReferenceException: Object reference not set to an instance of an object
KSP.Rendering.CelestialBodyGIProbeManager.RemoveEvents () (at <dd6137ea2e634c0ba20d8eb5ac23d499>:0)
KSP.Rendering.LightingSystem.RemoveEvents () (at <dd6137ea2e634c0ba20d8eb5ac23d499>:0)
KSP.Rendering.GraphicsManager.RemoveEvents () (at <dd6137ea2e634c0ba20d8eb5ac23d499>:0)
KSP.Rendering.GraphicsManager.Cleanup () (at <dd6137ea2e634c0ba20d8eb5ac23d499>:0)
KSP.Rendering.GraphicsManager.OnDestroy () (at <dd6137ea2e634c0ba20d8eb5ac23d499>:0)
[WRN 15:07:53.248] KSPAudio: Unable to find AudioInputDefinition for hotkey binding!
thanks for the report, I'm looking into it
I thought it was my mod because I hadn't changed the way to do something+=else; but I get it when I move my mod out of the way
it it possible to download the previous version?
Okay it loaded in after about 10 minutes. Just took a very long time.
that's probably the action timing out
I just tested with cache deleted, and then with cache existing, and haven't hit the exception either way
could you please send the full logs?
C:\Users\username\AppData\LocalLow\Intercept Games\Kerbal Space Program 2\Player.log contains everything
I'll grab that.
I also found the previous version I think at https://github.com/KSP2Community/PatchManager/releases/tag/v0.6.1. Does that sound right?
yes
no need, this file should contain all that is in that one
and some extras
thank you both for the logs
no problem, thank YOU for the mod!
and I have already found the issue, thanks, this will be an easy fix
Second this
here's a (hopefully) fixed version, would you mind testing it for me?
Force merge and release pls
sure
Thank you
Works perfectly, want the log?
actually... I worked on a mobile app for an Invision-based forum years ago
lmao
but the API has to be specifically enabled by the admins
which I very much doubt they have
I would love that as well
Setting up the spacedock uploader is the next step
definitely
I already have the ksp2community bot username/pw in the secrets for spacewarp
oh I thought you were going to remove support for : + but I've updated to 0.7.1 and it's still working
It is not
- just returns the value on the righthandside
I should add a check that the value is an integer/real
So
X: +5;
Does not do $value+5
It just returns 5
It might still be working as your things are the only overrides for example
But there is no code for parsing that stuff explicitly now
ok, orbital survey is still working because
PAMModuleVisualsOverride: +[
is the same as
PAMModuleVisualsOverride: [
for the PAM override. Ok, gotcha
Exactly
@use 'builtin:list';
@use 'builtin:dictionary';
@function mult-by($ratio) {
@return @function($v) {
@return $v:set('value',$v['value']*$ratio);
};
}
:parts #engine_id > Module_Engine > Data_Engine > Engine > atmosphereCurve > fCurve {
keys: $value:map(mult-by(/* your ratio */));
}
I can't really do much better than this here, can I?
Maybe adding some curve builtins?
I suppose that might be helpful, since ISP will probably be a relatively frequent patch target
Yeah, but I can't do anything about requiring function calls
This really do be looking like CSS lmao
That's fine
Fair enough
Also, I'm thinking, should I allow
$v:value
With no function call to be the same as
$v[value]
Umm, so I also need to do a hotfix soon
The single file patches aren't being hashed for cache invalidation
Im still very glad I added higher order functions
I'm thinking we might have to change our caching system a bit
We compute the cache ... after we check cache validity now

Also @north mist patch manager is going to start using C# 12 from my next commit
sure
It's basically just us 2 so it won't be an issue
hey, do u know if this supports float curve editing? if it has been tested
not sure if tested, but it should work
"fCurve": {
"keys": [
{
"time": 0.0,
"value": 335.0,
"inTangent": 0.0,
"outTangent": 0.0,
"inWeight": 0.0,
"outWeight": 0.0,
"weightedMode": "None",
"tangentMode": 0
},```
ok i will try to figure it out, thx
very good mod btw, its cool to finally have a MM style mod
took me a while to work out how to edit partmodule stats, but now its great
yeah, we basically looked at MM, and tried to do something similar but make it much more powerful, and base the syntax on an existing language (SCSS) to make it easier to learn
I have a stupid idea once we fix caching
We should add the addressables catalogs and asset bundles for mods into the cache hash
what is the syntax for editing a field inside an object which is inside a list? e.g. Experiments: [ { "ExperimentDefinitionID": "AtmosphereSurvey", ... } ]
Experiments[N]: {...}; where N is the zero based index for that list
like this? * > Module_ScienceExperiment > Data_ScienceExperiment { Experiments[0]: { ExperimentDefinitionID: "AtmosphereSurvey", }; }
Nah, you might want to do this instead
bc that patches but then throws the weird error in the vab where it just shows the color picker
@use "builtin:dictionary";
* > Module_ScienceExperiment > Data_ScienceExperiment {
Experiments[0]: $value:set(ExperimentDefinitionID,AtmosphereSurvey);
}
And then you can keep chaining :set
not working, maybe i need to update
0.6
is that supposed to break splash screen skipper?
cannot live without that mod lol
That mod is sentient I swear
but no it isn't supposed to break, I don't use it because it only works for 50% of people or something
What do the logs say
yeah i wanted to find those, where are they?
You'll want to look under BepInEx/logoutput.log
at SpaceWarp.Patching.LoadingActions.InitializeModAction.DoAction (System.Action resolve, System.Action`1[T] reject) [0x0000d] in <39f0697ba36b449aa19b27f13be09abd>:0
[Error :Space Warp] System.NullReferenceException: Object reference not set to an instance of an object
at SpaceWarp.Patching.LoadingActions.PostInitializeModAction.DoAction (System.Action resolve, System.Action`1[T] reject) [0x0000d] in <39f0697ba36b449aa19b27f13be09abd>:0 ```
Can you send the full log please
is there a patch manager log?
sorry nvm im a derp
[Error : BepInEx] Could not load [Patch Manager 0.7.1] because it has missing dependencies: com.github.x606.spacewarp (v1.7.0 or newer)
nested fields inside objects inside lists are serious business, have to update everything lol
and pray the skipper still works
Are you patching the engine modes?
Arcane dark magic is breaking splash screen skipper. There is no hope for salvation.
> Data_Engine > #mode-id {
}
Is the easiest way to get to an engine with a certain mode
> Data_Engine > engine_mode {
}
Gets all engine modes
phew it works at least
Good thing I'm a dark wizard
gotta go back to basics, nothing works except the tech tree
PitchTorque: *0.02;
RollTorque: *0.02;
YawTorque: *0.02;
}```
that used to work and i didnt think that syntax changed?
in 0.7
It did change
* > Module_ReactionWheel > Data_ReactionWheel {
PitchTorque *: 0.02;
RollTorque *: 0.02;
YawTorque *: 0.02;
}
What I was trying to say up here
ah i get u now, thanks
ok seems to be working, thx, just a last question - how to delete the object with lookup by name inside the list, like * > resourceContainers { ElectricCharge { @delete; } }
* > resourceContainers > ElectricCharge {
@delete;
}
Works
hm, the resource doesnt get deleted
@if $$crewCapacity > 0 {
* > Module_ReactionWheel { @delete; }
* > resourceContainers > ElectricCharge { @delete; }
}
}```
Give me one second I need to remember how I set this up
np
:parts {
@if $$crewCapacity > 0 {
* > Module_ReactionWheel { @delete; }
* > resourceContainers > .ElectricCharge { @delete; }
}
}
Try this
yup! tysm
That needs to be changed, why did I use class there instead of element type or name like I do everywhere else
ok
i might not use it anyway since the life support mods probably need EC on the pods
Nah, I'll change it in a backwards compatible way in a later update
kk
Can I do something like this? And what would the syntax be?
$visual-parts: ["#antenna_0v_dish_ra-2", "#antenna_1v_parabolic_dts-m1", "antenna_1v_dish_hg55", "antenna_1v_dish_88-88"];
$biome-parts: ["antenna_0v_dish_ra-15", "antenna_1v_dish_ra-100"];
:parts $visual-parts {
// do stuff
}
And this is planned once i implement string interpolation
The answer is not yet
But I want to
Alright, good to know
For reference, the syntax would be a top level each loop
I'm also looking forward to having Builtin Library References filled in, lists, dictionaries and the rest
But now that I have someone wanting it, ill move it up in priority
I mean I have an easy backup solution, but it would have been nice
https://forum.kerbalspaceprogram.com/topic/221179-071-patch-manager/?do=findComment&comment=4353693 we also have someone wanting a way to replace the skybox with PM
Patch Manager A mod for all your generic patching needs! Spacedock: https://spacedock.info/mod/3482/Patch Manager Github: https://github.com/KSP2Community/PatchManager Author: KSP2 Community Description Patch Manager is a mod for KSP2 that functions as a sort of spiritual successor to Module Mana...
lmao
Thats ... just not possible
lmao that's what I told them
Yeah, expect it soon tho
Also, I want to move all the constants Orbital Survey uses like min/ideal/max altitude to PM patches and I'm reading up on defining configs other mods could override, that would be a nice touch. But ideally I also need a way to access those value from inside my c# code, similar to how you'd do that in MM. Is this possible?
Umm, you can access the builtin get config function directly
You just need a reference to the Universe which is patchmanager.core.assets.patchingmanager I think
It returns a DataValue which will hold your valur
An API would be nice, I think that other modders would need that as well.
"Universe"? What is that? A namespace?
The function js PatchManager.SassyPatching.Builtins.ConfigBuiltins.GetConfig
well it kinda already is an API, I think we just need to document it
The state of the patch manager environment
I don't know what that is 🙂
it's a class
Ok, I'll add PM as a reference and look around
I thought I made it public aaaa
https://github.com/KSP2Community/PatchManager/blob/main/src/PatchManager.Core/Assets/PatchingManager.cs
can't you just use PatchManager.Core.CoreModule.CurrentUniverse?
oh but there's no easily accessible instance of the core
I ... forgot to make that a static property 
