#Patch Manager
1 messages · Page 5 of 1
Wait, thats cuz thats an MK1, which I already put the module on the prefab earlier, and it didn't load data ... cuz it didn't have any data in the save
Wait ... huh
Now it is adding the module, just broken
I need to grab unity explorer anyways
It does put all of this on the eva kerbal and it seems correct
Yep, my code must be broken for eva kerbal somehow
And I don't understand whats wrong here?
huh
I do have this error though
So something is null
So Mode is null now
Yep, mode is null
Which is what it is in the json as well
the context key is null
Ah yeah the ModuleProperty fields are not default initialized by PM
Hmm, is that something we should do?
Hmm those are in KSPState so I feel we wouldn't want people having to initialize them in their patches, the focus should be on the definitions
Mmmmm ... this is gonna be fun
Side note, I like how clean your patches are
Like the fact you use a constants library to help define everything without funky numbers
Yeah I didn't want to have to change a bunch of magic numbers everywhere all the time, I could still move some more stuff to it too
Oh gosh, this module property initialization, I am gonna need to do a lot of magic ain't I...
Because this stuff is assumed to be initialized in the OAB
but since this stuff wasn't in the OAB, it was never initialized
Arf that sounds annoying, getting the type T and initial value when iterating over the fields in the data is possible with reflection?
Surprisingly no
Take for example the resource converter mode, its default initialized based on formulae, isn't it?
Hmm isn't the field just initialized with an empty string?
Ah can't you just init it with the field name then?
Actually, I can do it another way
A much simpler way
.RebuildDataContext should work
@stiff crater
On the stock kerbal K2
Niiice
There is also the issue of the timer not ticking down for this though
So it seems to be an issue of all crafts not created from the OAB while the mod was installed
And this is also wrong
Hmm, I'll check this on my side
Do try with the latest dev branch of PM
And make sure to wipe whatever cached stuff
And this is weird, I'll look into what could cause that
Hmmm we might have broken some stuff
Steps:
1 - Load a in-flight save created prior to mod install
2 - Go to main menu without saving
3 - Load a save which was in the VAB
My KSC is not happy
How in the name of all that is unholy
flashing lights warning
I uhh ... okay ... what
Okay I think I know how I might fix this though
Maybe I don't add some stuff in the OAB like I have been
And only in flight
Yep, can reproduce
Best I can tell, this bug existed before this fix :/
Probably an issue with not adding modules to already in flight craft
Okay seems like the ComponentModule of the module is null, that must be the cause of the issue (and the reason why LS wasn't ticking, the resource consumption happens in the ComponentModule)
I'll have to look at what sets that
Well of course it isn't just made out of nowhere
Ahh so its synced in the InstantiateViewObjec function
Does this make it hard to initialize for PM stuff?
(all this module shenanigans look annoying, I wonder if Module Manager in KSP1 needed those kind of fixes)
Yeahhh its gonna be annoying
I have to find the proper place to hook into the sim object
Dont worry im an expert in diving into hell by now
Next we need a mod that revamps the async asset loading system, just to really get to know the deepest darkest parts of hell 
IG should just hire me to make these tools, it'd be a lot easier
Alright, I need to make an updated estimate
5 layers
But I think I found the code I want to hook
It was somewhere slightly different ... but I think I have a course of action
Also @stiff crater kerbals are prefabs lol
Hell if I do this magic correctly, I might be able to fix other bugs
So they are different from normal parts? (Don't know what them being prefabs implies)
Nah they are basically the same
Just means we have to hook adding components a different way
[HarmonyPrefix]
[HarmonyPatch(typeof(PartComponent), nameof(PartComponent.MergePartModuleData))]
internal static void SetDefinition(object definitionData)
{
if (definitionData is PartDefinition partDefinition)
{
var name = partDefinition.Properties.partName;
var def = GameManager.Instance.Game.Parts.Get(name);
for (var i = partDefinition.Modules.Count - 1; i >= 0; i--)
{
if (def.data.serializedPartModules.All(x => x.Name != partDefinition.Modules[i].Name))
{
partDefinition.Modules.RemoveAt(i);
}
}
foreach (var mod in def.data.serializedPartModules)
{
if (partDefinition.Modules.All(x => x.Name != mod.Name))
{
partDefinition.Modules.Add(mod);
}
}
}
}
Anyways heres hoping this works
But wait, I may be better off yet completely hooking something
Not yet thouhg
Cuz if I can find where that data is set lol
I can just modify it there once
and have magic occur
Nope, in fact stuff was more broken after that "fix"
Ahhhh
The fuck
Ahhh I was being an idiot
Ayooooo
Thats a stock vehicle spawned on the launchpad from the KSC
Getting this still from the EVA kerbal
Might be my bad, I'll try to check later today
If both the ComponentModule & ModuleData are correctly initialized, this should be a bug on my end
No I think its one on my end
Added to an existing vessel
The last one is going to have to be the kerbal
Alright, I see both ComponentModule and ModuleData being initialized
So it might be on your end
I'll have a look, thanks for all your work on this issue!
I also pushed all the stuff I just did
Damn that person who made the hooks for campaign loading in spacewarp however long ago, their work came in handy
(I use that to update already extant vessels)
I didn't encounter the issue so an unrelated thing that I fixed yesterday might have fixed that, could you try again with this version if you have some time?
But all in all I think PM is nearing a decent state for a first release!
Was this fixed by your many fixes or is this still an issue?
I'm not sure if that was fixed I did not test
Alr I'll test it rq
Did you encounter any issues?
This is something I think may be caused by PM but I'm not sure
How did this happen?
Not sure, it happened when loading into a save
Hmm I have an issue with LS resources not ticking when loading a save that predates mod install, I'll check what is going on rq
Odd, I'm not having that issue
Ok nvm that was an issue of my UI vessel list not refreshing correctly (as well as the CR UI resize, I'll have a look at that)
So basically everything is working?
As far as I can see yeah
I'll try to repdroduce this
If you have H.U.M.A.N.S. installed, empty portraits can sometimes happen on game load or scene changes.
Just PM, CR, and KLSS in my test install
(good to know it's not caused by HUMANS. Offtopic, sorry)
Might just be a base game bug
But it's not caused by PM, CR and KLSS as I don't have them in my dev install and it still happens, so yeah, game bug
Huh
(was still doing some loading in-flight save -> return to menu without saving -> loading other in-flight save)
I dont understand, I dont touch those functuons
Might be some other mod doing some weird stuff, but the only one I opened was the Message watcher one
ShowKSP2Events? It doesn't touch those as well. Game bug probably?
Would have to reproduce in stock
Also dw i dont bite about offtopicness unless its really offtopi"
Oh I see why this is happening, the MessageCenter is shut down when quitting to main menu, so I'd need to resubscribe at each reload? (How? Could the SpaceWarp loading hooks help me here?)
... I think I need to modify some sw stuff then
one solution I can think of is to just keep checking whether Game.GlobalGameState.GetGameState().GameState == GameState.MainMenu in an Update method, but that's obviously not ideal
Update, when subscribing to a message you can set the handle to be persistent so it isn't removed on shutdown
Ahh sw automatically makes its subscriptions persistent
It indeed works way better with PersistentSubscribe<> x)
We should set up a gh action to auto build patch manager
any significant changes to PM?
It works now! (Module & recipe patching had some issues)
No celestial body stuff yet tho
Oh yeah I figured out how to add modules to already existing vessels in a save
If munix concurs, we should release this once 0.1.5 comes out
yep, it's high time, now that people are actually using this to make mods!
Yay! I’ll have a new version of SPARK ready to go
Should it be named 0.2.0 or 1.0.0?
1.0.0
1.0.0 to me kinda evokes it being a feature-finished thing (which will get extra features later)
which I don't think I would consider it to be
I consider 1.0.0 to be the first publicly available version, not in beta, but fully functional. Not necessarily feature complete.
But both approaches are valid.
then there's RSS that's on v20 currently 🙂
https://github.com/KSP-RO/RealSolarSystem/releases
1.0.0 also means we cant change api
yeah, that's another thing
we use semantic versioning, unlike RSS or software like Chrome
So yeah, once space warp is updated, I am pushing this out :3
Anyways ... I need to update PM then likely need to wait for a klss update from @stiff crater to test with and push this out
Alright, PM has been updated and I tested with my crew cap patch on a save without the mod
@north mist thoughts?
nice!
having a generic UITK element there for stuff is nice
Anyways going to add a configuration option and that should be it
Or rather a way for modules to bind their own configurations
Added a config option to always invalidate the cache as well
And here's what that details pain looks like with an invalidated cache
very useful, cool!
(if you could add to the cache a summary of all the patches and such that would be useful)
Honestly I'd prefer a summary of patches and new asset creations per label
Is that something that is doable munix?
Its not critical
@digital cloud try setting PM to always rebuild cache
tis in the latest build as a setting
Dumb question. I think my local copy is fully synced with the dev branch, but when I build for deploy it does not put it in the game folder and I also don't get it here
I honestly never use deploy
that's weird, I'll need to take a look at that
I always build using debug and let munix handle the nuget
Oddd
The stuff in build\ob and build\bin is all from 9/30
Not that's not right. Only the parent folders are that old. There's this buried deep inside it
Doh!
@north mist does this make sense?
Hell yes it does
Those files are a match for what I've got installed in the game
No, the names are diff
The times are the same
Me too... And Off I go!
that shouldn't matter
it's not hardcoded anywhere afaik
it's all MSBuild variables
so it should update accordingly
@digital cloud I just ran deploy on the latest dev branch ... and it worked perfectly fine creating a folder in the deploy directory
yeah I was just about to say, I tested it right now and it did everything correctly
with DeployAndRun
though it doesn't actually seem to work in-game, there were some exceptions
I thought I fixed that
dev
this was on a clean install where PM had never been installed before, either
wait wtf
now I deleted it, rebuilt
and it works
ok I'm not even gonna question it
lol
should it be showing patched labels even though I have 0 patches?
yeah I don't
patched labels is more gonna be meant for a breakdown
but I want that info in the cache
interesting
yeah my cache is currently completely empty
no inventory file or nothing
Might want to deal with this error if it crops up
Actually wait I have an idea of how to deal with that error
Yeah, the cache shouldn't be built if nothing changred
huh the Community Resources solution has no configurations
so I can't build it from Rider
That's not normal it had some last I checked
It has some for me
it definitely should
weird
I had a very old version of the repo open in Rider and just did a pull
but when I closed and reopened it, they now appeared
ah yeah
so now I'm on the same error as schlosrat
[Info :Patch Manager] Loading patchers from C:\Games\KSP Instances\KSP 2 Debug\BepInEx\plugins\CommunityResources
[Error :Patch Manager] error parsing C:\Games\KSP Instances\KSP 2 Debug\BepInEx\plugins:base_fuels.patch - 1:7: mismatched input '<EOF>' expecting {'@use', '@function', '@if', '@mixin', '@require', '@require-not', '@stage', '@define-stage', '@patch', '@new', '(', '+', '*', '~', NAME, CLASS, VARIABLE, RULESET, ENSURE, ELEMENT}
[Error :Patch Manager] Could not run patch: C:\Games\KSP Instances\KSP 2 Debug\BepInEx\plugins:base_fuels.patch due to: parser errors detected
[Error :Patch Manager] Could not run patch: C:\Games\KSP Instances\KSP 2 Debug\BepInEx\plugins:life_support.patch due to: C:\Games\KSP Instances\KSP 2 Debug\BepInEx\plugins\CommunityResources\patches\life_support.patch:39:14: Numbers must be parsable as a double precision floating point number
[Error :Patch Manager] Could not run patch: C:\Games\KSP Instances\KSP 2 Debug\BepInEx\plugins:recipes.patch due to: C:\Games\KSP Instances\KSP 2 Debug\BepInEx\plugins\CommunityResources\patches\recipes.patch:10:28: Numbers must be parsable as a double precision floating point number
Yeah that will break it
wtf antlr
life_support.patch has plently of single comments //
ah ok
then that's definitely weird
[Error : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
PatchManager.Parts.Patchers.UpdateSavedVesselPartDefinitions.DoAction (System.Action resolve, System.Action`1[T] reject) (at C:/Games/KSP Stuff/KSP 2 Modding/Mods/PatchManager/src/PatchManager.Parts/Patchers/UpdateSavedVesselPartDefinitions.cs:18)
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)
campaign loading stuck on this
Did they change something again
probably
Or vessels
Hmm, was that in campaign creation or campaign load
Ohh
Okay maybe the default one has a null vessels field and I didn't know
Gonna do some debug logging
The odd part is I'm not getting the same errors you are from CR I don't think
huh? do debug logs from flow actions not show up?
Use the logging class
and now I'm also getting this
[Info :Patch Manager] Loading patchers from C:\Games\KSP Instances\KSP 2 Debug\BepInEx\plugins\CommunityResources
[Error :Patch Manager] Could not run patch: C:\Games\KSP Instances\KSP 2 Debug\BepInEx\plugins:life_support.patch due to: C:\Games\KSP Instances\KSP 2 Debug\BepInEx\plugins\CommunityResources\patches\life_support.patch:39:14: Numbers must be parsable as a double precision floating point number
[Error :Patch Manager] Could not run patch: C:\Games\KSP Instances\KSP 2 Debug\BepInEx\plugins:recipes.patch due to: C:\Games\KSP Instances\KSP 2 Debug\BepInEx\plugins\CommunityResources\patches\recipes.patch:10:28: Numbers must be parsable as a double precision floating point number
nevermind I'm once again after quite some time getting that annoying thing where DeployAndRun doesn't seem to copy over the newest assemblies
ahhhh
buh
costPerUnit: 0.8;
this line throws the error that Numbers must be parsable as a double precision floating point number
That is obviously incorrect
the number or the error?
yeah...
Its vessels thats null
apparently doubles are now broken
simple enough to fix
Hey, I'm having an issue here. I think my local copy is synced with the dev branch, but when I do a Debug or Deploy I get bupkis
On my GitHib fork it shows this
I just pushed some more stuff fixing some of my issues
both PM and CR are currently somewhat broken
so I don't know if it's any use
but building works fine for me
Yeah, but still, I'm either not getting anything to build here, or not understanding what it's doing and where to get what it builds
what are those extra 7 commits?
There are 7 commits, but in total only 1 file changed and the change should not be an issue
I think...
yeah it shouldn't
try deleting the build and dist folders, do a nuget restore, and rebuild
though Cheese did just push another update to the dev branch a couple of minutes ago
so you might also want to pull that in
I don't think its fixing that error that you encountered though munix...
I added this to the top of that function but I still can't load into a new game
Back when I only had half a shield
lol
OK I re-synced and picked up whatever Cheese did.
Remind me, what do I need to do to do a nuget restore?
That's a command line thing, right?
there definitely is a UI thing for it in VS
even better!
I like this steaming load of garbage! It's way cheaper that that hunk of junk you're flying
I never called resolve
And it works just fine for me!
I mean, I'm flying it for free, with a student license

I mean, just become a long time contributor on a project and maybe we can convince jetbrains to give it to you
Hmm adding a call to resolve did not wokr
I pushed my stuff
I need to go grab lunch
ok you need to right click your solution and there click Restore NuGet packages
I'll do more bug fixing after lunch
that fixed the campaign loading bug after creation for me
Piece of cake!
.
Yeah I did that. And then I re-did the sync, and then did a pull down to my local machine, then a Deploy.
well if it compiled without errors, then the restore worked
And now I've got an new build folder, but not a dist

Done, and you're right
ok let me try to clone your repo
I cloned the repo, opened it in VS, tried a Debug build, and it created the dist/Debug folder like it should
so I would suggest just completely deleting your local version and cloning it again
no clue how else to help
good to hear
you don't
#1115274490490929172 message
it's another PM bug
which causes the CR patches not to load
The above errors occured when I placed a lithium tank on my contraption. Placing an lithium engine gives rise to a total freakout
yeah, that's probably to be expected if the resources don't exist
Seems reasonable
hopefully we'll be able to fix this today to get everything ready for tomorrow
No worries. I'm going to go work on making a simple methylox engine - the kind without a plume apparently 😉
Changing it over to be an OP engine will be a no brainer once you guys have this working.
I dont know whats causing doubles to stop working suddenly
I bet its the 2.0 to 2.1 change for some reason
like why would double.TryParse fail on these
:/
does it happen for you too?
because
localization
I have Czech, and we use decimal comma, not dot
That should be an easy fix then?
Invariant culture
yep that fixed it
so theoretically this isn't the bug @digital cloud has been encountering
since he's probably using US settings in Windows
ah
I'm adding it to all .TryParse calls in the code, just to make sure
since it could affect ints as well
I had a friend at a previous internship that spent multiple days going mad at an incomprehensible bug in Java that was actually just a localization issue due to a mismatch between his computer & the servers
yeah these are the absolute worst
Did this restaurant just start playing never gonna give you up
I normally dont pay attention to the music
But when its a rickroll
Why are there even languages that use a comma as the radix point
Eww
compared to 1,000,000.000
though I prefer the US one, to be honest
that's like the one thing from math/physics that I feel like the US makes more sense in

Same in French yeah
Thats cuz its Fr*nch
@digital cloud do you have the Lithium patch anywhere so I can test it with SPARK?
thanks!
Hang on, the recipies is wrong
Yall have a language standardization institution and still cant decide on objectively correct standards
That feels like either 100 or 64 to me
It's not a standardization institution, it's just a bunch of old annoying dudes that publish 1 dictionary per century 
And think they are objectively correct about languafe
While also being prescriptivist
Yep, I don't like them a bit (but we're getting off-topic)
True
On the staging?
That's normal, only "non fuel" resources (except monoprop) show up here
Localization issue most likely
yep
but other than that, the engine is running!
so that's good news
and in the OAB it correctly shows Lithium
Nice, I'm going to test module patching as soon as I upgrade my unity project for klss
so, now we're basically just missing LFO and we can make engines with any fuels
awesome
There is one other problem, though unrelated to these. I'm messing around with the engine module parameters and it wont let me edit the animation curves like normal. Ordinarly you can Add Key, Edit Key and Delete Key. Now I can only Add Key, and editing it purely a graphical thing which is very much a holy PITA.
This has nothing to do with PM - sorry off topic
Wait, I can delete keys by selecting them and pressing delete...
And I can edit them by selecting and pressing enter!
Not a perfect world, but perfectly serviceable
You may now go on about your normal PM shenanigans. Carry on.
Oh.. Wait... Should the localization stuff for fuels and categories go into CR instead of in my engine mod? Does it matter?
If the fuels themselves are in cr then their localization should
other mods might use the resources and not everyone may have your mod installed
And most resources mods use should go into community resources
You only need a wee bit
As we dont want them to be doubly defined
Agree!
Mind the Lithium. Do not allow it to come into contact with Perspiration whatever you do. Optimism should be OK.
do we want perspiration and optimism in the community resources? it would make more sense to me to split them into a separate mod for the purposes of the workshop
And also having too many resources defined wont cause issues
Hmm maybe
I mean the separate mod would just be a swinfo, and 2 patch files
ideally they'd be in the inidivual modders' plugin_template patches
My bad, those were from SPARK, these are from CR
so they also see how to create custom resources
Yeah but when people actually publish the mods if they do
ah
But hmm I could just do a check
Ideally though, if 2 assets collide it should be an error
It feels like a bandaid to have each mod create an asset if it does not exist
yeah, I mean we can also just create a mod with just swinfo.json and these two resource definitions and localizations
and have people download the zip for the workshop
I guess that's the best compromise
Would creating new fuels / recipes not be in the scope of the workshop tbh @digital cloud ?
If the mods are working, then definitely yes. I've promissed as much
oh btw @digital cloud before I commit the lithium/argon stuff to Community Resources, do you want to add an ArgonEC recipe?
since there currently isn't one
We'll talk about using OP for fuel
The ArgonEC reciepie is the same as LithiumEC whcih is the same as XenonEC, except that it calls for Argon.
It's 1:1 with the actual control set as an override in the engine
alrighty
Please do add it!
oh and one more thing
Yes sir?
there's Resources/DisplayName/Hydrolox, Resources/Abbreviation/HO, and the same for XE, but those localizations aren't in the file
I'm assuming I should add those, too
Are those not in there?
Or do you mean OP?
not in the files you sent
I think I might have stepped on them when I was messing with PM and CR earlier
I'll get those to you ASAP
thank you!
there are localizations for the individual resources, but not for the combined recipes
Not sure if you need localization for the recipies. Those don't get displayed to players do they?
We need definitions for them, certainly
But localizations?
I don't know, tbh
but it's a bit strange that the localization keys for them are used in the patches, but never defined anywhere
Those are from my earlier effor in 0.1.4.1
I think they're correct, and they apply to CR/patches
I need to fix that hydrolox recipy
I've got those
but what I'm saying is
you have for example
displayNameKey: "Resources/DisplayName/ArgonEC";
abbreviationKey: "Resource/Abbreviation/AE";
aka it's using those two localization keys
but the localizations aren't defined anywhere
even if they aren't currently displayed in the UI, I think we should still provide them, to not leave any loose ends
if you look at that, there's no "Resources/DisplayName/ArgonEC"
etc
maybe I'm just being pedantic, but I think that if we use the keys, we should also define them
Working on it.
So we'll put OP in CR or in a separate mod? (I don't feel they fit CR)
We can split out the OP stuff if you like.
But I think thik sets things correctly. Note I made a small change to the recipie name to conform to the others
thank you! I'll just do a minor correction to it
As they are case sensitive
since the recipes are plural Resources
Of course!
I am so glad we got this all working today
Do you mean in the localization?
I mean it would make sense to have singular resources as singular, and multiple as plural
but I think @stiff crater made those
what do you think?
like in this? Resource/DisplayName/ArgonEC,Text,,ArgonEC
iirc I just copied how it was done for stock stuff
Isn't Resource a particular thing we're affecting and to change it would make it not work?
no, it could be "MyFunnyResource/MyDisplayName/Hahaha" for all it cares
it's just a key
at least I think in this case, since you have to provide the key in the patch
{
"name": "XenonEC",
"displayNameKey": "Resource/DisplayName/Xenon",
"abbreviationKey": "Resource/Abbreviation/Xe",
"resourceIconAssetAddress": "",
"ingredients":
That's how the game handles one
it just has to be whatever you put here
ah so it's using the same localization for both Xenon and XenonEC
but I'm pretty sure for Methalox it will be different
can you check that?
Nope
"recipeData":
{
"name": "Methalox",
"displayNameKey": "Resource/DisplayName/Methalox",
"abbreviationKey": "Resource/Abbreviation/MO",
"resourceIconAssetAddress": "",
"ingredients":
good to know
I'll update the patch then
and for LithiumEC and ArgonEC I'll simply use Lithium and Argon
to follow the scheme used for Xenon
I think those should be LE and AE, and the game is wrong with Xe where it should be XE
MethylOx is MO
So first initials all caps
I mean, you would call an engine runing on methane and oxygen a "methalox" engine (never seen anyone refer to it with capital O), but for an engine using xenon and electricity you wouldn't call it a "xenonEc" engine, you would just call it a "xenon engine"
since electricity is not a fuel
in real life
at least that's my thinking, and I'm assuming the devs' as well
I should make an electric engine
Well, the devs used MO for one and Xe for the other, so they were inconsistent
You should! They're awesome!
I mean that's what I'm saying
Cuz Xe stands for Xenon
they name all the propellants used
Also aabout 1000x OP
and electricity is not a propellant
its the periodic table name of Xenon
so Xenon and Methalox
are the two fuel mixtures
that these engines run on
realistically
electricity is just required to run the xenon engine but it's not a fuel or oxidizer or anything of that sort
I think we're mixing up the Name property and the abbreviationKey.
With the later they did use MO
Although they also used Xe...
Well I'm saying MO is because Methane Oxygen
Xe is because Xenon
yeah
that's what I mean
electricity is not a propellant and therefore shouldn't be in the name
So then for OptiPersp it's OP, but for Lithium and Argon it's just Lithum and Argon
yep
I can live with that as the display name, but they still need to be LithiumEC and ArgonEC for configuring engines
I'm just trying to think of it in terms of real life nomenclature, and not the fact that the game treats electricity as a fuel
yeah, this was all just about the localization
Then we're good!
And the abbreviations for Lithium and Argon should be Li and Ar
Yep, to follow Xe
alright then, so I'll make these changes and push them to dev
Thanks!
@stiff crater any specific way I should translate "Hydrolox" into French? or is that good as is?
Hydrolox is good
thanks!
one more annoying question
this is in the base_fuels.patch file
so is the abbreviation XE or Xe?
oh and Resource/DisplayName/Xenon is "Xenon Gas"
so should it be "Lithium Gas" and "Argon Gas"?
I think schlosrat's Lithium is stored as a solid iirc
Most likely ( @digital cloud just in case)
from this it would appear that yes, only Lithium is stored as a solid for ion propulsion
Definitely not Lithum gas. Safarte is correct. That's stored as a solid (ingots)
so, "Gaz Argon" in French? @stiff crater
Argon is a gas though
Just "Argon" would do it, but I don't know what the game displays for Xenon (my game is in english)
Not entirely, there are a few engines that burn teflon...
oh god
I've not made any yet, and there used to be ones that burned Bismuth I think
I mean I meant specifically out of xenon, argon and lithium 😆
but good to know
lmao
well...
apparently the game doesn't translate it at all
lol
Hmmm....
or I'll just follow their example and use the english term there
Or, if you want to keep it "Argon Gazeux"
It may be I do have the first KSP2 parts mod if Kesa requires LFO!
Hmm.. need to update the dependency on SW...
patch filename can begin with an underscore, right? _gasses.patch
those should be reserved for libraries, I'm pretty sure
Patches in those will not be run
Module patches seem to be working without any issue
For reference: #1145349899777478759 message (I tried looking at the parsing code but I don't see how a 0 can appear)
I'll take a quick look at this first
Thank you
oh and btw Cheese
this is probably something wrong with logging
since all the pods have correct units in game
but in the logs it always says 0
Nah thats correct
Its showing the default state
Before the fields are actually set
@north mist now errors are more accurate
it doesn't give the weird directory for the name, but rather the mod id
that's always nice
Gonna test one final thing and push this
Maybe even release it after I get rid of some logs
Test complete
pushing now
@north mist should I release PM onto CKAN in its current state?
and spacedock
I think so
Patch manager is now on CKAN after I got its netkan working
I'll write the forum post tomorrow
Also munix I added you as an author on space dock
What was the status of the syntax highlighting & LSP?
I don't think @frail star finished that
oh yeah
lol i’ve completely forgotten about it
i have everything working except auto complete
that sounds good enough for a first release
ye
at least the highlighting would be nice
eh what the hell i don’t need sleep
Could you put its source on github too
it’s on my git, but it’s open
there’s a reason why i moved to another git server, and that would defeat the whole point
hey could someone try it quickly
i have a builtin version already... i dont remember if it works
also i assume you guys have much more updated grammar
so im gonna update the grammar files
probably not much more, but there may be some additions
I know this is slightly late to mention that, but perhaps we should use a different extension than .patch
since most editors will assume those are Git patch files

i mean...
its just syntax checking and highlighting
so 0
git uses .diff
I mean, all Git patch files I generate with PhpStorm are always .patch
interesting 🤔
and VS Code recognizes them as Git files
actually i dont think the extension matters of the git patch files
yeah wait im dumb, it doesnt matter
ive always seen them as .diff, but i digress
its kind of barebones
yeah i should actually work on the syntax highlighting
i just have the engine working
i have basically 0 time now a days, so you guys can work on it
Can you link the source then?
Sinon what am I supposed to do with this
whatever you want….
todo: fix libraries
libraries broken?
if you use one from another mod
yep, during the workshop I was scrambling to write a patch for OptiPersp, and adding
@use 'CommunityResources:flowmodes';
@use 'CommunityResources:transfermodes';
didn't work
currently it only works within the same mod
Huh. I hadn't run into this. Does it mean that the lithium ingots in one tank can't be easily transfered to another? How perfectly realistic!
Now, Argon on the other hand... There ought to be a way to get that stuff flowing form one container to another.
thatsnot what this bug is
it only means that if one mod defines some variables or functions in its Patch Manager library, they can't be used from other mods
Ahh!
Is this normal?
[Error : Unity Log] [Serialization] Unexpected character encountered while parsing value: . Path '', line 0, position 0.
[Error : Unity Log] SpaceWarp.VersionChecking: Unable to check version for PatchManager due to error System.NullReferenceException: Object reference not set to an instance of an object
I've also noticed it
and it makes no sense to me
the version_check property is set correctly to https://raw.githubusercontent.com/KSP2Community/PatchManager/main/plugin_template/swinfo.json
and in that, the version is also set correctly
What the fuck I thought we stopped type load exceptions from throwing errors
Is it because we do the Preload from start instead of onpreinit
no it can't be
FYI the custom resource units do not seem to apply to OAB tooltips
This is a community resources bug
Ah I thought the custom resource units were defined though a patch, my bad I'll take it there
They are, but community resources is what actually defines that ruleset
Roger that
I guess while I wait to continue work on KSP2UT I shall debug PM
by the way, I've realized one more edge case where we need to clear cache
and that is if the game version changes
since all mods may be able to work with a minor update, but a new part might be introduced
it might be nice to add a manual "delete cache" button to the mod list details foldout actually? (for the next start of the game)
as well
just throwing out ideas as I'm getting them
Good idea
I suppose I should finish sinons language server later as well
the point was to make a platform for it 😭 . actually adding syntax highlighting and stuff is just time consuming, time i don’t have
I mean no one is chastising you for not completing it
I just need to figure out where I need to hook to add the highlighting
i guess the sob emoji might have been interpreted as that
it’s just in the .yaml file
possibly lmao
Ahh I thought you were doing it all from the LSP
the actual colors are dealt by the theme you have installed
i highly recommend using the .yaml. i translate it into json for the actual extension
yaml just let’s everything be a lot more readable
Aight
And then I can see about adding actual language server stuff like jumping to definitions and the like
sounds good
ill help with that when i get a chance
absolutely swamped with current project
What project is that
well ive got two rn, a bigger one and a smaller one.
big one is some machine learning stuff for a research paper im writing
small one is a c compiler im writing because idk
ive spent like 30 hours in the past 3 days 💀 on the first one
I kept getting annoyed by this error
[Error : Unity Log] [Serialization] Unexpected character encountered while parsing value: . Path '', line 0, position 0.
[Error : Unity Log] SpaceWarp.VersionChecking: Unable to check version for PatchManager due to error System.NullReferenceException: Object reference not set to an instance of an object
at SpaceWarp.Modules.VersionChecking.CheckJsonVersion (System.String guid, System.String version, System.String json, System.Boolean& unsupported, SpaceWarp.API.Mods.JSON.SupportedVersionsInfo& checkVersions) [0x0000f] in <f56332410c244eaba6e3918a99ad21a2>:0
at SpaceWarp.Modules.VersionChecking+<CheckVersion>d__12.MoveNext () [0x00126] in <f56332410c244eaba6e3918a99ad21a2>:0
not knowing what's wrong
Patch Manager's swinfo.json is using UTF-8 with BOM

that's the '.' SW can't read
Pain
let me quickly push a fixed one
to see if it helps
that should hopefully fix the online version check
with no need to update the mod
just need a review on it
hurray
no more version checking error
lmao
that was an easy fix
don't know why I haven't though of the BOM bullshit earlier
it's interesting that SW deals with it fine when it comes to the local swinfo
but not the remote one
I have no clue
@frail star do I have to make an account on your git server if I want to contribute
oh yeah sure
i need to figure out how to upload the extension to the registry
not that its in a useable state, just for future knowledge
oh its really easy lol
Also @frail star how do I convert the yaml into json when I want to test?
Ah I see it
👍
@frail star how do I test this?
🤣 thats an interesting subject
so
assuming you have the launch.json that you need:
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach",
"port": 6009,
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node",
},
{
"type": "extensionHost",
"request": "launch",
"name": "Launch Client",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"outFiles": ["${workspaceRoot}/client/out/**/*.js"],
"preLaunchTask": {
"type": "npm",
"script": "watch"
}
},
{
"name": "Language Server E2E Test",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/client/out/test/index",
"${workspaceRoot}/client/testFixture"
],
"outFiles": ["${workspaceRoot}/client/out/test/**/*.js"]
}
],
"compounds": [
{
"name": "Compound",
"configurations": ["Launch Client", "Attach"],
"stopAll": true
},
]
}
you need to "launch cllient"
compound is for debugging with console output
tbh i dont remember if it works... i was having some issues
after you press it, itll open up a developer vscode window
which has your plugin running
to not close and reopen the window every 3 seconds, you can press ctrl shift + p and select "Reload Window" or whatever its called
Hmmm, alright, maybe I'll rollback my changes and try again
Actually, no I didn't change much
I keep getting this error Sinon
Do I have to regenerate the grammar?
you followed the instructions in the readme?
.... yeah i imagine getting the command might help
Getting the same error again
you ran npm install antlr4ts-cli --save-dev?
No I meant the same error in the LS
This
oh i forgot that i pushed the grammar typescript files also
lol
i could swear i gitignored them
um
yeah sure
that error is really sus
that place doesnt even exist lmao
36:81
oh
its in the javascript files
minor dyslexia
I don't think a bible verse will help here
Oh I get where the errors come from
I might have to rename some stuff in the grammar used for this
Ahh
no clue, the grammar is dark magic to me
that's interesting, it did work with the pre-release vsix that Sinon sent earlier
i just pushed directly what i had lol
um
are you sure the .json file has stuff in it?
can i see it
also whats it called
{
"scopeName": "source.patch",
"fileTypes": "patch",
"name": "Patch",
"patterns": [
{
"include": "#comment"
},
{
"include": "#keywords"
},
{
"include": "#values"
},
{
"include": "#fragments"
}
],
"repository": {
"comment": {
"patterns": [
{
"include": "#comment_line"
},
{
"include": "#comment_block"
}
]
},
"comment_line": {
"name": "comment.line.double-slash.patch",
"match": "^\\/\\/.*"
},
"comment_block": {
"name": "comment.block.patch",
"begin": "\\/\\*",
"captures": {
"0": {
"name": "punctuation.definition.comment.patch"
}
},
"end": "\\*\\/"
},
"keywords": {
"patterns": [
{
"include": "#keyword-base"
}
]
},
"keyword-base": {
"name": "keyword.control.patch",
"match": "@[a-z0-9]+"
},
"values": {
"patterns": [
{
"include": "#string-double"
},
{
"include": "#string-single"
}
]
},
"string-double": {
"name": "string.quoted.double.patch",
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.patch"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.patch"
}
}
},
"string-single": {
"name": "string.quoted.single.patch",
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.patch"
}
},
"end": "'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.patch"
}
}
},
"fragments": {
"patterns": [
{
"include": "#fragment-base"
}
]
}
}
}
hm thats right
"grammars": [
{
"language": "patch",
"scopeName": "source.patch",
"path": "./syntaxes/patch.tmLanguage.json"
}
]
and you have this in your package.json?
and the file you're trying is .patch?
yes, and yes
here lemme try just cloning from scratch and see
yeah it works perfectly
i literally just cloned it and compiled
i mean... that shouldnt break the highlighting lol
Well, it did
??
ok
lmao
well have fun, ive gotta run to school
prepare for the literal worst dev environemnt youve ever seen
you touch anything, and it breaks

and theres no error or anything
its absolutely stupid
this is a big reason why it took me so goddam long
literally just guessing what could have broken it
also a shit ton of bisects
yeah get ready for those
interesting
no clue why
um if you made an account on my server, i can add you as an admin on the repo
yep doen
knock yourself out
Function name highlighting
nice
Getting more useful yet
happy to see my environment being put to good use lol
setting it all up was such a massive pain
also i got it to publish!
it just updated
cool
“free” 🤨 i can make it paid
that’s it patcherls is becoming paywall
30$ a month
it’s basically as useful as rider
yeah but then cheese would have never even touched it
i keep most of my code reserved now a days
because it’s mine and you can’t have it 
honor system
where it counts sure, i feel like it’s a cool thing to partake in
but when i spend a long time doing something i wanna keep it mine lol
romania 😔
wooo colors
Could be better, but I will implement that stuff in the language server
nice!
I'll commit what I have now though
It's not that type of language
🗿 my attempted joke
Too late
There is now
both on release and on push
Also publish the package when you get home?