home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Classic Fond 52
/
ClassicFond52.iso
/
GAMES
/
DROIDW.RAR
/
DWCD.GOB
/
mission_cog_00_helptexttimer.cog
< prev
next >
Wrap
Text File
|
1998-11-04
|
2KB
|
76 lines
# Droids COG Script
#
# 00_HelptextTimer.cog
#
# Displays Help messages with optional timeouts
#
# Desc (original):
# Two sectors, startsector and startsecotr2 will trigger the message number
# specified by messagenumber. The stopsectors display message 0, effectively
# turning it off.
#
# Desc (Timer version):
# There are now two new variables, displaytime and show_once.
# Displaytime, if set to a number larger than 0, will only
# display the message for the number of seconds it's set to.
# Show_once, if set to 1, will display the message only once then never
# display it again.
#
# [MT] Created
# 11/03/97 [DGS] Added Printtext commands for debugging
# 11/04/97 [DGS] Added two more start and stop sectors
# 12/03/97 [DGS] Modified "Helptext" to add timeouts and one-offs (see desc. above).
# ========================================================================================
symbols
message entered
message timer
sector startsector linkid=1
sector startsector2 linkid=1
sector startsector3 linkid=1
sector startsector4 linkid=1
sector stopsector linkid=2
sector stopsector2 linkid=2
sector stopsector3 linkid=2
sector stopsector4 linkid=2
int messagenumber
flex displaytime=0
int show_once=0
end
code
entered:
// 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.
if (show_once < 2)
{
if (getsenderid()==1) //1 is a start sector
{
dwsetmissiontext(messagenumber);
print("HelptextTimer: Starting #:"); //Debug Lines
printint(messagenumber);
if (show_once == 1 ) show_once = 2; //It's been shown.
if (displaytime > 0) settimer(displaytime);//Set it up to turn it off.
}
}
if (getsenderid()==2) // 2 is a stop sector
{
dwsetmissiontext(00000);
print("HelptextTimer: Stopping #"); //Debug lines
printint(messagenumber);
}
return;
Timer:
dwsetmissiontext(00000);
print("HelptextTimer: Timed out #"); //Debug lines
printint(messagenumber);
end