home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2001 November / Gamestar_34_2001-11_cd1.bin / PATCHE / colobotpatch17e.exe / english / help / tremote1.txt < prev    next >
Text File  |  2001-09-13  |  2KB  |  40 lines

  1. \b;Exercise
  2. Remote control a robot using an \l;information exchange post\u object\exchange;, so it will transport \l;uranium ore\u object\uranore;.
  3. The main actors of this exercise areª:
  4.  
  5. 1) A \l;sniffer\u object\botsr; (can't carry anything).
  6. 2) An \l;information exchange post\u object\exchange; that receives information from a sender and then transmits it to a receiver.
  7. 3) A \l;grabber\u object\botgr; which waits for orders from the exchange post. You have no way control this robot directly.
  8.  
  9. \image tremot1a 16 8;
  10. An information exchange post stores "name/value" couples. To control the "slave" robot we use just one coupleª:
  11.  
  12.     name="order", valuer=order number
  13.  
  14. The slace robot understands following ordersª:
  15. \c;
  16.     1 -> grab();     // take an object
  17.     2 -> drop();     // drop an object
  18.     3 -> move(10);   // move 10 meters forward
  19.     4 -> move(-10);  // move 10 meters backwards
  20. \n;
  21. To instruct the slave to move forward 10 meters all you have to do isª:
  22. \c;\s;    \l;send\u cbot\send;("order", 3, 100);  // order 3 -> "move(10)"
  23. \n;
  24. After the send instruction we wait for 5 seconds to be sure the move is done.
  25. \c;\s;    \l;wait\u cbot\wait;(5);
  26. \n;
  27. Remark: There is a better way for waiting the order has been executed, but we'll see this later in exercise "Remote Control #2".
  28.  
  29. To finish the exercise you mustª:
  30.  
  31. 1) Take the uranium ore
  32. 2) Move forward by 10 meters
  33. 3) Drop the uranium ore
  34. 4) Move backwards by 10 meters
  35.  
  36. It's up to you to write the program.
  37.  
  38. \t;See also
  39. \l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.
  40.