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

  1. \b;Instruction \c;drop\n;
  2. The instruction \c;drop();\n; instructs the bot to drop whatever the operating arm is carrying 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;drop();\n; written in this form drops the object 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;    \l;grab\u cbot\grab;();
  8. \s;    \l;move\u cbot\move;(5);
  9. \s;    drop();
  10. \n;
  11. \b;For specialists
  12. Syntax:
  13. \s;\c;drop ( oper );\n;
  14.  
  15. This instruction appeals to the operating arm of a \l;grabber bot\u object\botgr;, in order to drop what it is holding.
  16.  
  17. \t;oper: \c;\l;int\u cbot\int;\n; (default value\c;InFront\n;)
  18. Oper indicates where the robot should drop the object. If no indication is given, the object is dropped in front of the bot. 
  19. \c;InFront   \n;  Drops in front (default value).
  20. \c;Behind    \n;  Drops behind.
  21. \c;EnergyCell\n;  Drops on the bot's own power cell location.
  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;drop();\n;.
  25. \c;== 0 \n;object was dropped
  26. \c;!= 0 \n;error, no object was dropped
  27.  
  28. \t;See also
  29. \l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.
  30.