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.

ForumsJedi Knight and Mysteries of the Sith Editing Forum → spin around camera
spin around camera
2005-08-30, 5:16 PM #1
Im making a function/action that when activated it plays a key and the camera roatates around you. I know it can be done for cutscenes, but how do i do it ingame?? Any ideas?
2005-08-30, 7:26 PM #2
I did one of those for the death camera in Space Noxx II. The camera pulls back from the player while rotating around him. The camera template is a projectile which is fired backwards from the player. The camera class COG applies a sideways force from the player's RVec. Looking at the camera COG, I'm not quite sure why I did it the way I did...but it works.

Only problem is that the camera *does* slightly spiral. It's not a perfect circular movement. But the faster the pulse, the tighter the spiral. It should take some time for it to be noticable. Oh, this thing also sets the camera back to the player if it collides with something (gets destroyed).

Code:
# Jedi Knight COG Script
#
# ghostCam.COG
#
# Created by Emon.
# Feel free to use this COG as long as credit is given in the readme file.
#
# This COG is not supported by LucasArts Entertainment Co.
flags=0x240
symbols

thing			camera			local
thing			camera2			local
thing			player			local
template		ghostTpl=ghost	local
flex			k				local

message			created
message			pulse
message			removed

end

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

code

created:
	camera = getSenderRef();
	player = getLocalPlayerThing();
	setPulse(0.001);
	k = 0.15;
	return;

pulse:
	setThingLook(camera, vectorSub(getThingPos(player), getThingPos(camera)));
	if(vectorDist(getThingPos(player), getThingPos(camera)) < 0.4)
		addThingVel(camera, vectorScale(getThingRVec(camera), 0.005));
	else
	{
		if(k < 0.05)
			setThingVel(camera, vectorScale(getThingRVec(camera), 0.05));
		else
		{
			setThingVel(camera, vectorScale(getThingRVec(camera), k));
			k = k - 0.001;
		}
	}
	return;

removed:
	setCameraFocus(1, player);
	return;

end



And here's the fire projectile code:
Code:
proj = fireProjectile(player, cameraProj, -1, -1, '0 0 0', '0 0 0',
						  -1, 0x1, 0, 0);
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2005-09-03, 11:14 AM #3
Wait. I want this to be a hotkey function. I didn't see anything for an actvated command. and do I put the projectile in static.jkl??
2005-09-03, 4:51 PM #4
That's just the code from my level, you'll have to adapt it to whatever you're doing. Or write a new one. I just posted it to help.
Bassoon, n. A brazen instrument into which a fool blows out his brains.

↑ Up to the top!