Technically this is probably not a bug, but an unintentional result.
In my Mod NE Enemies, I change the terrain when Enemies die.
In my Mod Bio Industries, I have it that you can use fertilizer to change the terrain back to Medium Grass.
For some reason tiles that were changed when biters die, now get's captured by blueprints.
As you can see from the screenshot, the base terrain is not captured, only the Medium Grass tiles around the areas that I changed when a biter died.
I'm not sure if it's a setting I'm missing. Force issue...
Both Mods are in my signature.
function Scorched_Earth(surface, pos, size)
--- Turn the terrain into desert
local New_tiles = {}
local Water_Nearby_near = false
local Water_Nearby_far = false
local search_size = size + 1
for xxx = -size, size do
for yyy = -size, size do
--made local
local new_position = {x = pos.x + xxx,y = pos.y + yyy}
local currentTilename = surface.get_tile(new_position.x, new_position.y).name
writeDebug("The current tile is: " .. currentTilename)
if waterTiles[currentTilename] then
Water_Nearby_near = true
--added break to stop this loop
break
--replaced if with elseif
elseif replaceableTiles[currentTilename] then
table.insert(New_tiles, {name=replaceableTiles[currentTilename], position=new_position})
end
end
--if water nearby then stop loop
if Water_Nearby_near then
break
end
for xxx = -(search_size), (search_size) do
for yyy = -(search_size), (search_size) do
--no need to go through the tiles you already checked above
--so only check tiles that are outside the square that was checked in the above for loops
if xxx < -size or xxx > size or
yyy < -size or yyy > size then
--made local
local new_position = {x = pos.x + xxx,y = pos.y + yyy}
local currentTilename = surface.get_tile(new_position.x, new_position.y).name
if waterTiles[currentTilename] then
Water_Nearby_near = true
--added break to stop this loop
break
end
end
end
--if water nearby then stop loop
if Water_Nearby_near then
break
end
end
end
if Water_Nearby_near then
-- Water found, so don't replace any tiles.
else
for xxx = -(search_size+5), (search_size+5) do
for yyy = -(search_size+5), (search_size+5) do
--no need to go through the tiles you already checked above
--so only check tiles that are outside the square that was checked in the above for loops
if xxx < -search_size or xxx > search_size or
yyy < -search_size or yyy > search_size then
--made local
local new_position = {x = pos.x + xxx,y = pos.y + yyy}
local currentTilename = surface.get_tile(new_position.x, new_position.y).name
if waterTiles[currentTilename] then
Water_Nearby_far = true
--added break to stop this loop
break
end
end
end
--if water nearby then stop loop
if Water_Nearby_far then
break
end
end
if Water_Nearby_far then
surface.set_tiles(New_tiles, false)
else
surface.set_tiles(New_tiles)
end
end
end
Thanks for the report but as you've said that isn't a bug
If the mod author wants the tiles to not be blueprintable he can set the flag in the tile prototype "can_be_part_of_blueprint" to false and the game will disallow making blueprints from them.
Re: Blue print / Terrain Tile Issue
Posted: Mon Jul 24, 2017 5:43 pm
by TheSAguy
Rseding,
This is weird to me. Since I'm just changing one Base game Tile to another Base game tile. It's not like I'm adding a new tile to the game and need to give it the property "can_be_part_of_blueprint"
also, I looked at the base game and only two tiles have this property: "grass" and "red-desert"
Why would all the others not have this?
It seems to me like the issue is that the base game is missing "can_be_part_of_blueprint" from "grass-medium" (What my mod changes the terrain to) and all the other terrains:
P.S. I'm the author of both mods. I guess I could just add:
data.raw["tile"]["grass-medium"].can_be_part_of_blueprint = false
But not sure why it's not in the base game.
Thanks.
Re: Blue print / Terrain Tile Issue
Posted: Mon Jul 24, 2017 7:16 pm
by Rseding91
Tiles can't be in blueprints if there's no item that builds them so that's why they don't have the value set. When a mod adds an item that builds the tile then it becomes valid to be in a blueprint.
Re: Blue print / Terrain Tile Issue
Posted: Mon Jul 24, 2017 7:47 pm
by TheSAguy
Got it!
Thanks for your reply(s)
Re: Blue print / Terrain Tile Issue
Posted: Tue Jul 25, 2017 10:41 am
by darkfrei
Rseding91 wrote:Thanks for the report but as you've said that isn't a bug
If the mod author wants the tiles to not be blueprintable he can set the flag in the tile prototype "can_be_part_of_blueprint" to false and the game will disallow making blueprints from them.
Where are you find this? Is it in API, tutorian or in vanilla prototype?
Re: Blue print / Terrain Tile Issue
Posted: Tue Jul 25, 2017 1:17 pm
by Rseding91
darkfrei wrote:
Rseding91 wrote:Thanks for the report but as you've said that isn't a bug
If the mod author wants the tiles to not be blueprintable he can set the flag in the tile prototype "can_be_part_of_blueprint" to false and the game will disallow making blueprints from them.
Where are you find this? Is it in API, tutorian or in vanilla prototype?
It's used for grass in the base game: data\base\prototypes\tile\tiles.lua line 381.
Re: Blue print / Terrain Tile Issue
Posted: Tue Jul 25, 2017 7:07 pm
by darkfrei
Rseding91 wrote:It's used for grass in the base game: data\base\prototypes\tile\tiles.lua line 381.
Interesting, I can't find this text "can_be_part_of_blueprint" in the raw table.
I've used this info-mod tool and all another elements are here.
Re: Blue print / Terrain Tile Issue
Posted: Tue Jul 25, 2017 7:42 pm
by DaveMcW
Then info-mod tool is broken.
Re: Blue print / Terrain Tile Issue
Posted: Tue Jul 25, 2017 7:50 pm
by darkfrei
DaveMcW wrote:Then info-mod tool is broken.
It looks and works good, the raw table in 0.15.27 was:
You can see here all, but not can_be_part_of_blueprint = false
Re: Blue print / Terrain Tile Issue
Posted: Tue Jul 25, 2017 7:56 pm
by Bilka
Here is the 0.15.31 data.raw. Searching for "can_be_part_of_blueprint": false gives me grass as the first result. Here is the grass alone.
Edit: Even searching in the one linked on the wiki that was dumped directly from the game using a short mod has the grass as the first result when searching for can_be_part_of_blueprint .