ResearchTree doesn't unlock
Hey I made a research tree for my mod, it does unlock correctly in a new game
But if the Nutrients and the Mycelia trees are already finished before adding the mod, my tree stay unlocked
Solution:Jump to solution
I just tested it, and it works perfectly ! ❤️
The tree is unlocked and the nodes already researched on others tree are unlocked too (f.e. the Berry Node)...
24 Replies
Here's the unlock dependencies of the tree :
i also tried this
( even by harvesting one of each didn't unlocked the tree in an old game save, but worked completely fine in a new one )
this is a limitation of how the tree unlock system works; unlock status is only evaluated when something new is unlocked
you can work around it though; code something in a mod subsystem or game world mod module that checks on world load if the player should have the tree unlocked, and then unlock it for them manually
there might be a library function in the research or schematic manager you can call to make it recheck tree dependencies, not sure
might even be something we add to SML, since it's kinda a mods-only problem and affects every modded research tree
That's what I thought 😕
From the
GetResearchManager
node I found Are Schematic Dependencies Met
but I can't find something like recheck, unlock, refresh
https://discord.com/channels/555424930502541343/601030071221878784/1294385393243918450
Like Rex said i can add an unlock in the unlock list, i can try this
I can't find a way to add an unlock to this listcan you send context/screenshots of what you've tried?
Tried to toogle off and on the FGResearchManager to update it
Look for nodes I can find from the GetUnlockSubSys and the getResearchManagerSubSys
Look for nodes I can find from variables type FGUnlockSchematic, FGResearchTree and FGResearchTreeProgression
And try to find something in the palette
I found ClaimResearchResults but it didn't unlockedd my tree
I'd prefer to have something in SML to take care of this, yes
I also try to unregister, and reregister the tree
Also I changed my tree dependencies and it now unlock and unhide correctly but only if i make an other research from the MAM
:thistbh:
is there a way to unlock a hidden schematic to update the tree ?
:thistbh:
Game World Module ---> Begin Play On Lifecycle Event ---> switch on phase ---> Initialization ---> if dependencies are unlocked then unlock your tree
i can't find the way to unlock the tree
Also i can't find BeginPlay in the GameWorldModule so i use the BeginPlay of a ModSubsystem
Oh sorry, On Lifecycle event
i will try it rn
The tree isn't unlocked 😕
Not sure how the tree should be unlocked tbh, couldn't find anything about it :S
Is the behavior that unlock if criteria are met from RegisterResearchTree used by the GameWorldModule when the tree is in MResearchTrees
If so it might be broken
I'm not sure if stuff in mResearchTrees goes though that code path
Try out the fix that Rex opened as a PR on the SML repo
You can either pull that branch to check it out or make the same edit they did locally
Solution
I just tested it, and it works perfectly ! ❤️
The tree is unlocked and the nodes already researched on others tree are unlocked too (f.e. the Berry Node)
That's great news, given that I didn't even check if the PR builds :LUL: