Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

hectorzx

[Solved] Adding recipes to custom map

Recommended Posts

hectorzx    30

It is posible to add recipes only to a preset (level)?
 

The only function that i have found is:

 

AddLevelPreInit("MyPresetLevel", LevelInit)

local function LevelInit(level)

   ...

    Recipe("MY_receipe", {Ingredient("iron", 2), Ingredient("twigs", 1)}, RECIPETABS.ARCHAEOLOGY, TECH.SCIENCE_ONE)

 .....

end

But It is not working,It seems that you can only put in there code that alter the level generation?

Share this post


Link to post
Share on other sites
Ultroman    603

My guess is that recipes cannot be added before the recipe system has been added during the world creation. If it is possible to do a DoTaskInTime call, you can wrap your Recipe call in that, and delay it a few seconds until the world has been loaded.

Share this post


Link to post
Share on other sites
hectorzx    30

I actually found a way!!
 

function LoadRecipes(player)
    if GLOBAL.GetWorld().meta.level_id == "3in1" then

          -------Loaad recipes------

    end
end
AddSimPostInit(LoadRecipes)

 

Share this post


Link to post
Share on other sites