PDA

View Full Version : COG help



Wolfy
06-22-2002, 08:18 AM
I have a COG that, once you talk to barkeep, you go to John and entersector, who you give a gift to in exchange for a password. Then you go to bookkeeper and he lets you in, moving sofa to reveal a secret passage. However, when I activate the barkeep, it simply runs through all of his text, when I talk to the bookkeeper, I get instant access, then I fall through the level and it plays all of the "enteresector" text.

What am I doing wrong?


# Jedi Knight Cog Script
#
# filename.cog
#
# Description
#
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message activated local
message entered local
sector entersector
thing cam1
thing cam2
thing cam3
thing cam4
thing cam5
thing barkeeper
thing bookkeeper
thing sofa
thing spawn1
thing spawn2
thing spawn3
thing spawn4
thing bombspawn
thing playertele
template bomb
template uberstormie
template explode=+xtank1_exp
surface adjoin0
int password=0 local
int job=0 local
int pass=0 local
int taken=0 local
int bothered=0 local
int allowed=0 local

end

# ================================================== ======================================

code

activated:

if(GetSenderRef()==bookkeeper) {
if(pass==0) {
if(password==0) {
SetActorFlags(Player, 0xa00000);
StopThing(Player);
SetCameraFocus(0, cam2);
Print("'Imperial base'? I'm afraid you've got the wrong man, sir. I know nothing of an Imperial base.");
ClearActorFlags(Player, 0xa00000);
SetCameraFocus(0, player);
password=1;
}
if(password==1) {
SetActorFlags(Player, 0xa00000);
StopThing(Player);
Print("Sir, I assure you, I've no idea what you're talking about. Now leave.");
ClearActorFlags(Player, 0xa00000);
SetCameraFocus(0, player);
password=2;
}
if(password==2) {
SetActorFlags(Player, 0xa00000);
StopThing(Player);
Print("Hey, buddy. Get out of my store, or I'll call the police.");
ClearActorFlags(Player, 0xa00000);
SetCameraFocus(0, player);
password=3;
}
if(password==3) {
SetActorFlags(Player, 0xa00000);
StopThing(Player);
Print("Police!");
st1 = CreateThing(uberstormie,spawn1);
st2 = CreateThing(uberstormie,spawn2);
SetActorFlags(st1, 0x8);
SetActorFlags(st2, 0x8);
ClearActorFlags(Player, 0xa00000);
SetCameraFocus(0, player);
}
}
if(pass==1) {
if(password>=1) {
Print("I was beginning to wonder whose side you were on.");
MoveThing(sofa, 1, 1);
}
if(password<1) {
Print("Good to see a fellow patriot. Go right in.");
MoveThing(sofa, 1, 1);
}
}
}

if(GetSenderRef()==barkeeper) {
if(job==0) {
if(taken<1) {
SetActorFlags(Player, 0xa00000);
StopThing(Player);
SetCameraFocus(0, cam1);
Print("You're the uh...agent, huh?");
Sleep(2.0);
MoveToFrame(cam1, 1, 2);
Print("I'm happy to help the Repub and all, but...");
Sleep(2.0);
MoveToFrame(cam1, 1, 3);
Print("...well, I got a financial problem.");
Sleep(2.0);
MoveToFrame(cam1, 1, 1);
Print("Take this gift to John McClane. I'll give you the password then.");
Sleep(2.0);
SetCameraFocus(0, player);
ClearActorFlags(Player, 0xa00000);
taken=1;
MoveToFrame(playertele, 1, 50000);
}
}
if(taken=1) {
if(job==0) {
Print("What? It's not done yet? Well, then, get out there!");
}
if(job=1) {
Print("Alright, good job. The password is CEHNEHDEH.");
pass=1;
taken=2;
}
}
}
return;

entered:
if(taken!=1) {
if(bothered<1) {
SetActorFlags(Player, 0xa00000);
StopThing(Player);
SetCameraFocus(0, cam4);
Print("What do you want?");
Sleep(1.0);
Print("Well?");
Sleep(1.0);
Print("Bah, get outta here.");
TeleportThing(player, playertele);
bothered=1;
ClearActorFlags(Player, 0xa00000);
}
if(bothered==1) {
SetActorFlags(Player, 0xa00000);
StopThing(Player);
SetCameraFocus(0, cam4);
Print("Hey, if you've got nothing, get out of here! Last warning!");
TeleportThing(player, playertele);
ClearActorFlags(Player, 0xa00000);
bothered=2;
}
if(bothered==2) {
SetActorFlags(Player, 0xa00000);
StopThing(Player);
SetCameraFocus(0, cam4);
Print("That's bloody it! Police!");
ClearActorFlags(Player, 0xa00000);
st3 = CreateThing(uberstormie,spawn3);
st4 = CreateThing(uberstormie,spawn4);
SetActorFlags(st3, 0x8);
SetActorFlags(st4, 0x8);
}
}
if(taken==1) {
if(bothered<1) {
SetActorFlags(Player, 0xa00000);
StopThing(Player);
SetCameraFocus(0, cam4);
ClearActorFlags(Player, 0xa00000);
Print("You're back. A message for John? Go on in.");
allowed=1;
}
if(bothered==1) {
SetActorFlags(Player, 0xa00000);
StopThing(Player);
SetCameraFocus(0, cam4);
Print("I should shoot you where you stand. Bah, go on in.");
ClearActorFlags(Player, 0xa00000);
allowed=1;
}
}
return;

crossed:
if(allowed==1) {
TeleportThing(player, playertele);
SetCameraFocus(0, cam5);
MoveToFrame(cam4, 1, 5);
Print("My employees outside say you have a present for me.");
Sleep(2.0);
Print("Please, set it on the table.");
Sleep(1.5);
MoveToFrame(cam5, 1, 15);
CreateThing(bomb, bombspawn);
a=1;
Sleep(1.0);
SetCameraFocus(0, cam4);
Sleep(0.5);
CreateThing(explode, john);
job=1;
}
# .................................................. ......................................

end

------------------
"Do you have any idea how long it takes to dig graves for twenty-three oak trees?"
-- Davram Bashere, The Fires Of Heaven
"She shall make you a real boy, and I shall make her a real woman."
-- Joe, A.I.

SaberMaster
06-22-2002, 01:18 PM
Fix these errors and then see. http://forums.massassi.net/html/smile.gif

messages do not use extensions. player was not defined. st1 & 2 & 3 & 4 were not defined. MoveThing() does not exist. MoveToFrame()? if(taken=1) should be if(taken == 1) if(job=1) should be if(job == 1). a is undefined. john is undefined. missing "return;" for the message, crossed. the message, crossed, is not defined.


Parsec can be a useful program. http://forums.massassi.net/html/biggrin.gif

------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

TheTwistedSpasm
06-23-2002, 06:37 AM
And again, SaberMaster and Parsec save the day! *insert cheezy hero music*

er... sorry.

TheTwistedSpasm
06-23-2002, 06:37 AM
And again, SaberMaster and Parsec save the day! *insert cheezy hero music*

er... sorry.