Im wanting to check a players TechTreeData.PlayerHasPathForUnlock outside of the Workbench
The hook CanUnlockTechTreeNodePath requires the TechTreeData object to be passed in
and I can find no reference to TechTreeData in a player property or anywhere outside of Workbench and the TechTreeData class in oxide.csharp
How can I check in on a players tech tree path manually?
Access a players TechTreeData
Simple and effective way would be to spawn a workbench with networking disabled, save a reference to the tech tree in plugin memory, then delete the workbench.
Thanks, I'll give it a try!
Regarding the tech tree and research table, are the UI values really hard coded?
I'm quite new to the way Rust modding works, but I can see the various tech tree UI objects, WorkbenchPanel and ResearchTablePanel are exposed. Is it possible to push new values to the UI via these or other objects exposed during canMoveItem or the like?
Yes, it's hard coded. The reason for that is that it would have been totally unnecessary and wasteful to network them when there was no need to in vanilla, hence server side mods cannot control it. Those classes may exist in the decompiler, but they won't have any instances or do anything on the server. The reason they show up at all is due to code sharing between the client and server.
Thanks for the help, I have it working now =D
Its probably not very performance friendly as every time its checked it must string compare the node.groupName and retrieve the .itemDef.GetInstanceID() in a foreach loop. But it does the thing!
Disapointing about the lack of control over the UI, is this expected to change? Has anyone put a request in to Facepunch?
It seems like an obvious thing you should be able to do, I initially expected the "Can" routines to be fired when an item is dropped in the Research Table or an Icon is clicked in the Tech Tree. Would you consider this the ideal behaviour for Facepunch to impliment?
Steinbeuge
Thanks for the help, I have it working now =D
Its probably not very performance friendly as every time its checked it must string compare the node.groupName and retrieve the .itemDef.GetInstanceID() in a foreach loop. But it does the thing!
Disapointing about the lack of control over the UI, is this expected to change? Has anyone put a request in to Facepunch?
It seems like an obvious thing you should be able to do, I initially expected the "Can" routines to be fired when an item is dropped in the Research Table or an Icon is clicked in the Tech Tree. Would you consider this the ideal behaviour for Facepunch to impliment?
My guess is they wont see the necessity of one player being able to check another players progression through the tech tree(s)