Jump to content

IC-Adel

Members
  • Posts

    7
  • Joined

  • Last visited

Reputation

8 Neutral
  1. Hi, for the JNSQ issue, some files are missing the dependency tag, to fix, add in the following files: AchievementTreeContracts-flag.cfg AchievementTreeContracts-landed.cfg AchievementTreeContracts-orbit.cfg For each +CONTRACT_TYPE[ProgessionorbitKerbin] //may say kerbin or moho You must add either of these tags at the end, depending on which space system they belong to :NEEDS[!JNSQ] //For Kerbin planets :NEEDS[JNSQ] //For JNSQ planets It should look something like this +CONTRACT_TYPE[ProgessionorbitKerbin]:NEEDS[!JNSQ] { @name = ProgressionorbitEve ... +CONTRACT_TYPE[ProgessionorbitKerbin]:NEEDS[JNSQ] { @name = ProgressionorbitJNSQAden ...
  2. Thank you. And will you look at that, I just realized your Achievement Tree would make my science unlocks more approachable, I might try it out.
  3. Background I've tried some of the general purpose tech trees before, CTT, SIMPLEX, Unkerballed Start, Probes Before Crew. They're all great but there's a few things that bother me: If you use a lot of parts mods, you'll end up unlocking waaay too many parts on each node, cluttering your editor, though this can be minimized with the categorization mods. For a noob like me doing their first run with mods, it's overwhelming. Unlocking parts too early that you don't have an use for yet, like a rover skid when the rover is unlocked 2 tiers later. This also means you'll be dragging useless parts until you go further in the tree. Spreading non-essential parts among several tiers. Like come on, why can I build a medium girder and I have to go do science to be able to build a slightly longer one. Mixing parts with different purposes that are marginally related. UKS was guilty of this, landing wheels were in the plane nodes and then the heavier ones were suddenly unlocked in the lander legs nodes. Focusing on unlocking dV and science parts. Some mods are better with this than others, but why spend 60 science on connectors why you can spend 60 science on more science-making parts. Now sure, I could just fork whichever tree mod I liked the most and fix what I wanted, but I found them hard to work with, partially due to the aforementioned reasons. There's also other tech trees that focus on gameplay balance or challenge, like RP-1 I think, but I just wanted to play my way. Either the tech trees are one-size-fits-all, or they have a strict gameplay objective. And so, I went to the drawing board and began working. Objectives Minimize unlocking of tech I don't intend to use yet Organize the parts in categories similar to how they're seen in the parts list Assign exclusive nodes for mods that add parts that are meant to be used together. Balance science unlocks following unmanned first parts. Technical Notes This isn't compatible with the stock tech tree, and will not support any other mod that isn't manually added. (all the unsupported parts are placed in the starting node and unlocked by default) Luckily, since I'm really lazy, I made a little python script that takes names from a CSV file and generates a tree from them, which means I can just edit it on Excel. It'll just generate placeholders with IDs and positioning, so node details still need to be manually added, but that means anyone can rearrange the tree VERY easily without having to edit node positions, which is bound to happen with such a large tree. Parents still need to be manually modified, but since it's category grouped, I hope I don't have to modify those as much. With this layout, I have a 35x66 grid to work with. Currently, I have slightly over 430 science nodes, the vast majority already populated with parts. I also toyed with the actual RD grid size, but the way KSP handles the zoom makes it snap back to the center everytime you zoom and I couldn't figure out how to override or disable that. Since parts are grouped by type, all the science parts are in a line, which I find little sense of unlocking with science. There are two ways around this: Tie science part unlocks to building levels (funds in a way). I already found how to do this, but I didn't want to deal with informing the player the various building levels things would get unlocked at. Tie science part unlocks to achievements (contracts). This is how it's currently implemented. Contracts can unlock tech, the way this works is that if you achieve a kerbin orbit, for example, a contract would get enabled in Mission Control. Completing the contract has no requirements and is completed in 1 second, unlocking the tech node. Help There are a few things I haven't yet decided how to implement and need ideas or advice on: There are a few mods like Feline Rover that have hybrid parts, like a drill attachment. I was thinking of simply making a small tree out of them and adding individual parent requirements, but I'm not sure if I even have the space to do so. Currently I have the "basic" parts in one node, and the hybrid parts in another one, I'm thinking they could be science tier-gated slightly higher than its equivalent components. What about support Bluedog Design Bureau? I considered it, but there are so many parts that are intended to use together, that I may need to bundle them up into a whole vessel node similar to rover systems and I'm still unsure about it. Same goes for Probes Plus, but feel free to suggest. MOAB is a tentative name, just because it's something big, feel free to suggest any alternate names. Pending work Add support for Universal Storage Compress Aero Tech nodes to save space Require Komplexity for more R&D building tiers Balance science unlocks Upload to a public repository Hide overlapping parent lines Remove placeholder icons Add descriptions Mod Support: (some may still require additional reorganization) Pending mods: PICS
  4. I'm trying to make a tech tree with all the science parts grouped in a couple of nodes, so unlocking them with science doesn't make a lot of sense to me, I thought I could use CustomBarnKit to have more building levels or just use Komplexity and tie the science parts to the R&D building level or something like that. I know ContractConfigurator can also unlock tech so that's another option, to tie them to contracts that autocomplete when you accept them, with requirements being achieved orbit, visited the Mun, etc., but I still want to put my code out here in case it helps anyone. You can say this is a solution to this question: Tying tech tree nodes to VAB level?, but I'd rather just enable the nodes, not outright unlock them if that's an option. I found here how to list the RDNodes and went on the ProtoRDNode route. Excuse my code, I've barely touched C# before so I'm sure it can be optimized. [KSPAddon(KSPAddon.Startup.SpaceCentre, false)] public class Hello : MonoBehaviour { public void Start() { // not sure what else to tie the update to, it should be whenever a building is upgraded RDController.OnRDTreeSpawn.Add(OnRDTreeSpawn); void OnRDTreeSpawn(RDController rd) { int rdLevel = 0; // get the current level of the RD facility, but we could use various building levels with various .cfg values if we wanted foreach (UpgradeableFacility facility in GameObject.FindObjectsOfType<UpgradeableFacility>()) { if (facility.name == "ResearchAndDevelopment") { rdLevel = facility.FacilityLevel; } } // this should get all the nodes from the tech tree config ConfigNode techConfigNode = ConfigNode.Load(KSPUtil.ApplicationRootPath + "GameData/ModuleManager.TechTree"); techConfigNode = techConfigNode.GetNode("TechTree"); foreach (ConfigNode rdConfigNode in techConfigNode.GetNodes("RDNode")) { // find the nodes in the config which have the rdTier custom value declared in the .cfg file if (!string.IsNullOrEmpty(rdConfigNode.GetValue("rdTier"))) { // need the id to match the config node to the actual tree node in-game String tieredNodeId = rdConfigNode.GetValue("id"); // then we iterate the in-game nodes for every tieredNodeId we find foreach (ProtoRDNode pnode in AssetBase.RnDTechTree.GetTreeNodes()) { if (pnode.tech.techID == tieredNodeId) { Debug.Log(pnode.tech.techID + " matches " + tieredNodeId); // only unlocking if our building level is greater or equals to the required tier in the .cfg file if (rdLevel >= Int16.Parse(rdConfigNode.GetValue("rdTier"))) { // This researches the actual node without user input and it works // but since my function is tied to tech tree load, RD building has to be closed and opened again to update // ResearchAndDevelopment.Instance.UnlockProtoTechNode(pnode.tech); pnode.tech.state = RDTech.State.Available; // This doesn't seem to work // some tech trees make permanent locked nodes for informational purposes by making them their own parent // getting rid of the parent node should make it available, but none of this works pnode.parents = null; rdConfigNode.RemoveNodes("Parent"); pnode.Save(rdConfigNode); } } }
  5. Thanks, that worked. It seems the size is controlled by RDController.Instance.gridArea.gridBackground.sizeDelta. Although I'm having trouble with the zoom, as it snaps to the center of the older sized grid, I guess the gridArea.scrollRect needs to be resized, too, or maybe it has something to do with gridArea CalculateSnapBounds(), CenterOfGrid() or Snap(). Setting the max and min zoom to 1 doesn't solve it, either, as the snap still gets called for any zoom input. Guess I'll have to do some more digging.
  6. Hi, I've been trying to modify the UI for the R&D screen (resizing the grid) but I'm having trouble using RDController, which I believe is what controls the screen. It seems like whenever I try to use it, it's not instantiated. Since R&D is part of SpaceCentre, I've tried with both of these game events: GameEvents.onGUIRnDComplexSpawn.Add(researchControl); GameEvents.onShowUI.Add(researchCanvas); void researchCanvas() { Debug.Log("researchCanvas " + Time.realtimeSinceStartup); if (RDController.Instance != null) { Debug.Log("ShowUI RDController " + Time.realtimeSinceStartup); } } void researchControl() { Debug.Log("resizeCanvas " + Time.realtimeSinceStartup); if (RDController.Instance != null) { Debug.Log("RnDComplexSpawn RDController " + Time.realtimeSinceStartup); } // This stuff works but I want RDController Debug.Log("Add 100 Science " + Time.realtimeSinceStartup); ResearchAndDevelopment.Instance.SetScience(100, TransactionReasons.None); Debug.Log(ResearchAndDevelopment.Instance.Science); Debug.Log("Scale " + UIMasterController.Instance.uiScale); } Looking at the console, RnDComplexSpawn runs before I get the message [UIMasterController]:ShowUI, so that's why I tried checking for onShowUI, but that still runs after ComplexSpawn and before the UIMasterController message. If I try using RDController in either of them, I get a nullReferenceException. Edit: Actually, I can see researchCanvas() running with an instanced RDController, but only when I exit the R&D building. Perhaps I have to wait for something else? I can use ResearchAndDevelopment, but that only has operations for the actual science and experiments. I can also reach UIMasterController, but can't see any way to use it to detect RDController.
×
×
  • Create New...