Author Topic: Gestalt Cutscene Questions  (Read 463 times)

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Gestalt Cutscene Questions
« on: November 10, 2012, 03:58:38 am »


               As I am barely toe-deep in the realm of cutscenes, I was happy to discover this system.  However, simply for clarification, I have a few questions to better help me understand implementation of this wonderful system.  '<img'>  I am scripting a few small cutscenes (30 seconds each probably) for a Persistent World.

1)  Right off the bat, he makes a distinction between SP and MP; he does this by stating "And to make sure that we find the right player when we begin that script, we've set them as a LocalObject on the module" (his "cutsceneviwer").   I'm a n00b to this, so does the cutscene not automatically run on the PC that triggered it?  In my case, it is geting called from a placeable conversation.

2)  It appears that in all instances he is talking about dealing with 1 PC.  What is done, if PC's are in party, to insure that they all see the same cutscene?  Anything?  Does it happen automatically on all PC's in the area, since the cutscene is ran from the area?

3)  What are the primary differences between the normal and action versions of his commands?  (i.e., GestaltSpeak, GestaltActionSpeak; GestaltFace, GestaltActionFace).

I'm sure I'll have more as I go, but these are the ones that are stumping me at the moment.

Thanks for Reading.  '<img'>
               
               

               


                     Modifié par WoC_Builder, 11 novembre 2012 - 05:25 .
                     
                  


            

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Gestalt Cutscene Questions
« Reply #1 on: November 11, 2012, 05:18:21 am »


               I think I am running into a few issues.  One of the largest is interpreting my timeing, as relates to action queues and when I need to start counting; from the beginning of the cutscene, or from the previous action.

The other is getting my creature (spawned in during the cutscene) to perform her movement and actions I wish her to do.    Also, I need to destroy her at the end, but she is being sutubborn.  '<img'>

I thought, after reading, that I may need to use the GestaltTagActionMove function (and the related GestaltTag* functions), but it had no effect on my creature.

Needless to say, this script is only partly functioning.  Can anyone give me some pointers?  It would be much appreciated.  '<img'>  If it looks a little messy right now, well...it's because it is.  '<img'>  I'm flailing around, trying to identify the issue.  I'll clean it up later.  '<img'>

/*
The following script is the first cutscene taking place in the "Ruins of Shadhet - Catacombs"
dungeon run.  This is in the Weaving Room, and shows the ghost Leila. On the loom, the PC
will see a battle scene, depicting Jassad warring against a desert rival.
Leila appears, sitting at the loom, and the PC sees her weaving the half-finished tapestry.
She does not see/react to the PC’s.  She stops in her weaving, and lays a hand on the
cheek of Jassad…then does the same for the rival.  A single tear tracks down her cheek,
then she fades.
*/


#include "in_g_cutscene"

void main()
{
//Define the Actors in the cutscene.
object oPC    = GetLocalObject(GetModule(),"cutsceneviewer");
string sActor = ("nh_Leila");
object oLoom  = GetObjectByTag("leila_loom");
object oActor = GetObjectByTag("nh_Leila");
object oWP    = GetWaypointByTag("WP_LeilaSpawn");

//Retrieve the facing of the PC.
float fFace = GetFacing(oPC);

//Start the cutscene, and fade in.
GestaltStartCutscene    (oPC, "cs_gld_shdleila1",TRUE,TRUE,TRUE,TRUE,2);
GestaltCameraFade       (0.0,  oPC, FADE_IN, FADE_SPEED_MEDIUM);

//The cutscene has started, and we deliver first line of text.
GestaltSpeak  (3.0, oPC,
                    "Before you is a loom, a tapestry half-finished upon it.  You can make out a" +
                    " battle scene, depicting Jassad warring against another man.");

//It is here that Leila appears.  We will use an spawn-in animation, and also have her spawn in
//in cutscene mode, which allows her to pass through PC's as she moves about the room.
GestaltCreate         (6.0, oWP, OBJECT_TYPE_CREATURE, "nh_Leila", "");

//She moves to the loom, and play the GET_MID animation while the rest of the scene plays out
GestaltTagActionMove  (0.0, sActor, oLoom, FALSE,  1.0, 0.0, "", TRUE);
GestaltTagActionAnimate    (0.0, sActor, ANIMATION_LOOPING_GET_MID, 11.0);

//Here is the next bit of information the PC's will see.
GestaltSpeak (9.0, oPC,
"A ghost appears...a ghost of a beautiful woman.  It troubles you not, nor does" +
" it appear to even notice you.  It begins to weave the tapestry.  You see" +
" threads, suddenly animate, weave in and out of the warp.");

//Here is the last bit of information the PC's will see.
GestaltSpeak (15.0, oPC,
"She stops in her weaving, and lays a hand on the cheek of Jassad…then does the" +
" same for the rival.  A single tear tracks down her cheek.");


// Fade to black and remove the NPC
    GestaltCameraFade       (22.0, oPC,   FADE_CROSS,  FADE_SPEED_SLOW,2.0);
    GestaltTagActionDestroy (23.0, sActor, oActor, sActor);

//Camera movements//

//The camera starts and ends directly behind the PC
//The camera starts 10 meters away and ends 5 meters away
//The camera starts at 50 degrees from the vertical, and ends angled almost
//90 degrees from the vertical pole
//The result is to have the camera start behind the PC, facing the loom, and slowly zooming in
//The camera movement will take 20 seconds, with 30 frames per second
GestaltCameraMove (0.0,
fFace + 0.0,20.0,50.0,
fFace + 360.0, 5.0,80.0,
20.0,60.0,oPC, 0, 0, 1);

// End cutscene
    GestaltStopCutscene     (30.0, oPC);
}

               
               

               


                     Modifié par WoC_Builder, 11 novembre 2012 - 05:27 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Gestalt Cutscene Questions
« Reply #2 on: November 11, 2012, 04:05:02 pm »


               I wanted to let you know that I am paying attention but don't have much insight for you. Its been over a year since I touched cutscenes and I can't recall exactly how it all works.

But I did notice that you appeared to define both oActor and oActor's tag. It seems to me that you don't need to use the tag functions if you have the object reference for the creature from the beginning of the cutscene. I would think you wold only need the tag and resref when you create a create in the middle of a cutscene.

Edit
Ah never mind... you get the object by tag, but it isn't created yet. Hmmm... then you later create the creature, but are you also giving it the tag that you need?
               
               

               


                     Modifié par henesua, 11 novembre 2012 - 04:07 .
                     
                  


            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Gestalt Cutscene Questions
« Reply #3 on: November 12, 2012, 12:11:29 am »


               I think your timing is wrong. The delays want to be from the beginning of the cutscene not
from the last action.

I often define a fDelay variable to 0.0 at the and keep a running total.
// for example - this would be 3 seconds after the start
GestaltSpeak (fDelay += 3.0, oPC, "something to say");

// then this would be 3 seconds after the Speak.
GestaltCreate (fDelay += 3.0, 6.0, oWP, OBJECT_TYPE_CREATURE, "nh_Leila", "");

In your case you've got some of them cumulative, but the move and animate are right
at the beginning, before nh_Leila has even been spawned.

Also, oActor is OBJECT_INVALID in your script. Using the Tag versions gets around that so I'd just take that out completely and pass in OBJECT_INVALID when needed. It's reduce clutter and confusion.

If she's not being destroyed either the tag is not correct as henesua mentioned or maybe she can't
destroy herself?  If the latter you could try passing in a different actor and still have her be the target (like the area maybe?).  Or maybe better, just use GestaltDestroy instead.

Cheers,

Meaglyn
               
               

               
            

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Gestalt Cutscene Questions
« Reply #4 on: November 12, 2012, 04:31:59 am »


               Got it!  And thanks to you both for your input.  meaglyn, you are absolutely right; Gestalt's Cutscenes fDealys are indeed timed from the beginning.  Once I was able to work past that hurdle, the timing of actions was not an issue, and actually quite easy.

Why I was having problems with my ghost not moving though turned out to be from the following issue; I created her during the cutscene.  It appears that when this is the case, creatures do not like obeying commands.  I saw where Gestalt provided a bunch of "Tag" based commands, but I opted for the easy fix; I simply put in one tiny piece of corridor in the area, unconnected o the rest of the area, and set her there.  You can also see at the bottom of my (much cleaned up) script that I return her to her room when the cutscene is done.  Can either one of you confirm the "Tag" commands are used for objects created during the cutscene?  While I may not need it here, I may in the future, and it would be god to file that one away.

Now that I understand his system, I am off to vote a 10, because quite simply this is very understandable and quite easy to use, even for a part-time scripter like myself.

/*
The following script is the first cutscene taking place in the "Ruins of Shadhet - Catacombs"
dungeon run.  This is in the Weaving Room, and shows the ghost Leila. This sets
up the first of the plot scenes.  It shows the link between Leila, Jassad, and
Sadek, Jassad's rival, and Leila's brother
*/


#include "in_g_cutscene"

void main()
{
//Define the Actors in the cutscene.
object oPC     = GetLocalObject (GetModule(),"cutsceneviewer");
object oLoom   = GetObjectByTag ("leila_loom");
object oActor1 = GetObjectByTag ("nh_Leila");
object oWP     = GetWaypointByTag ("WP_LeilaSpawn");
object oWP2    = GetWaypointByTag ("WP_LeilaHome");

//Retrieve the facing of the PC.
float fFace = GetFacing(oPC);

//Start the cutscene, and fade in.
GestaltStartCutscene    (oPC, "cs_gld_shadhet01");
GestaltCameraFade       (0.0,  oPC, FADE_IN, FADE_SPEED_MEDIUM);

//The cutscene has started, and we deliver first line of text.
    GestaltSpeak
    (3.0, oPC,
    "Before you is a loom, a tapestry half-finished upon it.  You can make out a"
    +" battle scene, depicting Jassad warring against another man.");

//It is here that Leila appears.  On her is set a spawn-in animation (on_spawn),
//and also have her spawn in cutscene mode  (LocalInt), which allows her to pass
//through PC's as she moves about the room.
    GestaltJump (8.0, oActor1, oWP);

//She moves to the loom, and play the GET_MID animation while the rest of the scene plays out
    GestaltActionMove       (8.1, oActor1, oLoom, FALSE,  0.5, 4.0);
    GestaltActionAnimate    (12.0, oActor1, ANIMATION_LOOPING_GET_MID, 9.0);

//Here is the next bit of information the PC's will see.
    GestaltSpeak (9.0, oPC,
    "A ghost appears...a ghost of a beautiful woman.  It troubles you not, nor does" +
    " it appear to even notice you.");

//Here is the next bit of information the PC's will see.
    GestaltSpeak (15.0, oPC,
    "It begins to weave the tapestry.  You see threads, suddenly animate,"
  + " weave in and out of the warp.");

//Here is the last bit of information the PC's will see.
    GestaltSpeak (21.0, oPC,
    "She stops in her weaving, and lays a hand on the cheek of Jassad…then does "
  + "the same for the rival.  A single tear tracks down her cheek.");


// Fade to black and remove the NPC
    GestaltCameraFade       (26.0, oPC, FADE_OUT, FADE_SPEED_MEDIUM, 3.6);
    GestaltJump             (28.5, oActor1, oWP2);

//Camera movements//

//The camera starts and ends directly behind the PC
//The camera starts 10 meters away and ends 5 meters away
//The camera starts at 50 degrees from the vertical, and ends angled almost
//90 degrees from the vertical pole
//The result is to have the camera start behind the PC, facing the loom, and slowly zooming in
//The camera movement will take 29 seconds, with 30 frames per second
    GestaltCameraMove (0.0,
        fFace + 0.0  , 20.0, 50.0,
        fFace + 360.0,  5.0, 80.0,
        27.9, 30.0, oPC);

// End cutscene
    GestaltStopCutscene     (30.0, oPC, "", TRUE);
}

               
               

               


                     Modifié par WoC_Builder, 12 novembre 2012 - 04:47 .
                     
                  


            

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Gestalt Cutscene Questions
« Reply #5 on: November 12, 2012, 04:43:08 am »


               One other addendum. I seemed to have an issue with the FADE_OUT not resetting upon GestaltStopCutscene; the screen remained black, though I had control over the character, as I could make him run about, just not see him do it.  '<img'>

How I worked around that timing it so my FADE_OUT ended 0.1 second before the cutscene did.  Though I have to admit, I'm a bit confused I had to do that, because the documentation clearly states that GestaltStop should cancel any remaining fades.  Am I misreading what he implies, and that I need to insure I do not have FADE end at precisely the same time as the cutscene, but 0.1 seconds before, like I did?
               
               

               
            

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Gestalt Cutscene Questions
« Reply #6 on: November 12, 2012, 04:55:45 am »


               And since I am in question mode...is there a reason that we should initiate cutscenes like he suggests, setting the PC as a local object on the mod?

For the record, I used a trigger for mine, but did follow his advice...I just don't see the reasoning behind it.  Since my cutscene will be in a multi-player environment, I want to be sure that only the PC (or the PC's with the triggering PC), and not the whole mod.  '<img'>



void main()
{
    object oPC = GetEnteringObject();

    if (!GetIsPC(oPC))
        { return; }

    if (GetLocalInt(oPC,"iCutsceneViewed") > 0)
        { return; }

    SetLocalInt(oPC,"iCutsceneViewed",1);

    SetLocalObject(GetModule(),"cutsceneviewer",oPC);
    ExecuteScript("mycutscene",GetArea(oPC));
}

               
               

               
            

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Gestalt Cutscene Questions
« Reply #7 on: November 12, 2012, 05:20:12 pm »


               And on to my second cutscene, but now an issue with her attack sequence.  My intent is that she throws a dart at the nearest PC (oTarget); this is to simulate the dagger in her hand.  The trouble is...none of it is firing; not the equipping, nor the attack.  My logic also said that I needed to have her GestaltClearActions afterword as well, so she did not continue to attack the poor defenseless PC.  '<img'>

Attached are the relevant bits.  Any ideas on how an Actor is supposed to attack?

//Here is the next bit of information the PC's will see.
    GestaltSpeak (19.0, oPC,
    "Her eyes wide, she looks at it in sadness.  Blood, and a clear fluid, drip "
  + "from the blade.  She looks at it in disgust, then throws the blade from her - "
  + "it passes through you!");

//Here we have the attack action, where Leila throws the dagger
    GestaltActionEquip  (24.0, oActor1, INVENTORY_SLOT_BEST_RANGED);
    GestaltActionAttack (24.1, oActor1, oTarget);
    GestaltClearActions (24.2, oActor1);

               
               

               
            

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Gestalt Cutscene Questions
« Reply #8 on: November 14, 2012, 12:56:22 am »


               Another question;  just how the heck am I supposed to destroy something I create during the cutscene?  I have tried GestaltDestroy, GestaltTagDestroy, and GestaltTagActionDestroy...none of them seem to work?

Originally with my creature actors, I found a work around by having them within the area and just jumping them there.  Since I cannot spawn a creature dead (AND laying atop a placeable) I had to use a placeable corpse.

Now, however, I am back to my original conundrum of how to get rid of a blasted anything when I have to create during the cutscene!  lol

I have tried using sTag, and setting oActor to OBJECT_INVALID.  I thought of declaring the placeable as an object; is that my issue?

Stumped...but further testing is called for.  '<img'>
               
               

               
            

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Gestalt Cutscene Questions
« Reply #9 on: November 14, 2012, 01:16:49 am »


               I am thinking the answer has ti lie witi the two functions below (GestaltDoDestroy nested with GestaltDestroy) but I cannot winkle the meaning out of it!.  This "created anything not working" issue and my action attack (see previous posts) issue are the two major stumbling blocks for my dungeon; after this, finishing the rest of the areas is simply a matter of placeable work and getting triggers set up.

Any help would be most appreciated!!  '<img'>

void GestaltDestroy(float fDelay, object oTarget, string sTarget = "")
{
    string sName = GetLocalString(GetModule(),"cutscene");
    DelayCommand(fDelay,GestaltDoDestroy(sName,OBJECT_INVALID,"",oTarget,sTarget,FALSE));
}


void GestaltDoDestroy(string sName, object oActor, string sActor, object oTarget, string sTarget, int bAction)
{
    if (GetLocalInt(GetModule(),sName))
        { return; }

    if (sTarget != "")  { oTarget = GetObjectByTag(sTarget); }

    if (bAction)
        {
        AssignCommand(oActor,ActionDoCommand(AssignCommand(oTarget,SetIsDestroyable(TRUE))));
        AssignCommand(oActor,ActionDoCommand(DestroyObject(oTarget)));
        }

    else
        {
        AssignCommand(oTarget,SetIsDestroyable(TRUE));
        DestroyObject(oTarget);
        }
}

               
               

               
            

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Gestalt Cutscene Questions
« Reply #10 on: November 14, 2012, 02:51:47 am »


               I found my issue with the Destroy command.

It is amazing what you can do when your tags are what they should be, not what you THINK they should be.  '<img'>

Now, to figure out the equip function, and its associated attack, and all willbe good!   '<img'>
               
               

               
            

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Gestalt Cutscene Questions
« Reply #11 on: November 14, 2012, 05:42:49 am »


               

WoC_Builder wrote...

And on to my second cutscene, but now an issue with her attack sequence.  My intent is that she throws a dart at the nearest PC (oTarget); this is to simulate the dagger in her hand.  The trouble is...none of it is firing; not the equipping, nor the attack.  My logic also said that I needed to have her GestaltClearActions afterword as well, so she did not continue to attack the poor defenseless PC.  '<img'>

Attached are the relevant bits.  Any ideas on how an Actor is supposed to attack?

//Here is the next bit of information the PC's will see.
    GestaltSpeak (19.0, oPC,
    "Her eyes wide, she looks at it in sadness.  Blood, and a clear fluid, drip "
  + "from the blade.  She looks at it in disgust, then throws the blade from her - "
  + "it passes through you!");

//Here we have the attack action, where Leila throws the dagger
    GestaltActionEquip  (24.0, oActor1, INVENTORY_SLOT_BEST_RANGED);
    GestaltActionAttack (24.1, oActor1, oTarget);
    GestaltClearActions (24.2, oActor1);


Found it!  '<img'>  It seems that when your NPC does not have the required feat (in this case, Simple Weapon Proficiency), they will not equip their weapon.  Then, I had to remember to update my placed creature from the blueprint.

Also, my timings needed work, as the GestaltActionAttack and the GestaltClearActions needed about a 1 second interval to fire correctly.  Fortunately, I placed the X2_L_NUMBER_OF_ATTACKS and set that to 1, so regardless of her level, she only fires off one attack, and not a flurry.

Always the simple things. '^_^'