Pascal--nonrecruitment thread

The CAM_ functions, IIRC, are from Prophecy - they do not work at all in Secret Ops, because the programmers disabled them after putting in the improved SF_CAM functions.

As for what you're doing wrong... well, camera functions work only when used by a camera object.
 
ohh boy :rolleyes:

That makes since, but I always considered the player to be a camera.
Here we go again.

--Hurry up with that patch man! :mad: This question\problem would have been avoided otherwise :D

--I know you are really busy, though. ;)
With what, I have no idea: work, moorrrrreeee classes, maybe a busy life-style *please fill us in :p *--
 
Well, in the past few days, specifically, I've been busy installing stuff. It just so happens that that Sasser worm that appeared last saturday, in combination with the general poor state of Windows on my machine, forced me to reformat and reinstall everything.
 
Man, that is just nasty. Sorry.

How do you implement the cam, because I do not want to spend hours figuring this one out. This whole cam thing really confuses me. Also, what all can you stick in the Swtitch player cam function for that CAMID field: I know there is chase and the four regular views, but how do you implement the POV cam, the track cam, and the object cam for different ships. I have tried different things but nothing works for the player's ship.
 
The syntax for the Switch function is as follows:
SF_PlayerSwitchToCam(tag, mode);
...But then, you probably already knew that, since that's from wcp.pas. In any case, what this means is that if you want to switch to chase view of a ship other than the player, you enter that ship's name as the 'tag' variable, followed by the correct mode. This may or may not work - it seems that only some modes allow a view from a ship other than the player. I know this is definitely the case for the cockpit view, but I don't remember what the situation is for any of the others.

As for the other modes, check consts.pas - there are declared constants for all known modes there.

Finally, camera. Dead simple stuff - you declare a camera object. For example:

object Camera_1(Camera)
x: 0;
y: 0;
z: 0;
main: M_Camera_1;
end;

You can also give it a direction, and of course you can set up its x,y,z coordinates to some place other than 0,0,0 - but you can also do all this in the main function, which is my personal preference. With the main function, just one thing to keep in mind - once you activate the camera (I always use SF_ActivateSelf, but I don't remember why any more - might be just preference, or it might be that SF_ActivateObject doesn't work for cameras), you start seeing through it. I guess that probably deactivating the camera returns you to the player view, but I've never bothered checking - it's just common sense to return to player view before deactivating the camera. Other than that, just set up the camera's position and angle, and use the SF_CAM_ commands to pan or move the camera. And of course, AI_WaitSeconds if you want to hold a particular view for a while.
 
ahaaaaahhhhhhh!!!!!!!!!!!!!!!!!!!

WHAT IS WITH THIS DAMN CAMERAS!!

I set the object as camera, give it coordinates in the second nav and set its direction, give it a function and set the variable to true. What is the problem:

object cam(camera)
x: 200200;
y: 10000;
z: 00;
main: M_Cam;
direction: 0,0,0;
end;

function M_player;
begin
SF_SetObjectFlag (OF_alignment, ALIGN_Confed);
SF_ActivateSelf(0);
SF_PlayerSwitchToCam(CamID_chase, player);
//if(var) then begin
//SF_SetActiveCamera(Cam);//SF_PlayerSwitchToCam(6, Wing1);
//AI_WaitSeconds(1);
//end;
while(1) do
AI_WaitSeconds(1);
end;

function M_Nav1;
var
setup2 = 1;
begin
while(1) do begin
if(NAV_WithinSphere(player)) then begin
Nav_ActivateSelf;
if (setup2) then begin
var2 := 1;
AI_WaitSeconds(3);
var := true;
setup2 := 0;
end;
if (NAV_WithinSphere(player) = 0) then begin
NAV_DeactivateSelf;
end;
if(Nav_WithinSphere(player)) then begin
AI_WaitSeconds(1);
end;
NAV_SetPlayerNav(3);
end;
end;
end;

function M_Cam;
begin
if(var) then begin
SF_ActivateSelf(0);
SF_CAM_SetPos(200200, 10000, 0);
SF_CAM_TrackObj(Wing1);
AI_WaitSeconds(3);
var := false;
end;
while(1) do
AI_WaitSeconds(1);
end;
 
That's a good question - what is the problem? I can only help you fix a bug when I've been told what the bug is.
 
I don't know where is the bug, but I could give you a little counsel:
Put SYS_Message(anynumber); on each code doubt and you'll know where the code fail. :)


TanGO
 
The bug is a dead simple one. Just look at the camera function again. The first thing the game does in the camera function is check if var is true. Since var is not true, it goes on with the rest of the function, getting into the while (1) loop and staying there. In short, you're using if where you should be using until or while. Replace "if (var) then begin" with "until (var) do AI_WaitSeconds(1)" and it will work. Just don't forget to remove "end" as well.
 
until huh, I really don't get what the difference is between an until and if. Which is used where--in most common cases.
 
Just think of the actual english meanings of the words. That's the basic gist... If does things if the logical statement is true. Until, I assume, loops until the logical statement is true
 
Back
Top