Jump to content

Making a custom tech tree for follower


Recommended Posts

Hello, me again. I am making a custom character and i need help about making a custom tech three. Is it enough to just add

TUNING.PROTOTYPER_TREES.CUSTOM 

and how can i declare a level for it? Follower is in my character mod and it does not have any modmain for itself. And where should i put this? If its enough

if its in tuning.lua 

i should just add

PROTOTYPER_TREES =

{ CUSTOM = TechTree.Create ({

SCIENCE = x,

MAGIC = z,

})}

Link to comment
Share on other sites

Do you want to make a custom tech tree so that your follower can be crafted from this one or do you want your follower to be like a crafting station but just for your custom tech tree?

I made a mod with a custom tech tree, I think I only used this to make it:

--modmain
local _G = GLOBAL
local require = _G.require
local TUNING = _G.TUNING
local TechTree = require("techtree")
table.insert(TechTree.AVAILABLE_TECH, "CUSTOM_TECH")

_G.TECH.NONE.CUSTOM_TECH = 0
_G.TECH.CUSTOM_TECH_ONE = {CUSTOM_TECH = 1}

for k, v in pairs(TUNING.PROTOTYPER_TREES) do
	v.CUSTOM_TECH = 0
end

TUNING.PROTOTYPER_TREES.CUSTOM_TECH = TechTree.Create({CUSTOM_TECH = 1})

for i, v in pairs(_G.AllRecipes) do
	if v.level.CUSTOM_TECH == nil then
		v.level.CUSTOM_TECH = 0
	end
end

STRINGS.TABS.CUSTOM_TECH = "Custom Tech Tree"

I'm mot sure if all of it is needed, but it worked for me. Replace CUSTOM_TECH with the name of the your custom tech tree. You can then add it as a requirement for craftings and/or add the prototyper component to something to make you able to craft it.

--recipe
local test = AddRecipe("flint", 
{ 	Ingredient("butterfly", 3 ), 
	Ingredient("petals", 12),
	Ingredient("rope", 5)}, 
	RECIPETABS.FARM, 
	TECH.CUSTOM_TECH_ONE)

--prefab file in the fn()

inst:AddComponent("prototyper")
inst.components.prototyper.trees = TUNING.PROTOTYPER_TREES.CUSTOM_TECH_ONE

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

3 hours ago, Monti18 said:

Do you want to make a custom tech tree so that your follower can be crafted from this one or do you want your follower to be like a crafting station but just for your custom tech tree?

yes i want to make it a crafting station just for my custom items. But my follower does not have any modmain for itself. Its in my character mod and im not sure if i can make a modmain for it? Is there any other way to do it? Or can i just add those in my characters modmain? 

Link to comment
Share on other sites

On 9/13/2021 at 5:31 PM, Monti18 said:

TUNING.PROTOTYPER_TREES.CUSTOM_TECH = TechTree.Create({CUSTOM_TECH = 1})

If im not wrong this is the part that we add custom tech levels. And if i want to add more levels like 2,3... i just need to copy and paste this and change number? But im not sure about that since it will be all same name it will override itself or it will just not work or crush. So how i can add more levels for this part

 

On 9/13/2021 at 5:31 PM, Monti18 said:

_G.TECH.CUSTOM_TECH_ONE = {CUSTOM_TECH = 1}

But we also have this part and this must be the defination of number like if it ask for TECH_one then the game will know it need CUSTOM_TECH to be higher than 1 and if i also want to add more levels i just need to add more and change "one" with numbers.

Right?

Link to comment
Share on other sites

Yes I think for adding more levels, you can do it like you wrote:

TUNING.PROTOTYPER_TREES.CUSTOM_TECH = TechTree.Create({CUSTOM_TECH = 2})
--and
_G.TECH.CUSTOM_TECH_TWO = {CUSTOM_TECH = 2}

for example to have a second level in this tech tree.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

6 minutes ago, Monti18 said:

Yes I think for adding more levels, you can do it like you wrote:


TUNING.PROTOTYPER_TREES.CUSTOM_TECH = TechTree.Create({CUSTOM_TECH = 2})
--and
_G.TECH.CUSTOM_TECH_TWO = {CUSTOM_TECH = 2}

for example to have a second level in this tech tree.

thanks for everything

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...