home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 51 / PCGamer51_17Demos.iso / games / colobotdemo / colobotdemo10e.exe / help / cbot / object.txt < prev    next >
Text File  |  2001-07-03  |  5KB  |  67 lines

  1. \b;Type \c;object\n;
  2. Use this type for variables that contain the characteristics of an object, be it a bot, a building, some raw material, an enemy, etc. 
  3.  
  4. \c;\l;int\u cbot\int;    object.category     \n;\l;Category\u cbot\category; of the object
  5. \c;\l;point\u cbot\point;  object.position     \n;Position of the object (x,y,z)
  6. \c;\l;float\u cbot\float;  object.orientation  \n;Orientation of the object (0..360)
  7. \c;\l;float\u cbot\float;  object.pitch        \n;Forward/backward angle of the object
  8. \c;\l;float\u cbot\float;  object.roll         \n;Right/left angle of the object 
  9. \c;\l;float\u cbot\float;  object.energyLevel  \n;Energy level (0..1)
  10. \c;\l;float\u cbot\float;  object.shieldLevel  \n;Shield level (0..1)
  11. \c;\l;float\u cbot\float;  object.temperature  \n;Jet temperature (0..1)
  12. \c;\l;float\u cbot\float;  object.altitude     \n;Altitude above ground
  13. \c;object object.energyPack   \n;Power cell on the bot
  14. \c;object object.load         \n;Object carried by the bot
  15.  
  16. \s;\c;category\n;
  17. The \n;\l;category\u cbot\category; of an object allows you to know what it is, f. ex. what kind of bot, building, enemy, etc. 
  18.  
  19. \s;\c;position\n;
  20. Position of the object on the planet, in meters. The coordinates \c;x\n; and \c;y\n; correspond to the location on a map, the \c;z\n; coordinate corresponds to the altitude above (respectively below) sea level. 
  21.  
  22. \s;\c;orientation\n;
  23. Orientation of the object, in degrees. The orientation tells you what direction the object is facing. An orientation of \c;0\n; corresponds to an object facing eastwards, thus following the positive \c;x\n; axis. The orientation is measured counterclockwise. 
  24.  
  25. \s;\c;pitch\n;
  26. Forward/backward angle of the robot. A pitch of \c;0\n; means that the bot is standing on flat ground. A positive inclination means that it is facing upwards, a negative inclination means that it is facing downwards. 
  27.  
  28. \s;\c;roll\n;
  29. Left/right angle of the bot, in degrees. A positive value means that the bot is leaning to the left side, a negative value means that it is leaning to the right side. 
  30.  
  31. \s;\c;energyLevel\n;
  32. Energy level, between 0 and 1. A normal \l;power cell\u object\power; that is fully charged returns the value \c;1\n;. A \l;nuclear power cell\u object\atomic; never returns a value higher than 1, it just lasts longer. Attention: The energy level of a bot is always zero, because the energy is not contained in the bot, but in the power cell. To know the energy level of the power cell of a bot, you must write \c;energyPack.energyLevel\n;. 
  33.  
  34. \s;\c;shieldLevel\n;
  35. Shield level of a robot or building. A level \c;1\n; indicates that the shield is still perfect. Every time that the bot or building gets a bullet or collides with another object, the shield level decreases. When the level reaches \c;0\n;, the next bullet or collision will destroy the bot or building. 
  36. Bots can re-energize their shield on a \l;repair center\u object\repair;. The shield of a building is repaired if it lays inside the protection sphere of a \l;shielder\u object\botshld;.
  37.  
  38. \s;\c;temperature\n;
  39. Temperature of the jet of \l;winged bots\u object\botgj;. \c;0\n; corresponds to a cold jet. When used, the temperature increases progressively. When it reaches the value \c;1\n;, the jet is overheated and stops working, until it cooled down a little. 
  40.  
  41. \s;\c;altitude\n;
  42. The \c;z\n; coordinate of the position indicates the altitude above sea level, whereas the \c;altitude\n; indicates the height above ground. This value is meaningful only for \l;winged bots\u object\botgj; and for \l;wasps\u object\wasp;. For all other objects, this value is zero. 
  43.  
  44. \s;\c;energyPack\n;
  45. This information is special, because it returns the information about another object, in this case the power pack. This means that energyPack contains all the characteristics of a normal object, for example \c;category\n; (PowerCell or NuclearCell), \c;position\n; (the position of the cell), etc.
  46. If you want to know the energy level of a robot, you must not check \c;energyLevel\n;, but \c;energyPack.energyLevel\n;.
  47. If the bot has bot no power cell, \c;energyPack\n; returns \c;null\n;.
  48.  
  49. \s;\c;load\n;
  50. This information also returns the description of a whole object: the description of the object carried by a \l;grabber\u object\botgr;. If it carries nothing, \c;load\n; returns \c;null\n;.
  51.  
  52. \b;Examples
  53. The type \c;object\n; returns the special value \c;\l;null\u cbot\null;\n; when the object does not exist. For example:
  54. \c;
  55. \s;    object a;
  56. \s;    a = radar(BotGrabberRoller);
  57. \s;    if ( a == null )  // object does not exist ?
  58. \s;    {
  59. \s;    }
  60. \s;    if ( a.position.z > 50 )  // is it on a mountain ?
  61. \s;    {
  62. \s;    }
  63. \n; 
  64. \t;See also
  65. \l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.
  66.  
  67.