Jump to content

[0.25] ATC - Alternative Tree Configurator [15.10. - V0.5.1]


SirJodelstein

Recommended Posts

Edit: sometime tonight I'm going to go ahead and put in a pull request to add a factory class to generate RDNodes, so that the crazier code can be abstracted out of the main bulk of the code.

Wouldn't it be best to see if you can get something working before trying to impose structure on a code base you don't have any code in? :)

Don't get me wrong, I'm all for getting add-node functionality in, and if it does go in, I'd certainly support isolating the code in the process. However, I don't think submitting changes that only affect internal structure serves any purpose, other than creating additional overhead for SirJodelstein in having to review the changes, and for anyone else who actively follows the code base to keep up to date on what's happening...like me ;)

Edited by FlowerChild
Link to comment
Share on other sites

Wouldn't it be best to see if you can get something working before trying to impose structure on a code base you don't have any code in? :)

Don't get me wrong, I'm all for getting add-node functionality in, and if it does go in, I'd certainly support isolating the code in the process. However, I don't think submitting changes that only affect internal structure serves any purpose, other than creating additional overhead for SirJodelstein in having to review the changes, and for anyone else who actively follows the code base to keep up to date on what's happening...like me ;)

That was under the assumption that it actually created and inserted nodes correctly. Either way, it's a good idea to get code spread out into specialized classes instead of a single monolithic one. Helps with debugging and maintenance. But all that aside, it's a pull request for a reason. Dun have to accept and integrate it if you don't want to.

Link to comment
Share on other sites

Either way, it's a good idea to get code spread out into specialized classes instead of a single monolithic one.

Sure, BUT:

-The project doesn't contain very much code right now at all. Yes, it would be nice if the dead code were cleaned up and/or isolated, but there's not enough code in total to make it a big deal.

-Restrucuring a code base that you don't have any code in is at best...rather odd. Again, doesn't serve any practical purpose, and you're currently an unknown commodity. The people that are already working on it know where everything is at present.

If you're going to contribute functioning code at the same time, I'm all for it man. However, your original statement on it seemed to suggest you're just restructuring things in preparation for *attempting* to get something functional going, and at that point, why would you even bother SirJodelstein with a pull request? Inevitably, somebody is going to have to look at your request and what it contains in order to answer the question of whether it should be committed to the main branch, and that takes time.

Link to comment
Share on other sites

Sure, BUT:

-The project doesn't contain very much code right now at all. Yes, it would be nice if the dead code were cleaned up and/or isolated, but there's not enough code in total to make it a big deal.

-Restrucuring a code base that you don't have any code in is at best...rather odd. Again, doesn't serve any practical purpose, and you're currently an unknown commodity. The people that are already working on it know where everything is at present.

If you're going to contribute functioning code at the same time, I'm all for it man. However, your original statement on it seemed to suggest you're just restructuring things in preparation for *attempting* to get something functional going, and at that point, why would you even bother SirJodelstein with a pull request? Inevitably, somebody is going to have to look at your request and what it contains in order to answer the question of whether it should be committed to the main branch, and that takes time.

As of right now, I haven't exactly restructured anything, as I'm not removing anything. Leaving that up to y'all. Just adding a class that can produce a node, that's it. And again, the pull request is dependent on me getting it working.

Edit: ok, yeah, haven't gotten it working yet. Did find some interesting tidbits, though. Creating the prefab using the constructor with the Type params, as well as attaching components after the fact with the generic version of the method was showing an exception, but when I used the string version of AddComponent, it doesn't complain (and it still creates the node and tech). So I can create the prefab and generate new nodes from that, but I'm still trying to work with what's going on after that.

Edited by Ixonal
Link to comment
Share on other sites

Just checked in some changes adding functionality for easily removing stock nodes with ModuleManager commands like:


!TECH_NODE[node6_largeControl]
{
}

or, if you're making your own tree from scratch, by simply omitting a node from the .cfg files entirely.

It was possible to remove nodes before, but the .cfg file syntax was getting rather messy, like this snippet from my own config files:


@TECH_NODE[node6_largeControl]
{
// delete this node

@hideIfNoparts = True

// move it out of the way to the right of the visiable area in case there are any lingering purchased parts within
@posX = 500

!PARENT_NODE[*],*
{
}
}

// delete all references to large control
@TECH_NODE[*],*
{
!PARENT_NODE[node6_largeControl]
{
}
}

Which is now all replaced by the simple !TECH_NODE thing above. All references to this node whether it be within part configs or other tech nodes (as in, specifying the deleted node as a parent) are automatically removed with that one statement for convenience, and because it fits the way other stock .cfg files work.

Put another way: if a node is not defined within the config file for a tree, it will not appear in game. The !TECH_NODE is only required if you're removing it from an existing tree, like the stock one.

Edited by FlowerChild
Link to comment
Share on other sites

@Adding new nodes: Ixo, just go ahead with this. If you can get node creation working (preferrably in a separate class, and without restructuring too much of the existing active code), I'll be happy to help you integrate this. Any knowledge we can gather from your experiments might help. ATM, i think the "createNode" function should be called from "LoadTree()" in line 176 where the warning "Could not find RDNode" is issued currently, and after that the updateNode function should be able to modify the new node like the stock ones.

@FC: Nice addition, thanks!

@all: Sneak peak for "TinkerTech 2", my complete techtree overhaul based on ATC:

jKkTHP9.png

playtestable version coming soonTM

Link to comment
Share on other sites

Could you maybe update the OP with new version numbers (and maybe a changelog) or even better put the version in the thread title when you update? Makes it easier than reading through a page or two to look for updates, or having to download and see. Yes I know the mod tells me there's an update available, but only AFTER the game is started. I try to keep things updated as mods update, to save me troubles.

Link to comment
Share on other sites

Could you maybe update the OP with new version numbers (and maybe a changelog) or even better put the version in the thread title when you update? Makes it easier than reading through a page or two to look for updates, or having to download and see. Yes I know the mod tells me there's an update available, but only AFTER the game is started. I try to keep things updated as mods update, to save me troubles.

Yeah, I definitely second this. It's pretty standard practice for mod threads to list version number and release date in the thread title, plus I tend to disable any mods that access the net immediately, the version checker included, so I don't get the version update notifications anyways.

I was actually a little surprised when the version checker was included in ATC given one of the advantages it offers over TreeLoader is not accessing the web :)

Edited by FlowerChild
Link to comment
Share on other sites

Could you maybe update the OP with new version numbers (and maybe a changelog) or even better put the version in the thread title when you update?

Done, I've been wanting to do that anyway :)

Has anyone released a tech tree? I can't wait to use this :)

Patience, Padawan. As soon as i get a part model for a science camera, a first version of my techtree overhaul will be released.

0VIIsks.png

Link to comment
Share on other sites

@Adding new nodes: Ixo, just go ahead with this. If you can get node creation working (preferrably in a separate class, and without restructuring too much of the existing active code), I'll be happy to help you integrate this. Any knowledge we can gather from your experiments might help. ATM, i think the "createNode" function should be called from "LoadTree()" in line 176 where the warning "Could not find RDNode" is issued currently, and after that the updateNode function should be able to modify the new node like the stock ones.

Yeah, I found that and got it plugged in and created a config to add a new tech. I have the code to generate the new node in a separate singleton class, but, as I said, i'm not removing anything from the main class. Thinking tonight I'm going to use reflection to tear into the guts of these nodes and see if I can come up with why there are null reference exceptions...

Link to comment
Share on other sites

I'm getting this exception on trying to run setup on the new node. I can see there are many properties that are null, but not sure which one(s) in particular may be the culprit. Anybody else know what should be initialized for arrows to be shown?


NullReferenceException: Object reference not set to an instance of an object
at RDNode.Setup () [0x00000] in <filename unknown>:0

at RDNode.DrawArrow (UnityEngine.Material mat) [0x00000] in <filename unknown>:0

at RDNode.ShowArrows (Boolean show, UnityEngine.Material mat, .Parent[] list) [0x00000] in <filename unknown>:0

at RDNode.InitializeArrows () [0x00000] in <filename unknown>:0

at RDNode.Setup () [0x00000] in <filename unknown>:0

at RDNode.Start () [0x00000] in <filename unknown>:0

Edit: Also, here's what I've learned about the object from using reflection

Edit 2: aaaaaand if you're curious, here's another level deeper:

Edit 3: whoopsie!

Edited by Ixonal
Link to comment
Share on other sites

I just released a version of Better Than Manned which uses ATC extensively to modify the tech tree and planet science values. As such, the related config file (BTSMTechTreeMods.cfg) may act as a decent reference for anyone that's wanting to use ATC to modify the tree.

BTSM can be found here if you want to check it out:

BTSM Thread Link

Link to comment
Share on other sites

I created a config restructuring and reconfiguring the Stock Tech Tree using your mod. Thought i share the link here, too.

http://forum.kerbalspaceprogram.com/threads/94220-T-7-Technology-a-reconfigured-more-flexible-and-beleivable-StockTechTree?p=1425439#post1425439

Nice, will check that out.

Also, I have just released TinkerTech - The crazy contraption techtree. My version of the tech tree with NEAR/DRE/TACLS, custom biomes and lots of ugly flying things :)

Link to comment
Share on other sites

ok, so I've got it running through, apparently adding the node, but there's nothing in the tech tree... no errors (at least that it's showing), but it's just not there...

Edit: scratch that, it started throwing exceptions again...

Edit2: Oh, this is interesting... when I set parents for the new node to be an array of length 0, there are no exceptions, but there's a null reference exception if I set it to an array with any length.

Edit3: In thinking about it, that makes sense. All elements of an array are instantiated to default for that type at initialization, so a foreach without a null check would still make that sorta issue... back to having no exceptions, but no new nodes showing up.

Edit 4: Ended up pulling a little bit more information out with reflection, but still no clue why the nodes aren't appearing...

Edit 5: I created a fork and updated to my current version here. Currently it's having an exception when trying to draw arrows, so it may be an issue with the new node's graphics property.

Edit 6: whoopsie!

Edited by Ixonal
Link to comment
Share on other sites

Edit 5: I created a fork and updated to my current version here. Currently it's having an exception when trying to draw arrows, so it may be an issue with the new node's graphics property.

You don't appear to have based that off the most recent version of TechChanger.cs. That makes reviewing what's changed rather difficult as it's mixed in with a bunch of changes that have been made since.

Link to comment
Share on other sites

I've made a quick modulemanager config that doesn't do anything but is a template for every stock part, putting them in the node they are currently in. Here's a few example lines, all the parts that start with "A":


@PART[adapterLargeSmallBi] { @TechRequired = metaMaterials } // TVR-200L Stack Bi-Adapter
@PART[adapterLargeSmallQuad] { @TechRequired = metaMaterials } // TVR-400L Stack Quad-Adapter
@PART[adapterLargeSmallTri] { @TechRequired = metaMaterials } // TVR-300L Stack Tri-Adapter
@PART[adapterSmallMiniShort] { @TechRequired = specializedConstruction } // FL-A5 Adapter
@PART[adapterSmallMiniTall] { @TechRequired = specializedConstruction } // FL-A10 Adapter
@PART[advancedCanard] { @TechRequired = hypersonicFlight } // Advanced Canard
@PART[advSasModule] { @TechRequired = advFlightControl } // Inline Advanced Stabilizer
@PART[Ailerons] { @TechRequired = aerodynamicSystems } // Standard Control Surface
@PART[airplaneTail] { @TechRequired = aerodynamicSystems } // Tail Connector
@PART[airScoop] { @TechRequired = aerodynamicSystems } // XM-G50 Radial Air Intake
@PART[asasmodule1-2] { @TechRequired = specializedControl } // Advanced S.A.S Module, Large
@PART[avionicsNoseCone] { @TechRequired = advScienceTech } // Sensor Array Computing Nose Cone

Here's a link to the config file.

EDIT: There were a few bugs in the original file and it didn't include the part names for easy reference. I've fixed both of those things.

Edited by 5thHorseman
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...