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 https://forums.kleientertainment.com/forums/topic/69023-spawning-in-the-right-place/ 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 https://forums.kleientertainment.com/forums/topic/69023-spawning-in-the-right-place/#findComment-795623 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 https://forums.kleientertainment.com/forums/topic/69023-spawning-in-the-right-place/#findComment-795634 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now