Jump to content

Forcing traps at world regen will disable some event items. Why? Please look at the code.


Recommended Posts

The Hallowed night, pumpkins, does not spawn around the portal if I force traps to spawn. I used this code below but I imagine there must be a new code that could work... Anyone willing to change this code into something that would not disable the start pumpkins? I imagine there could be even more event items that would not spawn...

---------------------

local Layouts = GLOBAL.require("map/layouts").Layouts
local StaticLayout = GLOBAL.require("map/static_layout")

Layouts["spider_forest"] = StaticLayout.Get("map/static_layouts/spider_forest")

local task_forest = {"Squeltch","Lots-o-Spiders","Spider Queendom","Sanity-Blocked Spider Queendom", "Forest hunters"}

AddSetPiecePreInitAny = function(name, count, tasks)
    AddLevelPreInitAny(function(level)
    
        if level.location ~= "forest" then
            return
        end

        if not level.set_pieces then
            level.set_pieces = {}
        end
        level.set_pieces[name] = { count = count, tasks = tasks }
    end)
end

AddSetPiecePreInitAny("spider_forest",1,task_forest)
 

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