Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Included is patch for seeing turfs on the minimap mentioned in my previous comment.
There is this thing that could be called a bug or a feature - it is possible to plant saplings, grass, berries and trees on the custom turfs. It is not possible to plant them on basic wood floor or basic carpet.
Adding the turf into GLOBAL.GROUND_FLOORING forbids this planting. It is included in the patch commented out. If you decide that this is a bug, please add a configuration option for this (with the default being disable planting).
Regarding sounds when walking on the turfs, that can be solved by adding appropriate sounds to AddTile's specs parameter, e.g.
Regarding layering, it seems to be determined by the order of turfs in require('worldtiledefs').ground table. So just by changing the order how the tiles are added in modworldgenmain.lua the layering can be controlled (tiles added earlier are lower).
However, base game tiles are on the very bottom, so if you want basic carpet be on top of e.g. woodpine, you'd have to manipulate the table itself. Just make sure the code can handle the table to be filled with inconsistently structured items (e.g. see my recent comment for Structures and More mod).
local function SpawnTurf(turf, pt)
if turf ~= nil then
local loot = SpawnPrefab(turf)
if loot.components.inventoryitem ~= nil then
loot.components.inventoryitem:InheritMoisture(GLOBAL.TheWorld.state.wetness, GLOBAL.TheWorld.state.iswet)
end
loot.Transform:SetPosition(pt:Get())
if loot.Physics ~= nil then
local angle = math.random() * 2 * GLOBAL.PI
loot.Physics:SetVel(2 * math.cos(angle), 10, 2 * math.sin(angle))
end
end
end
-- Not necessary for the AddComponentPostInit version
local Terraformer = require("components/terraformer")
local OldTerraform = Terraformer.Terraform or function() return false end
-- A heavily-gutted version of the original Terraform function
-- Ultimately, it checks for the turf type at the intended dig spot and will spawn it if the original function didn't
function Terraformer:Terraform(pt, spawnturf)
local Map = GLOBAL.TheWorld.Map
if not Map:CanTerraformAtPoint(pt:Get()) then
return false
end
local original_tile_type = Map:GetTileAtPoint(pt:Get())
--local dugSomethingUp = OldTerraform(self, pt)
-- If the old terraform successfully dug up some turf and it's a ruins turf, spawn the item
if OldTerraform(self, pt, spawnturf) then
local turfPrefab = MOD_GROUND_TURFS[original_tile_type]
if spawnturf and turfPrefab ~= nil then
SpawnTurf(turfPrefab, pt)
end
return true
end
return false
end
{LINK REMOVED}https://imgur.com/j6BwO0n