troltos Posted July 21, 2016 Share Posted July 21, 2016 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 More sharing options...
Mobbstar Posted July 21, 2016 Share Posted July 21, 2016 The following works to me: AddLevelPreInitAny(function(level) if GetTypeForLevelID(level.id) == LEVELTYPE.SURVIVAL then Link to comment Share on other sites More sharing options...
troltos Posted July 21, 2016 Author Share Posted July 21, 2016 how should i put that into the code? just copy and paste that exact phrase at the end of the document? Link to comment Share on other sites More sharing options...
Recommended Posts
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.