Mining a smaller area than 4x4?

Following the mining code around, it eventually winds up at a call to

Terrain.subtract_point(point)

Where point is the position of the cube to remove.

Looking at terrain.lua more you can see

Terrain.add_point(point,tag)

Where point is the position of the cube to add, and tag is an id number for the block. Here’s the grass block in code.

"grass" :        { "tag" : 300, "color" : "#75b370", "kind" : "grass" },

All the blocks and their id’s can be found in

stonehearth/data/terrian/terrain_blocks.json

Finally calls to add cubes

-- get access to point3
local Point3=_radiant.csg.Point3

-- create the cube
radiant.terrain.add_point(Point3( 10 ,10, 10), 300)

The biggest thing is getting the position right, as of now this was done without the use of a ui and the mouse.

I’ve started a new topic discussion about this type of feature becoming a mod. If you are interested :wink:

2 Likes