Jump to content

Start with science tab and can't use magic tab


Recommended Posts

Oh, i can help in this :razz:

You need put this in your character prefabs.

 

For science!

inst.components.builder.science_bonus = (number) 

Make you character know the...

Science Machine crafts put an 1

Alchemy Engine crafts put an 2

 

For uninplemented ruins! *laughts*

inst.components.builder.ancient_bonus = 4

 

I will try get magic later, i don't know how can do.

I tried without results :/

Edited by Neutral_Steve
Link to comment
Share on other sites

Oh, i can help in this :razz:

You need put this in your character prefabs.

 

For science!

inst.components.builder.science_bonus = (number) 

Make you character know the...

Science Machine crafts put an 1

Alchemy Engine crafts put an 2

 

For uninplemented ruins! *laughts*

inst.components.builder.ancient_bonus = 4

 

I will try get magic later, i don't know how can do.

I tried without results :/

 

cool cool thank you! Ill try it soon :D

Link to comment
Share on other sites

Oh, i can help in this :razz:

You need put this in your character prefabs.

 

For science!

inst.components.builder.science_bonus = (number) 

Make you character know the...

Science Machine crafts put an 1

Alchemy Engine crafts put an 2

 

For uninplemented ruins! *laughts*

inst.components.builder.ancient_bonus = 4

 

I will try get magic later, i don't know how can do.

I tried without results :/

 

 

Now its like wickerbottom. That I have figurit out before ^^ but that is ok.

I mean, only the tab of science. Not the thinks you can craft with science machine.

Link to comment
Share on other sites

Now its like wickerbottom. That I have figurit out before ^^ but that is ok.

I mean, only the tab of science. Not the thinks you can craft with science machine.

I will try later make again the "never know the magic" tab. If i get with succes i will post it.

:eagerness:

Link to comment
Share on other sites

I will try later make again the "never know the magic" tab. If i get with succes i will post it.

:eagerness:

 

I found this in a DS mod (wolfram), but it doesn't work in DST:

error: variable "GetRecipe" is not declared

 

 

 

local function builderpostinit(inst)

        

    -- Save the UnlockRecipe function

    inst.UnlockRecipePre = inst.UnlockRecipe

    -- Tweak the class function, but then call the original function

    inst.UnlockRecipe = function(self,recname)

        local recipe = GLOBAL.GetRecipe(recname)

        local player = GLOBAL.GetPlayer()

        

        if recipe and recipe.level and (recipe.level.MAGIC > 0 or recipe.level.ANCIENT > 0) and player and player.prefab == "wolfram" then

            print("Don't unlock!")

            return

        else

            print("Unlocked")

            self:UnlockRecipePre(recname)

        end

    end

end

-- Add leader function overrides

AddComponentPostInit("builder", builderpostinit)

 

Edited by EulenMarie
Link to comment
Share on other sites

@EulenMarie:

-- in the prefab.lua file of the characterlocal function replicaMagicAway(inst)	local builder = inst.replica.builder	local _CanLearn = builder.CanLearn	builder.CanLearn = function(self, recname)		local ret = _CanLearn(self, recname)		local recipe = GetValidRecipe(recname)		return ret and self.classified and (recipe.tab ~= RECIPETABS.MAGIC or self.classified.isfreebuildmode:value())	endendlocal function componentMagicAway(inst)	local builder = inst.components.builder	local _CanLearn = builder.CanLearn	builder.CanLearn = function(self, recname)		local ret = _CanLearn(self, recname)		local recipe = GetValidRecipe(recname)		return ret and (recipe.tab ~= RECIPETABS.MAGIC or self.freebuildmode)	endendlocal function OnNewSpawn(inst)	local builder = inst.components.builder	for k, v in pairs(AllRecipes) do		if v.tab == RECIPETABS.SCIENCE then			builder:UnlockRecipe(k)		end	endend-- inside common_postinit	if not TheNet:GetIsServer() then		local _OER = inst.OnEntityReplicated		inst.OnEntityReplicated = function(inst)			if _OER then				_OER(inst)			end			replicaMagicAway(inst)		end	end-- inside master_postinit	componentMagicAway(inst)	inst.OnNewSpawn = OnNewSpawn
Link to comment
Share on other sites

 

@EulenMarie:

-- in the prefab.lua file of the characterlocal function replicaMagicAway(inst)	local builder = inst.replica.builder	local _CanLearn = builder.CanLearn	builder.CanLearn = function(self, recname)		local ret = _CanLearn(self, recname)		local recipe = GetValidRecipe(recname)		return ret and self.classified and (recipe.tab ~= RECIPETABS.MAGIC or self.classified.isfreebuildmode:value())	endendlocal function componentMagicAway(inst)	local builder = inst.components.builder	local _CanLearn = builder.CanLearn	builder.CanLearn = function(self, recname)		local ret = _CanLearn(self, recname)		local recipe = GetValidRecipe(recname)		return ret and (recipe.tab ~= RECIPETABS.MAGIC or self.freebuildmode)	endendlocal function OnNewSpawn(inst)	local builder = inst.components.builder	for k, v in pairs(AllRecipes) do		if v.tab == RECIPETABS.SCIENCE then			builder:UnlockRecipe(k)		end	endend-- inside common_postinit	if not TheNet:GetIsServer() then		local _OER = inst.OnEntityReplicated		inst.OnEntityReplicated = function(inst)			if _OER then				_OER(inst)			end			replicaMagicAway(inst)		end	end-- inside master_postinit	componentMagicAway(inst)	inst.OnNewSpawn = OnNewSpawn

Ignore my last private message.

I have it fix, it works I guess :D Thank you!

 

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