KSP2Community / PatchManager

A mod for generic patching needs similar to KSP 1's Module Manager.
https://ksp2community.github.io/PatchManagerDocs/
MIT License
5 stars 5 forks source link

unable to patch resource recipes #29

Closed ghost closed 10 months ago

ghost commented 10 months ago

resources work as expected, but recipes can't be accessed

:resources #Methalox {
    displayNameKey: "Resource/DisplayName/Methane";
}
:resources #Oxidizer {
    displayNameKey: "Resource/DisplayName/Methane";
}
[Info   :   Console] Patching resources:methalox
[Info   :   Console] Field does not exist :3
[Info   :   Console] Patched resources:methalox with 1 patches. Total: 157
...
[Info   :   Console] Patching resources:Oxidizer
[Info   :   Console] Patched resources:Oxidizer with 1 patches. Total: 158

using :resources .recipe { ... } has the same result

cheese3660 commented 10 months ago

Could you hand me the cached Methalox json file in the patch manager cache?

cheese3660 commented 10 months ago

Scratch that, I see the issue

ghost commented 10 months ago

thanks

is this the recommended way to patch the ingredients list, using indexes instead of names?

@use "builtin:dictionary";
:resources #Methalox {
    ingredients[0]: $value:set(unitsPerRecipeUnit,0.5);
}

i tried the name lookups solution that worked for :parts > requiredResources but it doesn't seem to apply here

:resources #Methalox {
    * > ingredients > .Methane { unitsPerRecipeUnit: 0.5; }
}
cheese3660 commented 10 months ago
:resources #Methalox > #methane {
}
cheese3660 commented 10 months ago

Though i may have gotten the capitalization wrong

ghost commented 10 months ago

yep thats great

lastly, how can we add a new recipe? as the isRecipe flag is above the data object in the addressables and this seems to be a different class, im unsure how to define that inside :resources

cheese3660 commented 10 months ago

yep thats great

lastly, how can we add a new recipe? as the isRecipe flag is above the data object in the addressables and this seems to be a different class, im unsure how to define that inside :resources

@new("RecipeName",true)
:resources {
}

The resource generator takes an optional isRecipe parameter

ghost commented 10 months ago

ok got it ty