Doctor Donna Posted September 2, 2015 Share Posted September 2, 2015 Hey Guys! Another Question: What is the code for "starting with science tab" and "can't use magic tab"?And where I must add this? Anobody an idea? Greeetings Marie Link to comment Share on other sites More sharing options...
Neu7ral Posted September 3, 2015 Share Posted September 3, 2015 (edited) Oh, i can help in this 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 1Alchemy 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 September 3, 2015 by Neutral_Steve Link to comment Share on other sites More sharing options...
Doctor Donna Posted September 3, 2015 Author Share Posted September 3, 2015 Oh, i can help in this 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 1Alchemy 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 Link to comment Share on other sites More sharing options...
Doctor Donna Posted September 3, 2015 Author Share Posted September 3, 2015 Oh, i can help in this 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 1Alchemy 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 More sharing options...
Neu7ral Posted September 3, 2015 Share Posted September 3, 2015 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. Link to comment Share on other sites More sharing options...
Doctor Donna Posted September 3, 2015 Author Share Posted September 3, 2015 I will try later make again the "never know the magic" tab. If i get with succes i will post it. cool thank you! Link to comment Share on other sites More sharing options...
Doctor Donna Posted September 3, 2015 Author Share Posted September 3, 2015 (edited) I will try later make again the "never know the magic" tab. If i get with succes i will post it. 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 endend-- Add leader function overridesAddComponentPostInit("builder", builderpostinit) Edited September 3, 2015 by EulenMarie Link to comment Share on other sites More sharing options...
DarkXero Posted September 4, 2015 Share Posted September 4, 2015 @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 More sharing options...
Doctor Donna Posted September 4, 2015 Author Share Posted September 4, 2015 @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 = OnNewSpawnIgnore my last private message.I have it fix, it works I guess Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now