home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Classic Fond 52
/
ClassicFond52.iso
/
GAMES
/
DROIDW.RAR
/
DWCD.GOB
/
mission_cog_03_ctrlrm2.cog
< prev
next >
Wrap
Text File
|
1998-11-04
|
14KB
|
391 lines
# Droids Cog Script
#
# 03_CtrlRm.cog
#
# Desc:
# This is the "Wheel & Axle" puzzle for the Moisture Farm level. It's big, it's ugly. really ugly...
#
#
# [MT] Created
# 1/16/98 [JP] Modified for Moisture Farm Control Room.
#
# (C) 1997 LucasLearningLimited. All Rights Reserved
symbols
message startup
message pulse
message activate
message touched
message timer
message arrived
message used
message taken
message user0
message user7
##templates
template wftemplate
template grtemplate
template iwltemplate
##lever (wrench_long) when you first place it on
template iwstemplate
##lever fake (wrench_short) when you first place it on
surface
surface reset_switch linkid=7
surface test_surface
//cog ctrldrain
//cog ctrlswitch
cog movedown
cog switch
vector vec0 desc=thrust_direction
## thing wrench_long linkid=2
## thing wrench_short linkid=1
thing gearZ
thing gear linkid=4
thing gearW
thing platform linkid=3
thing light1
thing light2
thing light3
##ghosts
thing wfghost
thing grghost
thing iwlghost
##inventory wrench long when you first place it on
thing iwsghost linkid=5
#inventory wrench_short when you first place it on
thing
#ghosts creation integers
int wrench_long_spindle_i linkid=5 local
int wrench-short_spindle_i linkid=5 local
#sectors
sector control_room0
sector control_room1
sector control_room2
sector control_room3
sector drain_room0
sector drain_room0a
sector drain_room0b
sector drain_room0c
sector drain_room0d
sector drain_room1 //octogonal one
sector platform_sector
float brightness=1.00
int speed=9 desc=thrust_speed
int bin=31
#bin number for the wrench piece.
int wrench_long_spindle=0 local
int wrench_short_spindle=0 local
int part_id=0 local
int xrotate local
#TEMP
sound reset_switch_broke
sound wrench_gear_attach
sound wrench_gear_move
sound water_gush
sound power_on
end
# =======================================
## Code Section
code
startup:
//print("yosh1");
clearvector=vectorset('0.0, 0.0, 0.0');
//vec0=vectorset(0.0, 0.0, -8.0);
setpulse(0.2);
//if (light0 != 0) setthinglight(light0, 0, 0.0);
//if (light1 != 0) setthinglight(light1, 0, 0.0);
//if (light2 != 0) setthinglight(light2, 0, 0.0);
//if (light3 != 0) setthinglight(light3, 0, 0.0);
//xrotate=0;
////global0=0;
//AttachThingToThing(wrench_long, gear);
//AttachThingToThing(wrench_short, gear);
return;
# =========================================================
//user0:
//user gets called when player hits reset switch, see ctrlswitch co
//sendmesasge
//activate:
//print("activate");
//if (GetSenderId() == 7) // pressing reset button underwater
//{
//if (global0==0) // water is not drained yet
//{
//print ("reset_switch_broke!");
//PlaySoundLocal(reset_switch_broke, 1, 0, 0);
//dwsetmissiontext(17430); //Cambot dialog
//}
///else if (global0==1) // power comes on
//{
//print("power on");
//PlaySoundLocal(power_on, 1, 0, 0);
//SetWallCel(reset_switch, 1); // reset button changes color
//setthinglight(light0, brightness, 1.5); // turns these lights on
//setthinglight(light1, brightness, 2.0);
//setthinglight(light2, brightness, 1.0);
//setthinglight(light3, brightness, 3.0);
// }
// }
//return;
# =============// attach the wrench from inventory to the middle gear
used:
// Section is executed when the user uses an inventory object.
print("used");
printint (dwGetActivateBin());
printint (getsenderid());
if (xrotate == 0)
{
if ( getinv(getlocalplayerthing(), dwGetActivatebin()) > 0) // if the bin has more than 0 in it;
{
printint (getthingsector(getlocalplayerthing()));
printint (drain_room0);
// The gear was activated
if (getthingsector(getlocalplayerthing()) == drain_room0)
{
// Player is in drain room
print ("activated wrench");
//newiwl=creatething(iwltemplate, iwlghost);
//newiws=creatething(iwstemplate, iwsghost);
//AttachThingToThing(new_iwl, gear);
//AttachThingToThing(new_iws, gear);
call handle_attach;
}
}
}
return;
//used:
//{
// if (wrenchisattached==1) // wrench is attached
// wrench=creatething(wrenchtemplate, wrenchghost);
// PlaySoundLocal(wrench_gear_attach, 1, 0, 0); // sound of wrench attaching
// AttachThingToThing(wrench_short, gear); // wrench attached to gear
// }
// return;
#==================// takes off the wrench from the inventory to the middle gear
taken:
print("taken");
printint(gear);
if (xrotate ==0)
{
if (GetSenderId()==4)
{
//gear activated
if (getthingsector(getlocalplayerthing()) ==drain_room0)
{
//player takes stuff off the gear
if (wrench_long_spindle != 0);
{
//inc. bin to add back to inv, destroy one in envir.
ChangeInv(getlocalplayerthing(), wrench_long_spindle, 1);
destroything(wrench_long_spindle_i);
destroything(wrench_short_spindle_i);
wrench_long_spindle =0;
wrench_short_spindle =0;
call update_bins;
}
}
}
}
return;
#===========================
handle_attach:
// handle attach is used to put the wrench on the lower left side of the assembly.
print("handleattach");
if (wrench_long_spindle==0) //if wrench spindle is empty
{
if (dwGetActivateBin() = bin) // if it's the "bin", for the wrench, it's bin 31
{
// The bin number from the gear is used to represent what gear is on the spindle.
// If lower_left_spindle is set to 0, then there should be no gear on the spindle. If a non-zero #,
// it represents the present gear's bin number.
wrench_long_spindle = dwGetActivateBin();
print ("wrench_on!");
//creating the wrench to get attached...
wrench_long_spindle_i = creatething (iwltemplate, i