Using Phase Completion For Recipe Unlock
I have two recipes I want to unlock / become visible when Phase 5 of the Space Elevator is completed, but despite my best efforts I am a bit lost on how to make this work. I've done as much digging for info as I could and found discussions on how to unlock recipes with tiers and vanilla milestones, but nothing on phases. Is this possible, and if it is, how can I go about it?
10 Replies
could you elaborate on why the recipes are given with the phase and not with a milestone or research? requiring the user to go and do something to unlock a recipe helps them realize they actually have it available (otherwise they have to find it by chance in the machine or codex), and helps them track down what actually gave it to them later if they want to
that being said, I think the Game Phase Manage has an event you can bind to on phase change
but you will also have to check on save load if it needs to be granted, because they could have unlocked the phase before the mod was installed, or unlocked it externally
a mod subsystem is a pretty convenient place to do all that
Most of the recipes in my mod are unlocked via Milestones, but I made custom recipes of the Golden Cup and Golden Factory Cart, which I want unlocked upon Phase 5 completion (the same time they are unlocked in vanilla for the Awesome Shop).
To be honest though, the things you mentioned sound more complex than what I usually deal with, so I'm not sure it would be worth adding the complexity to the mod just to have two golden item recipes work the way I imagined it :LUL: . It would be different if most of the mod relied on that function, but I'm not sure it's worth it for two recipes. Either way, thanks for the detailed reply.
sounds like you could avoid the complexity + communicate the recipe's existence by having it be an awesome shop purchase, either for free or 1 coupon or something
what does the golden cup's awesome shop schematic have as its dependencies? you could probably use the same thing for yours
doesn't the golden cart already have a recipe?
The golden cart is unlocked after sinking a golden cup which IIRC is granted through some schematic. Maybe try finding the dependents for the vanilla golden cart recipe
there is an availability dependency called phase completed. you can lock things behind phases with it
Are you talking about this?

that looks promising
yes
Thanks for all the input here. I'm going to experiment with some different options and see what works best; I'll update this post when I've figured something out.
Update: I've done all I can but I can't get my golden cup recipe to show up when it is set to unlock at Phase 5. I was able to verify that the "Victory!" phase codename is in fact Phase 5 by looking at the vanilla game files, so using the BP Game Phase Reached Dependency, I set up the schematic exactly as seen in the screenshot above. Loaded a save game that was already at Phase 5, nothing. Made a new game at Phase 4 and manually progressed to Phase 5 (in case the game wasn't checking to see if it was already unlocked in my first test) and... nothing.
And yes, in the schematic I also have M Unlocks set to BP Unlock Recipe with my recipe selected and the cost left blank. I tried changing M Type (the type of schematic) between "Custom" and "Alternate", which were the only ones that made sense for this, but neither worked.
Looking at the vanilla game files more, I found the ResourceSink_GoldenCart_Unlock and ResourceSink_GoldenCart blueprints. While the latter BP does unlock the Golden Cart recipe, it itself depends on the "unlock" BP and this one is almost completely blank. It does not have any dependencies, costs or unlocks listed, and since this is responsible for unlocking the Golden Cart recipe, my guess is there must be some code that is actually doing the unlocking, since this "unlock" schematic is not doing it.
Given my limited knowledge of this, it would appear the best way to do what I wanted to do would probably be to use a mod subsystem as Robb initially suggested, however I won't be doing that for simplicity sake. Before this, my Golden Cup and Golden Factory Cart recipes were unlocked via a Tier 9 milestone, which is part of Phase 4 and worked well, so I will just go back to using that :ficsitlogo:
it itself depends on the "unlock" BP and this one is almost completely blankif you mean the phase reached dependency, it will be a placeholder/stub, so it will never have any code in our editors. search the docs for "placeholder system" for more info