home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2001 November / Gamestar_34_2001-11_cd1.bin / PATCHE / colobotpatch17e.exe / english / help / cbot / GRAB.TXT < prev    next >
Text File  |  2001-08-30  |  1KB  |  30 lines

  1. \b;Instruction \c;grab\n;
  2. The instruction \c;grab();\n; instructs the bot to use the operating arm to grab an object located on the ground, on the platform of a building or on the power cell location of a bot.
  3.  
  4. \b;Basic use
  5. The instruction \c;grab();\n; written in this form grabs the object located in front of the bot. Here is a short program that grabs an object in front of the bot and drops it 5 meters further:
  6. \c;
  7. \s;    grab();
  8. \s;    \l;move\u cbot\move;(5);
  9. \s;    \l;drop\u cbot\drop;();
  10. \n;
  11. \b;For specialists
  12. Syntax:
  13. \s;\c;grab ( oper );\n;
  14.  
  15. This instruction appeals to the operating arm of a \l;grabber bot\u object\botgr;, in order to grab the closest object.
  16.  
  17. \t;oper: \c;\l;int\u cbot\int;\n; (default value\c;InFront\n;)
  18. Oper indicates where the bot should look for an object to grab. If no indication is given, the object is picked up in front of the bot.
  19. \c;InFront   \n;  Grabs in front (default value).
  20. \c;Behind    \n;  Grabs behind.
  21. \c;EnergyCell\n;  Grabs the bot's own power cell.
  22.  
  23. \t;Return value: \c;\l;int\u cbot\int;\n;
  24. Normally an error stops the program. You can prevent the program from stopping on errors by using the \c;\l;errmode\u cbot\errmode;(0)\n; instruction. A value different from zero if an error occurred is then returned by \c;grab();\n;.
  25. \c;== 0 \n;an object was grabbed
  26. \c;!= 0 \n;error, no object was grabbed
  27.  
  28. \t;See also
  29. \l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.
  30.