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 → cutscene sabercam problem
cutscene sabercam problem
2002-01-24, 5:48 PM #1
This is the first time I have made a cutscene for a level where I give the player a saber. I followed what the tutorial said to do about setting the right camera view at the end of the cutscene. For some reason it changes the camera view every time (if you are in 1st person before the cutscene you are in 3rd after it and vice versa). What's wrong?

Code:
symbols

surface		switch
message 		activated
thing			cam
thing			cam2
thing			cam3
thing			door
thing			enemy1
thing			enemy2
thing			enemy3
thing       	pos                              desc=generator_ghost
template    	enemyTpl                         desc=enemy_to_generate
thing				player			local
sound			snd1
int			done=0			local
flex			cspeed=5.0
int			Player			local
int			check				local
int         	enemy                   local

end

code

activated:

if (done == 0)
      {
	check = GetSenderRef();
	if (check == switch)
		{
		Player = GetLocalPlayerThing();

		SetActorFlags(Player, 0xa00000);
		StopThing(Player);
		Print("The hangar doors are now open.");

		SetCameraFocus(0, cam);
		SetCurrentCamera(0);

		Sleep(2.0);

		MoveToFrame(cam, 1, cspeed);
		Sleep(2.0);
		enemy = CreateThing(enemyTpl, pos);
		AISetMoveSpeed(enemy2, 1);
		AISetLookFrame(enemy2, 1);
		AISetMoveFrame(enemy2, 1);
		Print("Don't move scum!");
		Sleep(2.0);
		MoveToFrame(cam, 2, cspeed);
		Sleep(1.0);
		Print("I don't know who you are, but you aren't getting out of here.");
		Sleep(6.0);
		PlaySoundLocal(snd1, 1, 0, 132);
		Sleep(1.0);
		PlaySoundLocal(snd1, 1, 0, 132);
		Sleep(1.0);
		PlaySoundLocal(snd1, 1, 0, 132);
		Sleep(1.0);
		Print("What's that?");
		Sleep(3.0);
		SetCameraFocus(0, cam2);
		SetCurrentCamera(0);
		Sleep(2.0);
		Print("An Imperial Star Destroyer just entered the sector!");
		Sleep(2.0);
		SetCameraFocus(0, cam);
		SetCurrentCamera(0);
		Sleep(3.0);
		Print("They're launching fighters and landing craft.");
		Sleep(2.0);
		Print("Scramble the fighters. Prepare to repel boarding parties.");
		Sleep(4.0);
		SetCameraFocus(0, cam3);
		SetCurrentCamera(0);
		Sleep(1.0);
		Print("Great, stuck between the pirates and the Imps!");
		Sleep(2.0);
		Print("Maybe I can get back to my ship and get away in the confusion.");
		Sleep(3.0);
		SetCameraFocus(0, jkGetLocalPlayer());

		If (jkGetSaberCam() == 1)
		{
		CycleCamera();
		}
		DestroyThing(cam);

		// unfreeze Kyle and enemies
		ClearActorFlags(Player, 0xa00000);
		AIClearMode(enemy1, 0x2000);
		AISetMode(enemy1, 0x200);
		AIClearMode(enemy2, 0x2000);
		AISetMode(enemy2, 0x200);
		AIClearMode(enemy3, 0x2000);
		AISetMode(enemy3, 0x200);

		done = 1;
		}
	}

return;

end


------------------
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.

The Massassi A SW Galaxies Player Association
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net For all your Star Wars Galaxies needs
The Massassi A SW Galaxies Player Association
2002-01-25, 4:11 AM #2
Hmm, not sure what you're trying to do with the camera. Where does the player get the saber? Why do you care about the sabercam option?

Anyway, I don't like the method. Instead of waiting a few seconds and then switching the camera back to internal, run a fast pulse to cycle the camera back to internal if the player tries to switch.
Code:
pulse:
   if(GetCurrentCamera() != 0) CycleCamera();

Return;


Then at the end of your cutscene, stop the pulse and set the camera to what you want. To restore the player's original camera, assign a variable to GetCurrentCamera() under the player definition and cycle the camera if the variable is not equal to the currentcam at the end of the cutscene. But if you just want external, use:
Code:
if(GetCurrentCamera() == 0) CycleCamera();
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-01-25, 12:41 PM #3
I want the camera to return to whatever the player was using before the cutscene started. You've given me an idea on how to fix it. Thanks.

------------------
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.

The Massassi A SW Galaxies Player Association
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net For all your Star Wars Galaxies needs
The Massassi A SW Galaxies Player Association
2002-01-25, 1:39 PM #4
Glad I could help [http://forums.massassi.net/html/wink.gif]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-01-25, 4:11 PM #5
Quote:
<font face="Verdana, Arial" size="2">Originally posted by MikeC:
...camera to return to whatever the player was using before the cutscene started...</font>



A excellent idea. I applaud you.



------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2002-01-26, 5:44 PM #6
WHOA - The tutorial is wrong! No wonder it wasn't working. I was looking through the JKSpecs and found this:

The jkgetsabercam() verb is used to tell if the external camera comes on automatically when you select the saber.

I'm changing it to use an int and the getcurrentcam() verb. I still don't quite have it working yet but I'm on the way.

------------------
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.

The Massassi A SW Galaxies Player Association
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net For all your Star Wars Galaxies needs
The Massassi A SW Galaxies Player Association
2002-01-27, 12:22 PM #7
Just use:

old_cam = GetCurrentCamera(player);

then:

SetCurrentCamera(player, old_cam);

------------------
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

-Tazz
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2002-01-27, 12:50 PM #8
Thanks Tazz. That may be the shortcut I was looking for.

------------------
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.

The Massassi A SW Galaxies Player Association
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net For all your Star Wars Galaxies needs
The Massassi A SW Galaxies Player Association
2002-01-28, 5:06 AM #9
If you use SetCurrentCamera() to change the camera, the F1 key won't realize the view has changed. Use CycleCamera().

Try this cog:

Code:
#--------------------------------------------------------------
symbols
surface	switch
message	startup
message	activated
message	pulse
thing		cam
thing		cam2
thing		cam3
thing		door
thing		enemy1
thing		enemy2
thing		enemy3
thing		pos			desc=generator_ghost
template	enemyTpl		desc=enemy_to_generate
thing		player		local
sound	snd1
int		done		local
int		oldcam		local
flex		cspeed=5.0
int		Player		local
int		check		local
int		enemy		local
end
#--------------------------------------------------------------
code
#--------------------------------------------------------------
startup:
	done=0;

Return;
#--------------------------------------------------------------
activated:
	if(GetSenderRef() != switch || done) Return;
	done=1;
	oldcam=GetCurrentCamera();
	SetPulse(0.1);
	Player = GetLocalPlayerThing();
	SetActorFlags(Player, 0xa00000);
	StopThing(Player);
	Print("The hangar doors are now open.");
	SetCameraFocus(0, cam);
	Sleep(2.0);
	MoveToFrame(cam, 1, cspeed);
	Sleep(2.0);
	enemy = CreateThing(enemyTpl, pos);
	AISetMoveSpeed(enemy2, 1);
	AISetLookFrame(enemy2, 1);
	AISetMoveFrame(enemy2, 1);
	Print("Don't move scum!");
	Sleep(2.0);
	MoveToFrame(cam, 2, cspeed);
	Sleep(1.0);
	Print("I don't know who you are, but you aren't getting out of here.");
	Sleep(6.0);
	PlaySoundLocal(snd1, 1, 0, 132);
	Sleep(1.0);
	PlaySoundLocal(snd1, 1, 0, 132);
	Sleep(1.0);
	PlaySoundLocal(snd1, 1, 0, 132);
	Sleep(1.0);
	Print("What's that?");
	Sleep(3.0);
	SetCameraFocus(0, cam2);
	Sleep(2.0);
	Print("An Imperial Star Destroyer just entered the sector!");
	Sleep(2.0);
	SetCameraFocus(0, cam);
	Sleep(3.0);
	Print("They're launching fighters and landing craft.");
	Sleep(2.0);
	Print("Scramble the fighters. Prepare to repel boarding parties.");
	Sleep(4.0);
	SetCameraFocus(0, cam3);
	Sleep(1.0);
	Print("Great, stuck between the pirates and the Imps!");
	Sleep(2.0);
	Print("Maybe I can get back to my ship and get away in the confusion.");
	Sleep(3.0);
	SetCameraFocus(0, player);
	SetPulse(0);
	if(GetCurrentCamera() != oldcam) CycleCamera();
	DestroyThing(cam);
	ClearActorFlags(Player, 0xa00000);
	AIClearMode(enemy1, 0x2000);
	AISetMode(enemy1, 0x200);
	AIClearMode(enemy2, 0x2000);
	AISetMode(enemy2, 0x200);
	AIClearMode(enemy3, 0x2000);
	AISetMode(enemy3, 0x200);

Return;
#--------------------------------------------------------------
pulse:
	if(GetCurrentCamera() != 0) CycleCamera();

Return;
#--------------------------------------------------------------
end


The pulse will set the camera to internal every tenth of a second. When the cutscene ends, the pulse is stopped and the camera is set back to its original view.

done is set to 0 on startup because variable values are not reset until you quit the game.

Good luck [http://forums.massassi.net/html/wink.gif]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-01-29, 3:25 PM #10
Thanks guys. It works great now!! [http://forums.massassi.net/html/biggrin.gif]

------------------
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.

The Massassi A SW Galaxies Player Association
Have Lightsaber Will Travel JK Editing tips, troubleshooting information, resources and more.
www.swgalaxies.net For all your Star Wars Galaxies needs
The Massassi A SW Galaxies Player Association

↑ Up to the top!