home *** CD-ROM | disk | FTP | other *** search
/ Classic Fond 52 / ClassicFond52.iso / GAMES / DROIDW.RAR / DWCD.GOB / mission_cog_t6_r5talk2a.cog < prev    next >
Text File  |  1998-11-04  |  2KB  |  76 lines

  1. #-----------------------------------------------------------------------------
  2. #  Droidworks
  3. #  Sample cog for a simple conversation with Bob.
  4. #-----------------------------------------------------------------------------
  5.  
  6. symbols
  7. message        user0               #gonk is now in stopsector
  8. message        user2               #fulcrum going down
  9. message        startup
  10. message        pulse
  11. message        user4
  12.  
  13. thing          target0
  14. thing          target1
  15. thing          target9
  16.  
  17. thing          gonk
  18.  
  19. cog            fulcrumcog
  20. end
  21.  
  22.  
  23. code
  24. startup:
  25.      print("startup");
  26.      player=getlocalplayerthing();
  27.      xradius=getthingradius(player)+0.1;
  28.      x1pos=getthingpos(target0);
  29.      x2pos=getthingpos(target1);
  30.      x9pos=getthingpos(target9);
  31.      chevyx10=1;
  32.      return;
  33.  
  34. user0:
  35.      AISetMovePos(gonk, x9pos);
  36.      AISetLookPos(gonk, x9pos);
  37.      targetpos=x9pos;
  38.      setpulse(0.25);
  39.      return;
  40.      
  41. pulse:
  42.      gonkpos=getthingpos(gonk);
  43.      if (vectordist(gonkpos, targetpos)<.1) {
  44.           setpulse(0);
  45.           if (chevyx10==1) call x10story;
  46.      }          
  47.      return; 
  48.      
  49. x10story:
  50.      chevyx10=0;
  51.      gonkpos=getthingpos(gonk);
  52.      if (vectordist  (gonkpos, getthingpos(target9)) < xradius)   {
  53.           targetpos=x1pos;
  54.           AISetMovePos(gonk, x1pos);
  55.           AISetLookPos(gonk, x1pos);
  56.           setpulse(.25);
  57.           sendmessage(fulcrumcog, user0);     
  58.      }
  59.      return;
  60.      
  61. user4:
  62.      print("oh no.");
  63.      return;
  64.      
  65. user2:
  66.      print("go R5, go!");
  67.      AISetMovePos(gonk, x2pos);
  68.      AISetLookPos(gonk, x2pos);
  69.      targetpos=x2pos;
  70.      setpulse(0.25);
  71.      return;
  72.      
  73. end
  74.  
  75.  
  76.