Jump to content

Spawning in the right place


Recommended Posts

I was enjoying the weeping willow mod, and it still works mostly fine, but i was having an issue with a swamp biome containing the contents of the mod spawning in EVERY dimension. the main world where it should be, caves, ruins, and even shipwrecked.

i tried to fix it by altering some code, and now i have as follows. while i succeed in making it not spawn in caves and shipwrecked without crashing, it won't spawn in the main world either. i would appreciate some help.

 

AddTask("TheWeepingWillow", {
    locks={LOCKS.SPIDERDENS,LOCKS.TIER1},
    keys_given={KEYS.MEAT,KEYS.SILK,KEYS.SPIDERS,KEYS.TIER2},
    --locks=LOCKS.NONE,
    --keys_given=KEYS.NONE,
    room_choices={
        ["WeepingWillowRoom"] = 1,
        ["Sinkhole"] = 1,
        ["Marsh"] = 2+math.random(3), 
        ["Forest"] = math.random(3), 
        ["DeepForest"] = 1+math.random(3),
    },
    room_bg=GROUND.MARSH,
    background_room="BGMarsh",
    colour={r=.05,g=.05,b=.05,a=1}
}) 

GLOBAL.require("map/level")
local LEVELTYPE = GLOBAL.LEVELTYPE

local function AddTaskWeeping(level)
    table.insert(level.tasks, "TheWeepingWillow")
end

AddLevelPreInit("SURVIVAL_DEFAULT", AddTaskWeeping)

Link to comment
Share on other sites

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.

×
  • Create New...