|
This function provides a simple way of turning the camera so that it moves from pointing towards one object to another. Here is an example of how the function can be called from your own script -
#include "in_g_cutscene"
void main()
{
object oPC = GetFirstPC();
object oBob = GetObjectByTag("bob");
object oJoe = GetObjectByTag("joe");
GestaltStartCutscene(oPC, "facecam");
GestaltCameraFace (0.0,
oBob, 15.0, 50.0,
oJoe, 15.0, 50.0,
2.5, 20.0,
oPC,
0, 1, 0);
GestaltStopCutscene (2.5, oPC);
}
What does this all do?
So now we can see that the example script above causes the camera to turn from facing an object called "bob" to facing another object called "joe", with the camera 15.0 units from the player and 50.0 degrees from the vertical throughout the movement. It takes 2.5 seconds to do this, moving the camera 20.0 times per second to give a nice smooth motion. The last two lines show that the movement is only applied to the first player in the player list, that the camera turns anti-clockwise, and that both the player and the camera are turned simultaneously.
Here are a few more example scripts. Feel free to edit the camera test module to replace the existing g_facecam function with the code samples listed below to see what they do, or try experimenting with it yourself.
#include "in_g_cutscene"
void main()
{
object oPC = GetFirstPC();
object oBob = GetObjectByTag("bob");
GestaltStartCutscene(oPC, "facecam");
GestaltCameraFace (oBob, 15.0, 0.0,
oBob, 10.0, 50.0,
5.0, 20.0,
oPC);
GestaltStopCutscene (5.0, oPC);
}
Here we have set the starting and ending objects to be the same. This means that the camera will face "bob" throughout the motion, and only the tilt and zoom of the camera will be adjusted. Here we start 15.0 units directly above the player and gradually swing down until we're 5.0 units from the player 50.0 degrees from the vertical. The motion takes 5.0 seconds, and because there is no horizontal component to the movement we aren't moving the player, only the camera. We're leaving all three integer options at their default values in this example, so there's no need to list them when we call the function - the game will fill in the blanks for us.
#include "in_g_cutscene"
void main()
{
object oPC = GetFirstPC();
object oBob = GetObjectByTag("bob");
object oJoe = GetObjectByTag("joe");
GestaltStartCutscene(oPC, "facecam");
GestaltCameraFace (0.0,
oBob, 15.0, 0.0,
oJoe, 10.0, 50.0,
2.5, 20.0,
oPC);
GestaltStopCutscene (2.5, oPC);
}
Here we combine the previous two examples to produce a more complex movement - turning from "bob" to "joe" while also moving the camera down from a wide overhead shot to a close-up nearer the ground. Again we've left all the options at their default values of 0, so only the camera will move - the player it belongs to will remain facing in the same direction throughout.
#include "in_g_cutscene"
void main()
{
object oPC = GetPCSpeaker();
object oBob = GetObjectByTag("bob");
object oJoe = GetObjectByTag("joe");
GestaltCameraFace (0.0
oBob, 0.0, 0.0,
oJoe, 0.0, 0.0,
2.5, 2.0,
oPC,
0, 2, 1);
}
Here we have set the iFace option to 2 and iParty to 1. This means that every player in the selected PC's party will turn from Bob to Joe while their camera remains stationary. Because we're not moving the camera we don't need to worry about the range and tilt settings, although the numbers must still be included - I've set them all to 0.0.
#include "in_g_cutscene"
void main()
{
object oPC = GetFirstPC();
object oBob = GetObjectByTag("bob");
object oJoe = GetObjectByTag("joe");
object oLarry = GetObjectByTag("larry");
GestaltStartCutscene(oPC, "facecam");
GestaltCameraFace (0.0,
oBob, 15.0, 50.0,
oBob, 15.0, 50.0,
1.0, 1.0,
oPC, 0, 1);
GestaltSpeak (0.0, oBob, "Shish-ka-bob");
GestaltCameraFace (2.0,
oBob, 15.0, 50.0,
oJoe, 15.0, 50.0,
2.5, 20.0,
oPC, 0, 1);
GestaltSpeak (4.5, oJoe, "Shish-ka-joe");
GestaltCameraFace (6.5,
oJoe, 15.0, 50.0,
oLarry, 15.0, 50.0,
2.5, 20.0,
oPC, 0, 1);
GestaltSpeak (9.0, oLarry, "Shish-ka-larry");
GestaltStopCutscene (11.0, oPC);
}
Our final example is more complex - this is the script which produces the camera movement you get when you click on the banner in the northwest corner of the starting area of the "in_g_cutscene_camera" demo module.
|