Jump to content

Recommended Posts

You can take a look at the debugcommands.lua file and find relevant code on changing out a tile:

Spoiler

function d_ground(ground)
	ground = ground == nil and GROUND.QUAGMIRE_SOIL or 
			type(ground) == "string" and GROUND[string.upper(ground)] 
			or ground

	local pt = TheInput:GetWorldPosition()
	
    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

 

And then to set the specific tile by ID, look at constants.lua for the GROUND table declaration.  Ex: GROUND.OCEAN_COASTAL

 

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