Jump to content

[0.11.1] Patch Manager


cheese3660

Recommended Posts

Do note, the aforementioned mod, shoemaker, when it is released, will have a much simpler way of doing it, as it will allow you to select a body by name directly in the galaxydefinition.

Link to comment
Share on other sites

Me again, trying to find out more about how to patch some parts. Was successful with some of it, like making solar panels retractable or setting default values for fairings , but I am stuck at changing the consumption "Rate" for fuel cells.
In the Asset Dump files these values seem to be defined in a list/directory [ ]  (sorry if my wording is wrong) and I couldn't find an example on how to adress this in a patch.
Any advice would be much appreciated!

From the fuel cell asset dump .json file:

              "FormulaDefinitions": [
                {
                  "InternalName": "Methalox2EC",
                  "FormulaLocalizationKey": "PartModules/ResourceConverter/Formulas/MethaloxFuelCell",
                  "InputResources": [
                    {
                      "Rate": 8.4375E-06,
                      "ResourceName": "Methane",
                      "AcceptanceThreshold": 0.01
                    },
                    {
                      "Rate": 3.375E-05,
                      "ResourceName": "Oxidizer",
                      "AcceptanceThreshold": 0.01
                    }
                  ],
Link to comment
Share on other sites

  • 2 weeks later...

0.9.2 fixes a bug affecting KLSS where newly created assets are unable to be patched

On 1/6/2024 at 11:42 AM, Cave_Lupum said:

Me again, trying to find out more about how to patch some parts. Was successful with some of it, like making solar panels retractable or setting default values for fairings , but I am stuck at changing the consumption "Rate" for fuel cells.
In the Asset Dump files these values seem to be defined in a list/directory [ ]  (sorry if my wording is wrong) and I couldn't find an example on how to adress this in a patch.
Any advice would be much appreciated!

From the fuel cell asset dump .json file:

This would be a very complicated patch, until likely whats going to be 0.10.0, where it would add nested indexers, so you could do something like the following for example, but this is unreleased.
 

FormulaDefinitions[ImportResources][0][Rate] *: 5

 

Edited by cheese3660
Link to comment
Share on other sites

Patch Manager 0.9.3
What's Changed
- Fixed -: expressions with lists (and anything but a real and an integer)
- Fixed not being able to disable patch manager
- Fixed loading disabled mods

New Dependencies
- PremonitionForSpaceWarp

Other Instructions
- If you are coming from an older version, delete the BepInEx/patchers/PatchManger folder

Link to comment
Share on other sites

  • 3 weeks later...

Release v0.10.0

This release changes how indexers work, it adds support for the following types of indexers

  1. Indexers in variable declarations
$x[5]: 3;
  1. Nested indexers
$x[1][2]: 3;
  1. Mapping indexers
$x[*] *: 5; // multiplies all values in $x by 5
  1. Defining new lists and such using indexers
$y[0]: 3; // Creates $y as a list with its first element being 3

Download on SpaceDock

Link to comment
Share on other sites

Hey, is there currently any way to rescale meshes with this (or any plans to)? I couldn't find the field like we had in KSP where you could just change rescaleFactor.

I need to rescale one part, and working on that in a plugin is not ideal

Link to comment
Share on other sites

2 hours ago, KSRe-dev said:

Hey, is there currently any way to rescale meshes with this (or any plans to)? I couldn't find the field like we had in KSP where you could just change rescaleFactor.

I need to rescale one part, and working on that in a plugin is not ideal

It can't do anything like that yet, and it's not very likely it ever will on its own, it's kinda out of its scope. A standalone library will probably be more appropriate to facilitate all sorts of part rescaling capabilities.

Edited by munix
Link to comment
Share on other sites

On 2/18/2024 at 12:54 PM, munix said:

It can't do anything like that yet, and it's not very likely it ever will on its own, it's kinda out of its scope. A standalone library will probably be more appropriate to facilitate all sorts of part rescaling capabilities.

ok np

what is the syntax for drag cubes? i need to modify these and others, but these seem to be the two types

"cubes": [
                {
                  "Area": [
                    0.623046935,
                    0.623046935,
                    0.3032923,
                    0.3032923,
                    0.623046935,
                    0.623046935
                  ],
                  "Size": {
                    "x": 0.625,
                    "y": 1.00000024,
                    "z": 0.625000238
                  },

 

trying this but getting nowhere, and i haven't modified named objects inside a list of random objects yet

#booster_1v_solid_flea {
		* > Module_Drag > Data_Drag > cubes {
			Size {
				x: 0.625;
				z: 0.625;
			}
		}
}

 

Link to comment
Share on other sites

edit: seems to be a bug introduced at some point after 0.9.1

if we patch this:

:missions {
    
    #Main_Kerbin_01 {
        state: Inactive;
    }

}

 

and then make a mission with the name that includes "Main_Kerbin_01" the patch is also applied to that

e.g.

@new(KSReMission_Main_Kerbin_01)
:missions {
	// ... etc
    state: Active;
	/// ... etc
}

this mission will be set to inactive in the cache.

the same thing applies to patching other aspects of the mission, and changing the name to not include "Main_Kerbin_01" (e.g. KSReMission_Pain_Kerbin_01) fixed the issue, so i think that has been isolated to naming

Edited by KSRe-dev
Link to comment
Share on other sites

2 hours ago, KSRe-dev said:

seems to be a bug introduced at some point after 0.9.1

That doesn't seem to be the case actually
Looking at the relevant piece of code, it would've been a bug introduced since the beginning

It will be fixed momentarily

Release v0.11.1

What's Changed

Fix bug in name patterns where #name was essentially being treated as #"*name*"

Download on SpaceDock

Link to comment
Share on other sites

So the bug was in all version of patch manager between 0.9.2 and 0.11.0, they have all been tested, the bug is not in versions 0.9.1 or the latest 0.11.1

comparing the distributions of 0.9.1 and 0.9.2 there was no difference in the line that changed in 0.11.1 as both are this

public static bool MatchesPattern(this string @this, string pattern) => Regex.IsMatch(@this, pattern.Replace("*", ".*").Replace("?", ".?"));

so it seems something else changed between those versions that introduced it

 

Edited by KSRe-dev
Link to comment
Share on other sites

If you're expecting modders to fully test this every time it's updated, when we don't necessarily know all the fine details of how it works, and there have been mod-breaking bugs that hung around for 6 updates, that's your choice. But when some of these updates are rolling out once a day, that's a lot more time than anyone should be expected to commit to a basic and essential dependency.

Without any further clarification on this bug, I'll stick with v0.9.1 indefinitely. Any issues users might have when using other versions of this dependency should be directed here.

Maybe some day the "veterans" of this scene will be ready to acknowledge that an overhaul mod exists. But probably not, at least in this case.

Link to comment
Share on other sites

On 2/23/2024 at 9:01 AM, KSRe-dev said:

so it seems something else changed between those versions that introduced it

The main thing that changed between those versions was the introduction of string interpolation, so maybe the way I was using that method changed and that's why the bug came to the surface, all I can say is that the new version of the method has the intended behavior for that method.

Link to comment
Share on other sites

14 hours ago, KSRe-dev said:

If you're expecting modders to fully test this every time it's updated, when we don't necessarily know all the fine details of how it works, and there have been mod-breaking bugs that hung around for 6 updates, that's your choice. But when some of these updates are rolling out once a day, that's a lot more time than anyone should be expected to commit to a basic and essential dependency.

I am not sure what you expected. So, the mod (which, by the way, as you might have noticed from the 0.x versioning scheme, is still in its experimental development phase, and stated nowhere to be stable yet) is not supposed to be getting updates when bugs are discovered or reported?

14 hours ago, KSRe-dev said:

Maybe some day the "veterans" of this scene will be ready to acknowledge that an overhaul mod exists. But probably not, at least in this case.

This sounds quite rude and entitled, considering we (and Cheese especially) dedicate almost all of our free time to the modding community and to providing tools for everyone to make modding easier. I simply don't understand how you would come to the conclusion that by fixing the bug that you have reported, we're somehow acting against you, or not "acknowledging" your mod.

Link to comment
Share on other sites

  • 2 months later...

I have been unable to find the reference documents, so I'm missing key information:

Once I have dumped my text assets and identified a .json file and parameter within that file, how do I format a .patch file to change that parameter?  

If I want a patch to change the Ec generation rate in "generator_3V_thermoelectric_radioisotope.json", and address the  "ResourceSetting" "Rate" value, or change the "UseDecay" parameter to false?

If I want a patch to change the ISP range in "engine_3v_hydrogen_swerv.json" to something other than 320 to 1450, how do I address this specific value range?  This looks like it should be simple enough.

How does the patch file encode the .json file (as seen in the text asset dump) and specific parameter?  Without the wiki reference data I'm unsure how to get started.

Link to comment
Share on other sites

I've read a lot from the discord server, by trial and error have written a .patch file that does not upset the log.  While the patch 'should' change the capacity, starting charge, and charge rate for the 3.75M RTG, testing shows no effect at all.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...