Search the Community
Showing results for tags 'unique'.
Found 1 result
-
I am trying to create a set piece that only generates once. Have I have right now generates it correctly but there more than one. --import some needed stuff local Layouts = GLOBAL.require("map/layouts").Layouts --this is where we add the setpiece local StaticLayout = GLOBAL.require("map/static_layout") --this helps us load the setpiece Layouts["surface_lightbulb_fissure"] = StaticLayout.Get("map/static_layouts/surface_lightbulb_fissure") --index your setpiece AddRoomPreInit("Forest", function(room) --"Forest" is the biotope in this case if not room.contents.countstaticlayouts then room.contents.countstaticlayouts = {} end room.contents.countstaticlayouts["surface_lightbulb_fissure"] = 1 --add one end) The code above is based on the set piece tutorial from http://dontstarveapi.com/tutorials/creating-your-first-mod/setpiece/ Also I tried looking into how pig king or the lunar island's alter pieces are spawned but I don't really get it. :l Edit:Nvm it's on the 2nd post for the tutorial forum post. Solution: AddLevelPreInitAny(function(level) if level.location ~= "forest" then -- only in overworld return end if level.required_setpieces == nil then -- if required_setpieces does not exist already, create it level.required_setpieces = {} end table.insert(level.required_setpieces, "surface_lightbulb_fissure") end)