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

  1. # Droids COG Script
  2. #
  3. # 00_HelptextTimer.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/10/98     [JP]      Modified to add 2nd message.   
  24. # ========================================================================================
  25.  
  26. symbols
  27. message         entered
  28. message        timer
  29.  
  30. cog            m2          #companion message by cammy
  31.  
  32. sector             startsector     linkid=1
  33. sector             stopsector      linkid=2
  34.  
  35. int                 messagenumber
  36. int            displaytime=0    
  37. int            show_once=0
  38. end
  39.  
  40. code
  41. entered:
  42.     // 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.
  43.  
  44.     if (show_once < 2)
  45.         {
  46.         if (getsenderid()==1)        //1 is a start sector 
  47.             {
  48.                   //dwsetmissiontext(messagenumber);
  49.             print("message1");    //Debug Lines
  50.             printint(messagenumber);
  51.                  if (show_once == 1 ) show_once = 2;        //It's been shown. 
  52.             if (displaytime > 0) settimer(displaytime);//Set it up to turn it off.
  53.                //sendmessage(m2, user1);      //sends message to companion cammy message
  54.                
  55.             }
  56.         }
  57.              
  58.         if (getsenderid()==2)         // 2 is a stop sector
  59.             {
  60.                   //dwsetmissiontext(00000);
  61.             print("HelptextTimer: Stopping #");        //Debug lines
  62.             printint(messagenumber);
  63.             }
  64.                
  65.      
  66.           
  67.     return;
  68.      
  69. timer:
  70. //dwsetmissiontext(00000);
  71.     print("HelptextTimer: Timed out #");        //Debug lines
  72.     printint(messagenumber);
  73.      sendmessage(m2, user1);
  74.      return;
  75. end
  76.  
  77.  
  78.  
  79.  
  80.