home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Classic Fond 52
/
ClassicFond52.iso
/
GAMES
/
DROIDW.RAR
/
DWCD.GOB
/
mission_cog_03_tanks2.cog
< prev
next >
Wrap
Text File
|
1998-11-04
|
36KB
|
829 lines
#
# Droids Cog Script
#
# 03_Tanks.cog
#
# bin 27 gear, this number can be changed. Right now, it's Doug's large gear bin number.
# Desc:
# This cog is responsible for keeping track of what gears are in the Gear assembly and where.
# It's also in charge of moving the lock either to the right or to the left, depending on where
# the gears are placed. There are also separate cogs for the gear pieces themselves when found.
# After they've been placed in this assembly, they are part of this script. This cog will trigger
# the water in the water tanks moving up and down also.
#
#
# 1/27/98 [JP] Created, mostly with lines taken from Doug's mega Gear cog...
#
# <C> 1998 LucasLearningLimited. All Rights Reserved--------------------------------------------------------------------------------
symbols
message startup
message used
message arrived
message user0
message taken
message timer
message entered
message pulse
//surface button0 linkid=2
surface sign0
## Parts
thing screw0 linkid=11 //horizontal worm gear
thing lock linkid=3 //tank lock
thing big_gear_vert linkid=11 //permanent big gear vertical, you don't place or take this
thing big_gear_hori linkid=11 //permanent big gear horizontal, you don't place or take this
thing med_gear_vert linkid=9 //permanent med gear vertical, you don't place or take this11
##Ghost Objects
thing lower_left_spindle_g linkid=30
thing lower_right_spindle_g linkid=31
thing upper_left_spindle_g linkid=32
thing upper_right_spindle_g linkid=33
##Ghost creation integers
int lower_left_spindle_i=0 linkid=30 local
int lower_right_spindle_i=0 local
int upper_left_spindle_i=0 local
int upper_right_spindle_i=0 local
##Spin Direction integers
flex lower_left_spindle_d=0.0 local
flex lower_right_spindle_d=0.0 local
flex upper_left_spindle_d=0.0 local
flex upper_right_spindle_d=0.0 local
flex big_gear_vert_d=0.0 local
flex big_gear_hori_d=0.0 local
flex med_gear_vert_d=0.0 local
##templates
template med_gear_t
##Sectors
//sector lower_left_sector2 //for placing gear in lower left slot
//sector lower_right_sector2 // " " in lower right slot
//sector upper_left_sector2 // " " in upper left
//sector upper_right_sector2 // " " in upper right
##cogs
cog tank_button2_cog //switch
cog watermove1 //small tank adjoin and state changes
cog watermove2 //medium tank adjoin and state changes
cog watermove3 //large tank adjoin and state changes
cog ecam //to external camera
cog pipemove
cog rdroid
##sounds
sounds machine_on //moving .wav
sounds place_gear
## Integral Variables
float speed=2.0 local
int on_button0=0 local
int xrotate local
int lower_left_spindle=0 local
int lower_right_spindle=0 local
int upper_left_spindle=0 local
int upper_right_spindle=0 local
int timermode=0 local
int part_id=0 local
int bin=27 local
sound motorfree=MCHt9MotFree.WAV
sound motor=MCHt9MotFree.WAV
sound switch=MCHt9MotStrt.WAV //button
sound attach=SWTt9GearOn.WAV
sound taken=SWTt9GearOff.WAV
sound grind=MCHt9GearBog.WAV
sound rotating=MCHt9MotStrss.WAV
sound closing=DORt7BoltSlide.WAV
thing bottomspindles linkid=9 //was11
thing topspindles linkid=10 //was11
thing plat1 linkid=10
thing plat2 linkid=10
thing lockpod linkid=9 //that cracked white thing
thing motorpod linkid=9
cog maps
cog waterfall
sound gearon=swtt9gearon.wav local
sound gearoff=swtt9gearoff.wav local
cog arrows
surface s1
surface s2
sound start2=MCHt9MotStrt.wav local
sound fin2=MCHt9MotStp.wav local
surface s3
surface s4
surface a1 linkid=5
end
## Code Section
code
startup:
//xrotate = 1;
//lower_left_spindle_d = -0.5;
//lower_right_spindle_d = 0.5;
//big_gear_vert_d = -0.5;
//big_gear_hori_d = 0.5;
//med_gear_vert_d = 0.5;
//call rotate_gears;
//print ("try4");
SetWallCel(sign0, 1);
AttachThingToThing (screw0, big_gear_vert);
player=getlocalplayerthing();
motorpos=vectory(getthingpos(med_gear_vert));
MiddleY=motorpos+.1969; // was .1619, was .1969
setpulse(0.5);
return;
#==================================
user0:
//User0 gets called when the player hits the motor switch, see tank_activate2.cog
print("user0");
if (xrotate == 0) call start_motor;
return;
##======================================
used:
// Section is executed when the user uses an inventory object.
print("used2");
printint (dwGetActivateBin());
printint (getsenderid());
if (xrotate == 0)
{
if ( getinv(getlocalplayerthing(), dwGetActivatebin()) > 0)
{
if (GetSenderId() == 9)
{
playery=vectory(getthingpos(player));
printflex(playery);
printflex(MiddleY);
{
if (playery < MiddleY)
{
call handle_lower_right;
}
if (playery > MiddleY)
{
call handle_lower_left;
}
}
}
else if (GetSenderId() == 10)
{
playery=vectory(getthingpos(player));
printflex(playery);
printflex(MiddleY);
{
if (playery < MiddleY)
{
call handle_upper_right;
}
if (playery > MiddleY)
{
call handle_upper_left;
}
}
}
else if (GetSenderId() == 5)
{
playery=vectory(getthingpos(player));
printflex(playery);
printflex(MiddleY);
{
if (playery < MiddleY)
{