Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Cog Error
Cog Error
2006-06-24, 11:29 AM #1
When I enter the sector that is supposed to activate the cutscene, nothing happens.

Code:
# Jedi Knight Cog Script
#
# cut1.cog
#
# Bank Cutscene
#  
# by ej_advent
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message      startup                                                          
message      entered                                                          

sector       startcutscene
                                                   
thing        cam1                                                              
thing        cam2                                                             
thing        cam3                                                              

int          old_camera                         local                         
int          player                             local                         
int          active=0                           local                         

end                                                                           

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

code

startup:

   player = GetSourceRef();

   Return;

# ........................................................................................

entered:
	if(active != 0) Return;
	active = 1;

	StopThing(player);
	selectweapon(player, 1);
	SetActorFlags(player, 0xa00000);
	old_camera = GetCurrentCamera();

	SetCameraFocus(0, cam1);
	SetCurrentCamera(0);

	Print("Jens, the receptionist told me you were coming.");
	Sleep(4.0);

	SetCameraFocus(0, cam2);
	SetCurrentCamera(0);

	Print("You unlocked my box for me?");
	Sleep(3.0);

	SetCameraFocus(0, cam1);
	SetCurrentCamera(0);

	Print("Yes. You have a key and a backpack with several data discs.");
	Sleep(4.0);

	Print("The key is for a back door into the starport, and those data discs...");
	Sleep(4.0);

	SetCameraFocus(0, cam3);
	SetCurrentCamera(0);

	Print("Don't tell me; I don't need to know.");
	Sleep(5.0);

	Print("Thanks, Ebsim. Penumbra's coming, and those discs might be important.");
	Sleep(6.0);

	SetCameraFocus(0, cam1);
	SetCurrentCamera(0);

	Print("I thought you were done with Penumbra.");
	Sleep(2.0);

	Print("I thought I was too. Hargin must have found my old journal.");
	Sleep(4.0);

	SetCameraFocus(0, cam3);
	SetCurrentCamera(0);

	Print("Good luck, Jens.  Hopefully I'll see you again soon.");
	Sleep(3.0);

	Print("That's another one I owe you, Ebsim.");
	Sleep(3.0);

        SetCameraFocus(0, player);
        SetCurrentCamera(old_camera);

	Print("Don't worry about it. You're going to have plenty on your hands.");
	Sleep(2.0);

	SetCameraFocus(0, cam1);
	SetCurrentCamera(0);

	Print("I don't want you to worry about this.");
	Sleep(2.0);

        SetCameraFocus(0, player);
        SetCurrentCamera(old_camera);
        ClearActorFlags(player, 0xa00000);

   return;	

end

[Code tags, please]
2006-06-24, 12:03 PM #2
I'm not good with level cogs, but maybe your sector symbol needs some mask flags?

Oh, and enclose your cog code with vBCode code tags next time, please...
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2006-06-24, 1:24 PM #3
I may be completely wrong, but I had problems when using Print() for output - it had a tendency to kill JK. I recommend you convert all those Print() statements to JKPrintUIString (I think that's the verb) and place all your strings in the cogstrings.ui file.

I doubt that's causing your COG to not work, but just a bit of advice.
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2006-06-24, 1:26 PM #4
I use print all the time and it's never had a problem.
I'm looking through the code to check for any syntax errors.
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2006-06-24, 1:37 PM #5
[edit] DOH! I found the problem, in the startup message there is no GetSourceRef(); if you want the player you have to use GetLocalPlayerThing(); or call the getsourceref in the entered section [/edit]


Hmm, I can't find anything wrong with it really. I have 2 suggestions for you to try though
1) change the word "active" to something else like "on" I remember that activate and activated are keywords that you can't use as variables, but I'm not sure about active. I'd just avoid using it if I were you. It's possible that if it is a keyword, then it could cause your code to not work.
2) just make sure you put in all the right numbers into the variable slots
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2006-06-25, 1:28 PM #6
So what exactly should I do? Could you post the revised code?

Oh, another thing:
I have another cutscene that isn't working. It's supposed to start at the beginning, but nothing happens and the level continues as normal.

Code:
# Jedi Knight Cog Script
#
# PENUMBRAINTRO.COG
#
# Basic cutscene cog
# 
#
#
#
#

symbols

thing camera1
thing camera2
thing camera3
thing camera4
thing camera5

flex delay
flex delay2

message startup

end

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

code
startup

// freeze Kyle
SetActorFlags(Player, 0xa00000);
StopThing(Player);


SetCameraFocus(0, camera1);
Sleep(pause2);
Print("My lord, we are approaching the target planet.");
Sleep(pause);
SetCameraFocus(0, camera2);
Print("Excellent. They cannot stop us now. Is the team ready?");
Sleep(pause);
SetCameraFocus(0, camera1);
Print("Indeed, lord. They have been outfitted and are prepared for the mission.");
Sleep(pause);
SetCameraFocus(0, camera2);
Print("Good. We will soon regain what was lost.");
Sleep(pause);
SetCameraFocus(0, camera4);
Sleep(pause);
SetCameraFocus(0, camera3);
Print("Joense, get out of here. I found out that Penumbra's coming back!");
Sleep(pause);
SetCameraFocus(0, camera5);
Print("What?! Not now!! Thanks for the tip, Jens. I need to get my stuff.");

// unfreeze's Kyle
ClearActorFlags(Player, 0xa00000);

Return;

end
2006-06-25, 1:34 PM #7
You're supposed to change the player = GetSourceRef() of your first cog into a player = GetLocalPlayerThing(). You should use a cog syntax checker (e.g. Parsec). It really helps to prevent the errors present in your second try.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2006-06-27, 12:48 AM #8
here's the first cog with the getsourceref changed to getlocalplayerthing

Code:
# Jedi Knight Cog Script
#
# cut1.cog
#
# Bank Cutscene
#  
# by ej_advent
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message      startup                                                          
message      entered                                                          

sector       startcutscene
                                                   
thing        cam1                                                              
thing        cam2                                                             
thing        cam3                                                              

int          old_camera                         local                         
int          player                             local                         
int          active=0                           local                         

end                                                                           

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

code

startup:

   player = GetLocalPlayerThing();

   Return;

# ..................................................  ......................................

entered:
	if(active != 0) Return;
	active = 1;

	StopThing(player);
	selectweapon(player, 1);
	SetActorFlags(player, 0xa00000);
	old_camera = GetCurrentCamera();

	SetCameraFocus(0, cam1);
	SetCurrentCamera(0);

	Print("Jens, the receptionist told me you were coming.");
	Sleep(4.0);

	SetCameraFocus(0, cam2);
	SetCurrentCamera(0);

	Print("You unlocked my box for me?");
	Sleep(3.0);

	SetCameraFocus(0, cam1);
	SetCurrentCamera(0);

	Print("Yes. You have a key and a backpack with several data discs.");
	Sleep(4.0);

	Print("The key is for a back door into the starport, and those data discs...");
	Sleep(4.0);

	SetCameraFocus(0, cam3);
	SetCurrentCamera(0);

	Print("Don't tell me; I don't need to know.");
	Sleep(5.0);

	Print("Thanks, Ebsim. Penumbra's coming, and those discs might be important.");
	Sleep(6.0);

	SetCameraFocus(0, cam1);
	SetCurrentCamera(0);

	Print("I thought you were done with Penumbra.");
	Sleep(2.0);

	Print("I thought I was too. Hargin must have found my old journal.");
	Sleep(4.0);

	SetCameraFocus(0, cam3);
	SetCurrentCamera(0);

	Print("Good luck, Jens.  Hopefully I'll see you again soon.");
	Sleep(3.0);

	Print("That's another one I owe you, Ebsim.");
	Sleep(3.0);

        SetCameraFocus(0, player);
        SetCurrentCamera(old_camera);

	Print("Don't worry about it. You're going to have plenty on your hands.");
	Sleep(2.0);

	SetCameraFocus(0, cam1);
	SetCurrentCamera(0);

	Print("I don't want you to worry about this.");
	Sleep(2.0);

        SetCameraFocus(0, player);
        SetCurrentCamera(old_camera);
        ClearActorFlags(player, 0xa00000);

   return;	

end


Using parsec (like zagibu suggested) here's the code for the second cog
Code:
# Jedi Knight Cog Script
#
# PENUMBRAINTRO.COG
#
# Basic cutscene cog
# 
#
#
#
#

symbols

thing camera1
thing camera2
thing camera3
thing camera4
thing camera5

flex delay
flex delay2

int player	local

message startup

end

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

code
startup:

player=GetLocalPlayerThing();

// freeze Kyle
SetActorFlags(Player, 0xa00000);
StopThing(Player);


SetCameraFocus(0, camera1);
Sleep(delay2);
Print("My lord, we are approaching the target planet.");
Sleep(delay);
SetCameraFocus(0, camera2);
Print("Excellent. They cannot stop us now. Is the team ready?");
Sleep(delay);
SetCameraFocus(0, camera1);
Print("Indeed, lord. They have been outfitted and are prepared for the mission.");
Sleep(delay);
SetCameraFocus(0, camera2);
Print("Good. We will soon regain what was lost.");
Sleep(delay);
SetCameraFocus(0, camera4);
Sleep(delay);
SetCameraFocus(0, camera3);
Print("Joense, get out of here. I found out that Penumbra's coming back!");
Sleep(delay);
SetCameraFocus(0, camera5);
Print("What?! Not now!! Thanks for the tip, Jens. I need to get my stuff.");

// unfreeze's Kyle
ClearActorFlags(Player, 0xa00000);

Return;

end


In the second one you needed to declare the player in the symbols section and set it's value with GetLocalPlayerThing. You needed a ':' after "startup" in the code section. in the symbol section you declared "delay" and "delay2" but in the code section you use "pause" and "pause2"
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2006-06-27, 12:50 AM #9
Heh, sorry I didn't even realize it were two different cogs...
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2006-06-27, 1:00 AM #10
doesn't matter, your advice is still good
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2006-06-27, 6:09 AM #11
Yeah, I already got the cogs working. Thanks for your help, though.
2006-06-27, 10:50 AM #12
no problem
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"

↑ Up to the top!