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

  1. # Droids COG Script
  2. #
  3. # 03_cammyhelp.cog
  4. #
  5. # Displays Help messages with optional timeouts 
  6. #
  7. # Desc (original):
  8. #    Two sectors, startsector and startsecotr2 will trigger the message number
  9. #    specified by messagenumber. The stopsectors display message 0, effectively
  10. #    turning it off.
  11. #
  12. # Desc (Timer version):
  13. #    There are now two new variables, displaytime and show_once. 
  14. #    Displaytime, if set to a number larger than 0, will only
  15. #        display the message for the number of seconds it's set to.
  16. #    Show_once, if set to 1, will display the message only once then never 
  17. #        display it again. 
  18. #
  19. #         [MT]    Created
  20. # 11/03/97    [DGS]    Added Printtext commands for debugging
  21. # 11/04/97    [DGS]    Added    two more start and stop sectors
  22. # 12/03/97    [DGS]    Modified "Helptext" to add timeouts and one-offs (see desc. above).
  23. # 03/24/98     [JP]      Modified for Moisture Farm
  24. # ========================================================================================
  25.  
  26. symbols
  27. message         entered
  28. message        timer
  29. sector             startsector     linkid=1
  30. sector             startsector2    linkid=1
  31. sector             startsector3    linkid=1
  32. sector             startsector4    linkid=1
  33.  
  34. sector             stopsector      linkid=2
  35. sector             stopsector2     linkid=2
  36. sector             stopsector3     linkid=2
  37. sector             stopsector4     linkid=2
  38.  
  39. int                 messagenumber
  40. int            displaytime=0    
  41. int            show_once=0
  42. end
  43.  
  44. code
  45. entered:
  46.     // show_once is set to 0 if it's off, 1 if it's only going to show once, and 2 if it's been shown.
  47.  
  48.     if (show_once < 2)
  49.         {
  50.         if (getsenderid()==1)        //1 is a start sector 
  51.             {
  52.                   dwsetmissiontext(messagenumber);
  53.             print("HelptextTimer: Starting #:");    //Debug Lines
  54.             printint(messagenumber);
  55.                  if (show_once == 1 ) show_once = 2;        //It's been shown. 
  56.             if (displaytime > 0) settimer(displaytime);//Set it up to turn it off. 
  57.             }
  58.         }
  59.              
  60.         if (getsenderid()==2)         // 2 is a stop sector
  61.             {
  62.                   dwsetmissiontext(00000);
  63.             print("HelptextTimer: Stopping #");        //Debug lines
  64.             printint(messagenumber);
  65.             }
  66.     return;
  67.      
  68. Timer:
  69. dwsetmissiontext(00000);
  70.     print("HelptextTimer: Timed out #");        //Debug lines
  71.     printint(messagenumber);
  72. end
  73.  
  74.  
  75.  
  76.  
  77.