Skip to content

GestaltStartCutscene & SetCameraFacing issues

JediMindTrixJediMindTrix Member Posts: 305
edited September 2019 in Builders - Scripting
I for the life of me cannot seem to get this to work. Same with it's Gestalt equivalent.
SetCutsceneMode(oPC, TRUE, FALSE);
SetCameraFacing(180.0, 20.0, 20.0, CAMERA_TRANSITION_TYPE_SNAP);


There's a barebones example ^
#include "in_g_cutscene"

void PlayStartingCutscene(object oPC)
//Prologue Initial Cutscene, Module Load essentially

{
//Do once stuff
    if (GetLocalInt(oPC,"iCutscene01Viewed") > 0)
        { return; }

    SetLocalInt(oPC,"iCutscene01Viewed",1);

    GestaltStartCutscene(GetFirstPC(), "PrologueCutscene", TRUE, TRUE, FALSE, TRUE, TRUE);
    GestaltCameraFacing(0.01, 180.0, 4.0, 20.0, oPC);
    GestaltActionAnimate(0.00, oPC, ANIMATION_LOOPING_DEAD_BACK, 5.5);
    GestaltCameraFade(0.0, oPC, FADE_IN, FADE_SPEED_SLOW, 4.0, 0);
//   GestaltActionAnimate(5.11, oPC, ANIMATION_FIREFORGET_HEAD_TURN_LEFT, 1.00);
//   GestaltActionAnimate(6.11, oPC, ANIMATION_FIREFORGET_HEAD_TURN_RIGHT, 1.00);
//    GestaltActionAnimate(7.11, oPC, ANIMATION_LOOPING_LOOK_FAR, 3.0);
//    GestaltCameraFace(5.5, oPC, 4.0, 20.0,
//                      GetObjectByTag("nc_prologcam001"), 3.0, 50.0,
//                      5.61, 30.0,
//                      oPC, 0, 0, 0);
    GestaltStopCutscene(10.11, oPC);
//Character on back towards sky
//Slowly rises to feet
//Looks around, pan camera 180 degree at fair speed
//Start conversation
//Do once stuff here
}

No matter what I seem to do I cannot seem to make the 'direction' part of either function to, well, function. Pitch and zoom work, camera direction does not. For that matter, Zoom doesn't seem to be working either. What am I doing wrong?

It triggers from a, heh, trigger. OnEnter, when/where the area loads

please help
Post edited by JediMindTrix on

Comments

  • ProlericProleric Member Posts: 1,283
    edited September 2019
    Try delaying the cutscene by 2 seconds.

    I find that a 2 second delay is necessary on entering an area before starting a cutscene, conversation, or anything else that depends in any way on the position of the PC.

    The reason is that when an area is first loaded, the PC's location is (0 0 0) for some reason.

    In the case of SetCameraFacing, since the script is being run by a trigger, you also need to specify which PC's camera is affected:
    AssignCommand(oPC, ActionDoCommand(SetCameraFacing(...)));
    
    Post edited by Proleric on
  • JediMindTrixJediMindTrix Member Posts: 305
    Proleric wrote: »
    Try delaying the cutscene by 2 seconds.

    I find that a 2 second delay is necessary on entering an area before starting a cutscene, conversation, or anything else that depends in any way on the position of the PC.

    The reason is that when an area is first loaded, the PC's location is (0 0 0) for some reason.

    In the case of SetCameraFacing, since the script is being run by a trigger, you also need to specify which PC's camera is affected:
    [code]
    AssignCommand(oPC, ActionDoCommand(SetCameraFacing(...)));
    [/code

    I've tried this script with both a delay before execution and by moving it into a trigger that I would have to move into manually after loading the module with the same end results :/

    Right now I'm using GetFirstPC() as it's a SP module, also with the same end result
  • JediMindTrixJediMindTrix Member Posts: 305
    Proleric wrote: »
    Try delaying the cutscene by 2 seconds.

    I find that a 2 second delay is necessary on entering an area before starting a cutscene, conversation, or anything else that depends in any way on the position of the PC.
    [/code

    I placed a two second delay on the actual function itself, inside of the cutscene, and this seemed to do the trick. Thanks for the idea!
Sign In or Register to comment.