Is there a way to make a recipe unlock when a existing research node is completed
Refer to this to catch up on the issue I have, and before any says check the example mod file... It isn't there.
6 Replies
You may need to edit the existing node to add the recipe you wish for it to unlock
Edit the CDO (Class Default Object) of the existing research node to add your recipe to its unlocks list: https://docs-dev.ficsit.app/satisfactory-modding/latest/Development/BeginnersGuide/overwriting.html#_use_cdo_manipulation
A CDO edit consists of some code (e.g. blueprints, C++) to change values on existing stuff at runtime. To add recipes to a schematic, you need to:
1. Get the Class Default Object of the schematic class
2. Read the
M Unlocks
variable from the CDO
3. Get index 0 of the M Unlocks
variable and cast it to FGUnlockRecipe
4. Get the M Recipes
variable from the unlock you just casted
5. Add your own recipes to M Recipes
If you cannot read these variables directly from the CDO, you need to use Access Transformers to make the fields accessible: https://docs-dev.ficsit.app/satisfactory-modding/latest/Development/ModLoader/AccessTransformers.html
Also, you should store the CDO in a new variable so that it remains in memory, you can do this in step 1 and use the variable from there on.
ExampleMod recently got an example of a CDO edit, I haven't looked at it yet though.you need to update your starter project to the
dev
branch to get the filethis is when it was added
to update your starter project follow the directions here https://docs.ficsit.app/satisfactory-modding/latest/Development/UpdatingToNewVersions.html#_preparing_to_update_your_starter_project
@Faraway is this still an issue?
I got something down