Intranet Catprocess
  1. news...
  2. about Blackvoxel
  3. download
  4. manual
  5. videos
  6. about us
  1. Look

    Description

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

    Parameters

    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.

    Position Code

    Return Value

    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.

    Example of use

    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(); } }

    See Also

    none

     
  2. Google+