Jump to content

How to move a part to another point in the Tech Tree?


Recommended Posts

I have ModuleManager ofc. I have tried this:

@PART[solarPanels5]

{

TechRequired=start

entryCost=0

}

@PART[batteryPack]

{

TechRequired=start

entryCost=0

}

But to no avail. Please help :)

Edited by Sokar408
Link to comment
Share on other sites

I have ModuleManager ofc. I have tried this:

@PART[solarPanels5]

{

TechRequired=start

entryCost=0

}

@PART[batteryPack]

{

TechRequired=start

entryCost=0

}

But to no avail. Please help :)

Nevermind, it does work. I just had to remove the parts from the tree.cfg in my career save folder first.

Link to comment
Share on other sites

You got the syntax wrong.

You're currently telling ModuleManager: "Modify 'Part[solarpanels5]'. In it, create a new variable called 'TechRequired' and assign to it the value 'start'."

However, what you want to tell it is: "Modify 'Part[solarpanels5]'. In it, modify variable 'TechRequired'. Assign to it the value 'start'."

The same of course applies to 'entryCost'. So, your code should look like this:

@PART[solarPanels5]

{

@TechRequired = start

@entryCost = 0

}

(And do mind the spaces around the = sign, you want to assign a value and not declare a variable name that happens to include the sign.)

Finally, the correct place to ask this question would have been the ModuleManager thread in the addons subforum :P But I hope this helps anyway.

EDIT: The reason why it works anyway is because with the code you wrote, you now have two variables called "TechRequired" in the part definition, both of which are acted upon, and only the one read last actually sticks. It technically does what you need, but it is roughly like buying a new car because your current one ran out of fuel :P ModuleManager is a bit finnicky in this regard - sometimes it is very lax with its syntax requirements, but at other times getting even a single character wrong will cause major errors.

Edited by Streetwind
Link to comment
Share on other sites

I have module manager, but for some reason the following is not working:


@PART[solarPanels5]:Final
{
@TechRequired=start
@entryCost=0
}

I assume it has something to do with it already being placed, since when I delete it from the tree.cfg in my save file, the above does work. However I hate changing things like that, and would like to know if there is a way of doing that does not require me to customize several files :)

Link to comment
Share on other sites

Ah, you should have mentioned that you're running TreeLoader. :P

If you have a custom tree.cfg that specifies an explicit placement of a part in a node, that will always override anything you put into the part.cfg. This behavior is fully intended by TreeLoader. It allows mod authors to distribute their own tech tree with fixed assignments, but keep alternate, stock-compatible assignments in the individual part.cfg's for people who want to play the mod without the custom tech tree.

This means you'll have to work with the tree.cfg (which has the advantage of only requiring you to change a single file, as you want to) - or, modify that to not include any fixed assignments anymore. Then you will be able to use the values in the part.cfgs again. However, be careful what fixed assignments you remove, because you have to doublecheck each part that it still points where you want it to. And that's a lot of parts.

Link to comment
Share on other sites

Ah, you should have mentioned that you're running TreeLoader. :P

If you have a custom tree.cfg that specifies an explicit placement of a part in a node, that will always override anything you put into the part.cfg. This behavior is fully intended by TreeLoader. It allows mod authors to distribute their own tech tree with fixed assignments, but keep alternate, stock-compatible assignments in the individual part.cfg's for people who want to play the mod without the custom tech tree.

This means you'll have to work with the tree.cfg (which has the advantage of only requiring you to change a single file, as you want to) - or, modify that to not include any fixed assignments anymore. Then you will be able to use the values in the part.cfgs again. However, be careful what fixed assignments you remove, because you have to doublecheck each part that it still points where you want it to. And that's a lot of parts.

Damn but thanks for clearing that up :)

Oopsie. Duplicate threads have been merged.

My memory is so bad I couldn't remember if I actually made the post O.o Thanks for cleaning up after me :blush:

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...