Last active
October 13, 2021 03:08
-
-
Save eniraa/bda1e0d1701f14b3181f46f3cfe6a95e to your computer and use it in GitHub Desktop.
Change the turf in Don't Starve!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function change_ground(ground) | |
--[[ | |
paste this code into the console and then use the change_ground(`ground`) command | |
options for `ground` can be a number or a string | |
use `worldtiledefs.lua` or `terrain.lua` as a reference | |
--]] | |
ground = | |
ground == nil and GROUND.QUAGMIRE_SOIL or type(ground) == "string" and GROUND[string.upper(ground)] or ground | |
local pt = ConsoleWorldPosition() | |
local x, y = TheWorld.Map:GetTileCoordsAtPoint(pt:Get()) | |
local original_tile_type = TheWorld.Map:GetTileAtPoint(pt:Get()) | |
TheWorld.Map:SetTile(x, y, ground) | |
TheWorld.Map:RebuildLayer(original_tile_type, x, y) | |
TheWorld.Map:RebuildLayer(ground, x, y) | |
TheWorld.minimap.MiniMap:RebuildLayer(original_tile_type, x, y) | |
TheWorld.minimap.MiniMap:RebuildLayer(ground, x, y) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This has only been tested in DST.