integer Look(integer Location)
Scan the robot proximity to get informations about the nearby voxels. You can scan the 6 voxels which are directly adjacent.This function can only be used in Voxel_Step().
Location : The position of the voxel to scan in "position code" notation.
0 = { 0, 0, 1 } = Front of the robot.
1 = { 1, 0, 0 } = Right of the robot.
2 = { 0, 0, -1} = Back of the robot.
3 = {-1, 0, 0 } = Left of the robot.
4 = { 0, 1, 0 } = Above the robot.
5 = { 0,-1, 0 } = Under the robot.
An integer number giving the voxeltype of the voxel at the specified location. If the scanned voxel belongs to an unloaded zone, the 65535 code is returned.
Put a voxel on top of the voxel analyser to get it's voxeltype and name.
// Listing #1: Voxel Analyser (Get info about voxel on top)
Time <- 0;
function Voxel_Step()
{
local VoxelType, VoxelName;
// The robot will play at 1 second interval.
if ( (GetGameTime() - Time) > 1000 )
{
// Look at the voxel on top of the robot and display it's voxeltype and voxel name.
VoxelType = Look(4);
VoxelName = GetVoxelName(VoxelType);
Display( "VOXEL ANALYSIS : (" + VoxelType + ") " + VoxelName, 900, 2);
// Store actual timestamp for the next 1 second delay.
Time = GetGameTime();
}
}
none