Cutscene Help Needed!

I know this is a lot to ask of anyone, but here goes nothing:
I’ve got a ballroom map with a ##$$% cutscene. I’ve tried and am struggling mightily with coding it. If anyone with XP using the Gestalt cutscene system is available, I really could use the help. :face_with_monocle:
So, here goes. I’ll trying as best I can to describe the desired camera movements. (Feels like I’m ordering at McDonalds or something).
I would like a fade in/out, then on a zip line rush to the back of the room to the figure seated on his throne. Then slowly raise the camera level and do a 360* panorama finally landing the camera back on the PC. Then the PC should jump to a new location. End cutscene. In total, the scene should probably last about 5-7 seconds.
Anyway, I’ve been at this for days and it’s really bogging my progress down. Any help would be awesome and greatly appreciated.
Zeph



I’ve been using GetEnteringObject() to start the cutscene.

This is what I’ve got so far, and it’s a mess! :slight_smile:

#include "in_g_cutscene"
void main()
{

    object oPC = GetEnteringObject();

    // Only fire for (real) PCs.
    if ( !GetIsPC(oPC)  ||  GetIsDMPossessed(oPC) )
        return;

    // Only fire once.
    if ( GetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF)) )
        return;
    SetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);

    // Begin Cutscene mode.
    FadeToBlack(oPC, FADE_SPEED_MEDIUM);
    DelayCommand(5.0, FadeFromBlack(oPC, FADE_SPEED_SLOWEST));

    DelayCommand(5.5, AssignCommand(oPC, ClearAllActions()));

    DelayCommand(5.8, AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_CUSTOM2, 1.0, 6000.0)));
    DelayCommand(6.5, SetCutsceneMode(oPC, TRUE, FALSE));

    // Begin Music.
    AssignCommand(oPC, PlaySound("holy_diver"));

    // Begin Camera movements.
    GestaltCameraMove(6.5, 90.0, 3.0, 45.0, 90.0, 2.0, 30.0, 1.5, 144.0, oPC, 0, 0, 0);

    // Begin "Waltz" music.
    DelayCommand(28.0, SoundObjectPlay(GetNearestObjectByTag("WALTZ")));
    DelayCommand(37.0, SoundObjectStop(GetNearestObjectByTag("WALTZ")));

    DelayCommand(44.0, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectCharmed(), oPC, 4.0));

    DelayCommand(45.0, AssignCommand(oPC, ClearAllActions()));
    location lLoc = GetLocation(GetWaypointByTag("WP_TUNNEL_03"));
    DelayCommand(46.0, AssignCommand(oPC, JumpToLocation(lLoc)));

    DelayCommand(47.0, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect
    ( VFX_IMP_DUST_EXPLOSION), lLoc));

    DelayCommand(48.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectKnockdown(), oPC, 7.0));

    // End cutscene functions.
    DelayCommand(49.0, SetCutsceneMode(oPC, FALSE, TRUE));
}

All I really need is the camera movements. I can take care of the rest…
Link to Gestalt Cutscene System : Gestalt Cutscene Scripting System | The Neverwinter Vault

Maybe this is of help: Gestalt Cutscene System - updated pdf | The Neverwinter Vault
It’s by @jimdad55 ! He made use of the system in his module(s) and maybe he can help some more, if you contact him.

I’ve changed things up a bit from the script above. I’ve another question.
In this script, I’d like for the PC to dance some custom dance animations. How do I get her to dance? She’s doing nothing. Ive tried ClearAllActions(), SetCommandable() - I can’t get her to dance.
Funny thing is, I’ve had her dancing before, but I don’t remember how I achieved success… :alien:

#include "in_g_cutscene"

void main()
{
    object oPC = GetEnteringObject(); // Get Who triggered the event.
    if (!GetIsPC(oPC)) return; // Valid PC check.

             // Declare the host of the ball.
             object oZuul = GetObjectByTag("AZASH_ZUUL001");

        // Set to run script only once.
        if ( GetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF)) )
        return;
             SetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);

        // Apply a cinematic fade.
        DelayCommand(0.5, FadeToBlack(oPC, FADE_SPEED_MEDIUM));
        DelayCommand(5.5, FadeFromBlack(oPC, FADE_SPEED_SLOWEST));

        DelayCommand(5.5, SetCutsceneMode(oPC, TRUE));

    DelayCommand(0.3, AssignCommand(oPC, PlaySound("holy_diver"))); // Begin ambient music.

                    // Start camera work.
                    GestaltCameraMove // Camera block 1.
                    (5.0, 90.0, 3.0,
                    60.0, 85.0, 6.0, 40.0,
                    8.0, 144.0, oPC, 0, 0, 0);
                    //////////////////////////
                    GestaltCameraSmooth // Camera block 2.
                    (8.0, 3.0, 3.0,
                    3.0, 2.0, 3.0, 3.0,
                    1.5, 144.0, oPC, 0);
                    /////////////////////////
                    GestaltCameraSetup // Camera block 3.
                    (9.5, oPC, 85.0, 5.0, 60.0);

     // Start dance animation.
    DelayCommand(10.3, AssignCommand(oPC, ClearAllActions()));
    DelayCommand(10.6, SetCommandable(TRUE, oPC));
    DelayCommand(11.0, AssignCommand(oPC, 
    ActionPlayAnimation(ANIMATION_LOOPING_CUSTOM2)));

    DelayCommand(20.0, SetCutsceneMode(oPC, FALSE)); // End cutscene mode.
}

When the animation code runs, she twitches once like she wants to dance but in the end, not so much!

Thanks guys...

ActionPlayAnimation(ANIMATION_LOOPING_CUSTOM2, 1.0, 999000.0)));

… assuming you have a dance animation in custom slot 2 of the non-combat supermodel … It’s not there by default.

I do. Mmat had it right.

Ok. So I hope some of you come along for the ride, because this script keeps pissing me off! :confounded:
The latest hiccup is the .wav file “ball_room.” I can’t get it to fire.

code:

void PrepForDestruction(object oTarget)
{
    SetPlotFlag(oTarget, FALSE);
    SetImmortal(oTarget, FALSE);
    AssignCommand(oTarget, SetIsDestroyable(TRUE, FALSE, FALSE));
}
void SureDestroy()
{
   object oTarget = GetNearestObjectByTag("WALTZ");
   PrepForDestruction(oTarget);
   DestroyObject(oTarget);
}

#include "in_g_cutscene"

void main()
{
    object oPC = GetEnteringObject(); // Get Who triggered the event.
    if (!GetIsPC(oPC)) return; // Valid PC check.

             // Declare the host of the ball.
             object oZuul = GetObjectByTag("AZASH_ZUUL001");

        // Set to run script only once.
        if ( GetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF)) )
        return;
             SetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);

        // Apply a cinematic fade.
        DelayCommand(0.5, FadeToBlack(oPC, FADE_SPEED_MEDIUM));
        DelayCommand(5.5, FadeFromBlack(oPC, FADE_SPEED_SLOWEST));

        DelayCommand(5.5, SetCutsceneMode(oPC, TRUE));

        location lLoc;
        lLoc = GetLocation(GetWaypointByTag("CUTSCENE_LOC"));

    DelayCommand(0.3, AssignCommand(oPC, PlaySound("holy_diver"))); // Begin ambient music.

                    // Start camera work.
                    GestaltCameraMove // Camera block 1.
                    (5.0, 90.0, 3.0,
                    60.0, 85.0, 6.0, 40.0,
                `   8.0, 144.0, oPC, 0, 0, 0);
                    //////////////////////////
                    GestaltCameraSmooth // Camera block 2.
                    (8.0, 3.0, 3.0,
                    3.0, 2.0, 3.0, 3.0,
                    1.5, 144.0, oPC, 0);
                    /////////////////////////
                    GestaltCameraSetup // Camera block 3.
                    (9.5, oPC, 85.0, 5.0, 60.0);

                     // Start dance animation.
    DelayCommand(10.3, AssignCommand(oPC, ClearAllActions()));
    DelayCommand(11.0, AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_CUSTOM2, 1.0, 999000.0)));

    // Start sound object "WALTZ".
    DelayCommand(28.0, SoundObjectPlay(GetNearestObjectByTag("WALTZ")));

    // Begin talk que.
    DelayCommand(32.0, AssignCommand(oPC, SpeakString("Why am I dancing?" )));
    DelayCommand(38.0, AssignCommand(oPC, SpeakString("Why am I naked?")));
    DelayCommand(44.0, AssignCommand(oPC, SpeakString("Where am I?")));

    // Stop "Waltz".
     DelayCommand(49.0, SoundObjectStop(GetNearestObjectByTag("WALTZ")));

    // Start "Ballroom Blitz".
    DelayCommand(51.0, AssignCommand(oPC, PlaySound("ball_room")));

    DelayCommand(79.0, AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 3.0)));

    DelayCommand(79.0, AssignCommand(oPC, ClearAllActions()));

    DelayCommand(79.0, SetCutsceneMode(oPC, FALSE)); // End cutscene mode.

    DelayCommand(82.0, AssignCommand(oPC, JumpToLocation(lLoc)));

    DelayCommand(79.0, SureDestroy());
}

Would I have to stop the PC’s dance animations for the sound file to play??? If so, I’m uncertain how to do this… :frowning:
Niz out.

You’re right.

Better to use SoundObjectPlay, as you do earlier.

The PC won’t do any more actions until you clear the dance animation. PlaySound doesn’t look like an action, but behaves somewhat like one, as the Lexicon explains.

@Proleric
By the way:
I encountered problems with stopping long lasting animations. ClearAllActions seams not to be reliable. The safest way seem to be to issue a command to do a different animation, something as “look right” for a second. Any Idea to this?

You’re right.

I’ve always found that ClearAllActions(TRUE) stops animations.

However, it’s prudent to issue a new animation - I use PAUSE - very briefly, otherwise frames of the old animation can start to appear.

For example, clear animation & walk to a waypoint can result in some animated frames at the destination.

I’m no expert, but I think the problem is that some animations don’t have the full set of “start”, “continue” and “stop” sequences that they should (or don’t fully clear out all three parts of the old animation).

Closely related - when no PC is in an area, it pays to cancel certain animations (e.g. sitting) and reboot them on PC entry, otherwise, in debug mode, the chat log is flooded with AI overflows.

I never tried the TRUE in the brackets. Should be that easy? I’ll test that.

Closely related - when no PC is in an area, it pays to cancel certain animations (e.g. sitting) and reboot them on PC entry, otherwise, in debug mode, the chat log is flooded with AI overflows.

Huh? I never encountered such a thing. I issue the command sit or sitcross for a endless time on spawn, that’s all. Never found an overflow caused by this.

Question: In the above script I’ve it set so that (for now)) two actors are supposed to spawn in and start brawling with each other.
Now that being said, Cutscene() mode is enabled and I don’t know why they won’t fight? Is it because of CutsceneMode()? Or is something else going on?

void PrepForDestruction(object oTarget)
{
    SetPlotFlag(oTarget, FALSE);
    SetImmortal(oTarget, FALSE);
    AssignCommand(oTarget, SetIsDestroyable(TRUE, FALSE, FALSE));
}
void SureDestroy()
{
   object oTarget = GetNearestObjectByTag("WALTZ");
   PrepForDestruction(oTarget);
   DestroyObject(oTarget);
}

#include "nw_i0_2q4luskan"
#include "in_g_cutscene"

// Variable stack.
location lRowdy1;
location lRowdy2;
location lRowdy3;
location lRowdy4;

object oBrawler1;
object oBrawler2;
object oBrawler3;
object oBrawler4;

void main() // Begin main function.
{
    object oPC = GetEnteringObject(); // Get Who triggered the event.
    if (!GetIsPC(oPC)) return; // Valid PC check.

             // Declare the host and his consort.
             object oZuul = GetObjectByTag("AZASH_ZUUL001");
             object oConsort = GetObjectByTag("CONSORT");

        // Set to run script only once.
        if ( GetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF)) )
        return;
             SetLocalInt(oPC, "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);

             SetLocalInt(oPC, "SCRIPT_FIRED", 1);

        // Apply a cinematic fade.
        BlackScreen(oPC);

        SoundObjectPlay(GetNearestObjectByTag("GHOST_LAUGH"));
                    DestroyObject(GetNearestObjectByTag("GHOST_LAUGH"), 3.0);

        DelayCommand(5.0, FadeFromBlack(oPC, FADE_SPEED_SLOWEST));

        // Begin Cutscene.
        DelayCommand(5.5, SetCutsceneMode(oPC, TRUE));

        location lLoc;
        lLoc = GetLocation(GetWaypointByTag("CUTSCENE_LOC"));
        lRowdy1 = GetLocation(GetWaypointByTag("ROWDY_01"));
        lRowdy2 = GetLocation(GetWaypointByTag("ROWDY_02"));
        lRowdy3 = GetLocation(GetWaypointByTag("ROWDY_03"));
        lRowdy4 = GetLocation(GetWaypointByTag("ROWDY_04"));

        oBrawler1 = GetObjectByTag("BRAWLER_01");
        oBrawler2 = GetObjectByTag("BRAWLER_02");
        oBrawler3 = GetObjectByTag("BRAWLER_03");
        oBrawler4 = GetObjectByTag("BRAWLER_04");

    DelayCommand(2.5, AssignCommand(oPC, PlaySound("holy_diver"))); // Begin ambient music.

                    // Start camera work.
                    ///////////////////////////
                    GestaltCameraMove /Camera block 1.
                    (5.0, 90.0, 3.0,
                    60.0, 85.0, 6.0, 40.0,
                `   8.0, 144.0, oPC, 0, 0, 0);
                    //////////////////////////
                    GestaltCameraSmooth // Camera block 2.
                    (8.0, 3.0, 3.0,
                    3.0, 2.0, 3.0, 3.0,
                    1.5, 144.0, oPC, 0);
                    /////////////////////////
                    GestaltCameraSetup // Camera block 3.
                    (9.5, oPC, 85.0, 5.0, 60.0);

                     // Start dance animation.
    DelayCommand(10.3, AssignCommand(oPC, ClearAllActions()));
    DelayCommand(11.0, AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_CUSTOM2, 1.0, 999000.0)));

    // Start sound object "WALTZ".
    DelayCommand(28.0, SoundObjectPlay(GetNearestObjectByTag("WALTZ")));

    // Begin talk que.
    DelayCommand(32.0, AssignCommand(oPC, SpeakString("Why am I dancing?" )));
    DelayCommand(34.0, AssignCommand(oZuul, SpeakString("Because I commanded it be." )));
    DelayCommand(38.0, AssignCommand(oPC, SpeakString("Why am I naked?")));
    DelayCommand(39.0, AssignCommand(oZuul, SpeakString("Because you are meant to, amuse.")));
    DelayCommand(41.0, AssignCommand(oConsort, SpeakString("Crawl...!")));
    DelayCommand(44.0, AssignCommand(oPC, SpeakString("I can't stop dancing...?")));
    DelayCommand(45.0, AssignCommand(oPC, SpeakString("What did you put in my drink...?")));

    // Apply an effect tp PC.
    DelayCommand(46.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect
    ( VFX_IMP_CHARM ), oPC));

    DelayCommand(47.0, AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 999000.0)));

    // Stop "Waltz".
    DelayCommand(53.0, SoundObjectStop(GetNearestObjectByTag("WALTZ")));

    // Start/Stop "Ballroom Blitz".
    DelayCommand(49.5, SoundObjectPlay(GetNearestObjectByTag("BRB_01")));

                        // Spawn ballroom fighters.
                        // Spawnblock 1.
                        ////////////////////////////////////////////////
                        ////////////////////////////////////////////////
                        DelayCommand(50.5, CreateObjectVoid(OBJECT_TYPE_CREATURE, "brawler", lRowdy1));
                        DelayCommand(50.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect
                        ( VFX_IMP_UNSUMMON ), lRowdy1)); ///////////////
                        // Spawnblock 2.
                        ////////////////////////////////////////////////
                        DelayCommand(52.5, CreateObjectVoid(OBJECT_TYPE_CREATURE, "brawler001", lRowdy2));
                        DelayCommand(52.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect
                        ( VFX_IMP_UNSUMMON ), lRowdy2)); ///////////////
                        // Sapwnblock 3.
                        ////////////////////////////////////////////////
                        DelayCommand(53.5, CreateObjectVoid(OBJECT_TYPE_CREATURE, "brawler002", lRowdy3));
                        DelayCommand(53.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect
                        ( VFX_IMP_UNSUMMON ), lRowdy3)); ///////////////
                        // Spawnblock 4.
                        ////////////////////////////////////////////////
                        DelayCommand(54.5, CreateObjectVoid(OBJECT_TYPE_CREATURE, "brawler003", lRowdy4));
                        DelayCommand(54.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect
                        ( VFX_IMP_UNSUMMON ), lRowdy4)); ///////////////
                        /////////////////////////////////////////////
                        // Begin donybrook. ////////////////////////////
                        //////////////////////////////////////////////
                                        // Attack "BRAWLER_02".
                                        GestaltActionAttack(61.0, oBrawler1, oBrawler2, "", FALSE);

    DelayCommand(93.0, SoundObjectStop(GetNearestObjectByTag("BRB_01")));

                    // Clean up sound files.
                    DelayCommand(94.0, SureDestroy());

    DelayCommand(93.0, AssignCommand(oPC, ClearAllActions()));
    DelayCommand(94.0, AssignCommand(oPC, JumpToLocation(lLoc)));

    DelayCommand(94.0, AssignCommand(GetNearestObjectByTag("BRB_01"),
    SetIsDestroyable(TRUE)));
    DestroyObject(GetNearestObjectByTag("BRB_01"), 95.0);

    DelayCommand(96.0, SetCutsceneMode(oPC, FALSE)); // End cutscene mode.
} // End main.

I’ve tried modifying their OnSpawn scripts to attack with no luck.

Assuming the actors spawn in, it’s probably a faction issue. I don’t have the code for GestaltActionAttack in front of me, but it probably won’t work unless the actors are members of different non-global factions.

// Tells the selected actor to attack something
    // fDelay           how many seconds to wait before attack is added to oActor's action queue
    // oActor           the character you want to carry out the attack
    // oTarget          the object or character you want them to attack
    // sTarget          the tag of the object or character you want them to attack
        // NOTE - this is included so that you can attack objects and creatures that are created during the cutscene
        // NOTE - leave sTarget at its default value of "" if you have already set oTarget
    // bPassive         whether or not to attack in passive mode
void GestaltActionAttack(float fDelay, object oActor, object oTarget, string sTarget = "", int bPassive = FALSE)

So does the code itself change factions / reputations?

Try making them members of different non-global factions.

Opposing non-global factions = “BALLROOM_BLITZ”. Oh, their causing a rukus to be sure now. Thanks P! :slight_smile:

1 Like