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

    Description

    bool PullVoxelFrom(integer Location)

    Get a voxel through the voxel_output interface of the voxel at the specified location and put it in the robot's storage. With this function you can make material transferts between storages/transport systems. You can use this function with one of the 6 voxels which are directly adjacent. Of course, the source voxel must support the voxel_output interface : you can test the voxels to ensure they support this capacity with the Look() and GetVoxelProp() functions.  Some material must be available in the source voxel storage. This function can only be used in Voxel_Step().

    Parameters

    Location : The position of the receptor voxel in "position code" notation. The receptor voxel must support the voxel_output interface.

    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

    A boolean number. It will be true if the function pushed a voxel successfully. False will be returned the voxel didn't support the voxel_input interface or if the interface didn't deliver the voxel for any reason (storage is empty, etc...).

    Example of use

    This example will transfert the content of the robot inventory into storage on top of the robot.

    // Listing #1: Get materials from some storage.

    function Voxel_Step() { local Slot, VoxelType; // Look if voxel on top support the voxel_input interface. if (!GetVoxelProp( Look(4), 2)) { Display("PUT STORAGE ON TOP OF THE ROBOT", 250, 2 , 0); return; } // Get something trough interface. if (!PullVoxelFrom(4)) Display("PUT SOME VOXELS IN THE STORAGE", 250, 2 , 0); }

    See Also

    PushVoxelTo()
    Look()
    GetVoxelProp()

     
  2. Google+