Jump to content

Worldgeneration: Warning! Could not find a spot for TeleportatoBaseLayout


Recommended Posts

Does anyone know a way to increase chances, that worldgeneration will place my layout?!

I'm making a Teleportato Mod at the moment, but the chance that the teleportato_base is placed on the map while generation the world is very very low...I mostly get:
[00:09:29]: Warning! Could not find a spot for TeleportatoBaseLayout in node Beeeees!:5:Forest   

My mod does this in modworldgenmain:

local require = GLOBAL.require
require("map/tasks")

AddTaskSetPreInitAny(function(tasksetdata)
    if tasksetdata.location ~= "forest" then
        return
    end

    tasksetdata.set_pieces["TeleportatoRingLayout"] = { count = 1, tasks={"Make a pick", "Dig that rock", "Great Plains", "Squeltch", "Beeeees!", "Speak to the king", "Forest hunters", "Badlands", "Befriend the pigs", "For a nice walk", "The hunters", "Magic meadow", "Frogs and bugs"}}
    tasksetdata.set_pieces["TeleportatoBoxLayout"] = { count = 1, tasks={"Make a pick", "Dig that rock", "Great Plains", "Squeltch", "Beeeees!", "Speak to the king", "Forest hunters", "Badlands", "Befriend the pigs", "For a nice walk", "The hunters", "Magic meadow", "Frogs and bugs"}}
    tasksetdata.set_pieces["TeleportatoPotatoLayout"] = { count = 1, tasks={"Make a pick", "Dig that rock", "Great Plains", "Squeltch", "Beeeees!", "Speak to the king", "Forest hunters", "Badlands", "Befriend the pigs", "For a nice walk", "The hunters", "Magic meadow", "Frogs and bugs"}}
    tasksetdata.set_pieces["TeleportatoCrankLayout"] = { count = 1, tasks={"Make a pick", "Dig that rock", "Great Plains", "Squeltch", "Beeeees!", "Speak to the king", "Forest hunters", "Badlands", "Befriend the pigs", "For a nice walk", "The hunters", "Magic meadow", "Frogs and bugs"}}
    tasksetdata.set_pieces["TeleportatoBaseLayout"] = { count = 1, tasks={"Make a pick", "Dig that rock", "Great Plains", "Squeltch", "Beeeees!", "Speak to the king", "Forest hunters", "Badlands", "Befriend the pigs", "For a nice walk", "The hunters", "Magic meadow", "Frogs and bugs"}}

    GLOBAL.dumptable(tasksetdata)
end)

I'm not quite sure if the "tasks" are correct? I just added every task I found. Since Deja Vu wrote, that these are the possible biomes it can spawn, I thought when I just add every biome, the chances would be higher...
http://forums.kleientertainment.com/topic/69788-better-worldgeneration-configurable/?do=findComment&comment=807793

 

Link to comment
Share on other sites

I "solved" it now by increasing the count number. So up to 2 from each layout are generated now.
And after the world is loaded, I check how many teleportato items are there. Then I remove everything but 1, or add one if it was still not created...

But of course this is an ugly workaround and might cause problems at servers where players leave game with teleportato item in inventory... since my mod will create a new part, and if this payer joins again, one part will be deleted...

Edited by Serpens
Link to comment
Share on other sites

6 hours ago, Serpens said:

[00:09:29]: Warning! Could not find a spot for TeleportatoBaseLayout in node Beeeees!:5:Forest

Use:

local require = GLOBAL.require
local PLACE_MASK = GLOBAL.PLACE_MASK
local LAYOUT_POSITION = GLOBAL.LAYOUT_POSITION

AddLevelPreInitAny(function(level)
	local function Add_IIBE_Mask(layout)
		layout.start_mask = PLACE_MASK.IGNORE_IMPASSABLE_BARREN_RESERVED
		layout.fill_mask = PLACE_MASK.IGNORE_IMPASSABLE_BARREN_RESERVED
		layout.layout_position = LAYOUT_POSITION.CENTER
	end

	local layouts = require("map/layouts")

	local teleportato_layouts = {
		"TeleportatoBoxLayout",
		"TeleportatoRingLayout",
		"TeleportatoPotatoLayout",
		"TeleportatoCrankLayout",
		"TeleportatoBaseLayout",
	}

	for i, v in ipairs(teleportato_layouts) do
		Add_IIBE_Mask(layouts.Layouts[v])
	end
end)
4 hours ago, Serpens said:

But of course this is an ugly workaround and might cause problems at servers where players leave game with teleportato item in inventory... since my mod will create a new part, and if this payer joins again, one part will be deleted...

Parts have the "irreplaceable" tag anyway, they drop when people leave the server.

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