Author Topic: Gestalt Cut scene Issue - Henchman attacks before cutscene ends  (Read 374 times)

Legacy_UnrealJedi

  • Full Member
  • ***
  • Posts: 226
  • Karma: +0/-0
Gestalt Cut scene Issue - Henchman attacks before cutscene ends
« on: December 10, 2013, 02:34:42 pm »


                Hello everyone,
Need some advice here. I am at work and cannot post my code so I am hoping I can explain the issue in enough detail.
I am using the Gestalt cutscene system (great system, by the way) and am having problems keeping the henchman from attacking the Bad Guy before the cutscene is over.
 
Here’s how the cutscene is supposed to go…
 
1)      The PC and henchman approach a door and they cross a trigger. They hear a woman’s scream and then the door opens. There stands the Bad Guy (whose faction is set to commoner).

2)      A short conversation takes place between the Bad Guy and the henchman using words appearing above their respective heads.

3)      At the end of the conversation the cutscene ends.

4)      The Bad Guy attacks the PC.

  
I have a function adjusting the reputation of the Bad Guy to -100 at the end of the cutscene script. I cannot figure out how to put AdjustReputation in the sequence of actions taking place during the cutscene (assuming that is what I need to do).

 
Here’s how the cutscene is going…
 
1)      The PC and henchman approach a door and cross a trigger. They hear a woman’s scream and then the door opens. There stands the Bad Guy.

2)      The henchman immediately runs up and attacks the Bad Guy.

3)      The conversation between the Bad Guy and the henchman still takes place during the fight.

4)      The henchman kills the Bad Guy, still talking to him.

5)      The PC stands there like a doofus, twiddling his thumbs, until the specified numbers of seconds have passed and then the cutscene ends.
 
Given this information, can you point me in a direction? If you need to see the code I will post it tonight.

Thanks!
               
               

               


                     Modifié par UnrealJedi, 10 décembre 2013 - 10:53 .
                     
                  


            

Legacy_UnrealJedi

  • Full Member
  • ***
  • Posts: 226
  • Karma: +0/-0
Gestalt Cut scene Issue - Henchman attacks before cutscene ends
« Reply #1 on: December 10, 2013, 02:35:54 pm »


               Apologies for formatting. Copied and pasted using my phone.
               
               

               
            

Legacy_UnrealJedi

  • Full Member
  • ***
  • Posts: 226
  • Karma: +0/-0
Gestalt Cut scene Issue - Henchman attacks before cutscene ends
« Reply #2 on: December 10, 2013, 10:44:10 pm »


               Here's the script. I just need to figure out how to keep the script from adjusting the reputation until AFTER exchange between the henchman and Bad Guy is over.

Any help is appreciated!

#include "in_g_cutscene"
//Redemption Episode 1 - Homecoming
//Cutscene of Conversation with Jacinn
//Script modified by Paul Postel
//Modified 12.09.13

void main()

{
    //Define the PC and define the NPC they will speaking with
    object oPC = GetLocalObject(GetModule(),"cutsceneviewer");
    object oCaptain = GetObjectByTag("THORGRIM");
    object oJacinn =  GetObjectByTag("Jacinn");
    object oDoor = GetObjectByTag ("jacinnsdoor");

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

    //Start the cutscene
    GestaltStartCutscene(oPC,"JacinnConvo",TRUE,TRUE,TRUE,TRUE,2);

    //As soon as the PC crosses the trigger, they hear a scream and then the door to Jacinn's room opens.
    //Jacinn is standing in the doorway and speaks to Thorgrim.

    GestaltActionOpen       (2.0, oJacinn, oDoor, FALSE);

    GestaltSpeak            (4.0,  oJacinn,
                            "Thorgrim...what's happening...to me?",
                            NORMAL, 0.0);

    //Jacinn begins to walk slowly toward Thorgrim and the PC.
    GestaltFace             (4.0, oJacinn, 0.0, 2,oPC);
    GestaltActionMove       (5.0, oJacinn, oPC, FALSE, 1.0, 20.0);

    //Thorgrim turns to face Jacinn
    GestaltFace             (7.0, oCaptain, 0.0, 2,oJacinn);

    //Thorgrim replies to Jacinn
    GestaltSpeak            (9.0,  oCaptain,
                            "Jacinn? What have you done? Where's Sarah?",
                            NORMAL, 0.0);

    //Jacinn's line
    GestaltSpeak            (11.0,  oJacinn,
                            "Inside me...it hurts...I'm dying...",
                            NORMAL, 0.0);

    //Thorgrim's line
    GestaltSpeak            (13.0,  oCaptain,
                            "Jacinn...stop...I'll get Hebriand-",
                            NORMAL, 0.0);

    //Jacinn's line
    GestaltSpeak            (15.0,  oJacinn,
                            "NO! I'm...must eat...flesh...the hunger...for FLESH!",
                            NORMAL, 0.0);

    //PC's line
    GestaltSpeak            (17.0,  oPC,
                            "I don't like the look in his eyes, Captain...",
                            NORMAL, 0.0);

    //Thorgrim's line
    GestaltSpeak            (19.0,  oCaptain,
                            "Jacinn! Please stop, son...I'll get help-",
                            NORMAL, 0.0);

    //Jacinn's line
    GestaltSpeak            (21.0,  oJacinn,
                            "You...will...DIE!",
                            NORMAL, 0.0);

    GestaltActionAttack     (22.0, oJacinn, oPC);

    //Camera movements
    //Camera starts moving right after Jacinn says his first line
    //The camera starts and stays directly behind the PC
    //The camera starts 10 meters away and ends 4 meters away
    //The camera starts and ends angled almost 90 degrees from the vertical pole
    //The result is to have the camera start behind the PC, facing Jacinn and slowly move in a straight line
    //as the conversation progresses.

    GestaltCameraMove       (2.0,
                            fFace + 0.0,6.0,70.0,
                            fFace + 0.0, 4.0,70.0,
                            100.0,30.0,oPC);

    //End cutscene
    GestaltStopCutscene     (22.0,  oPC);

}
               
               

               


                     Modifié par UnrealJedi, 10 décembre 2013 - 10:51 .
                     
                  


            

Legacy_UnrealJedi

  • Full Member
  • ***
  • Posts: 226
  • Karma: +0/-0
Gestalt Cut scene Issue - Henchman attacks before cutscene ends
« Reply #3 on: December 10, 2013, 11:03:46 pm »


               I am also aware I need to have #include "nw_i0_generic" to use the AdjustReputation function. However, when I include it I get an error message for the script "x0_i0_spawncond" telling me FUNCTION DEFINITION MISSING NAME for line 48 which reads "const int NW_FLAG_AMBIENT_ANIMATIONS = 0x00080000;". I looked at the code for the include script "in_g_cutscene" and it has the very same "const int NW_FLAG_AMBIENT_ANIMATIONS = 0x00080000;" line. I suspect if I were to rename "x0_i0_spawncond" and remove line 48 the issue would clear up.

Thoughts?
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Gestalt Cut scene Issue - Henchman attacks before cutscene ends
« Reply #4 on: December 12, 2013, 04:50:35 pm »


               Don't do that. It will have repercussions for other scripts that need x0_i0_spawncond. Instead, remove the offending lines from in_g_cutscene so they don't conflict.

Also, AdjustReputation() is a native function. You don't need to include nw_i0_generic to use it.
               
               

               
            

Legacy_UnrealJedi

  • Full Member
  • ***
  • Posts: 226
  • Karma: +0/-0
Gestalt Cut scene Issue - Henchman attacks before cutscene ends
« Reply #5 on: December 12, 2013, 06:52:56 pm »


               Hi Squatting Monk, yes, I realized how ignorant renaming that script sounded a few hours after posting. I think I have the issue resolved. I'll keep you updated.
               
               

               
            

Legacy_UnrealJedi

  • Full Member
  • ***
  • Posts: 226
  • Karma: +0/-0
Gestalt Cut scene Issue - Henchman attacks before cutscene ends
« Reply #6 on: December 16, 2013, 12:28:25 am »


               Okay, I give up. I cannot figure this out on my own so I am appealing for some further help. This cutscene, if I can get it to work, will look great. That's the only reason I am trying to so hard to make it work.

Now, the cutscene actors say all of their dialogue, the henchman does not attack, but neither does the Bad Guy at the end of the dialogue (which is what I need to happen). The Bad Guy does not even turn hostile. Since the Gestalt cutscene system has a conflict with nw_i0_generic, a standard Bioware script, I attempted to alter the main Gestalt cutscene script but that did not work either. So, I attempted to use the function in the Gestalt system to execute another script to make the Bad Guy attack. It, obviously, does not work either. There are two functions in the Gestalt system to execute a script, GestaltActionExecute and GestaltExecuteScript.

Here are both Gestalt script parameters. Maybe I am using the wrong function?


GestaltActionExecute:

void GestaltActionExecute(float fDelay, object oActor, object oTarget, string sScript, string sTarget = "")


GestaltExecuteScript:

void GestaltExecuteScript(float fDelay, object oTarget, string sScript, string sTarget = "")


Here's my cutscene script, followed by the script that is supposed to make the Bad Guy attack. I am not sure if there is problem with one or both scripts.

The cutscene script:

#include "in_g_cutscene"

//Cutscene of Conversation with Jacinn
//Modified 12.15.13


void main()

{

    //Define the PC and define the NPC they will speaking with

    object oPC = GetLocalObject(GetModule(),"cutsceneviewer");
    object oCaptain = GetObjectByTag("THORGRIM");
    object oJacinn =  GetObjectByTag("Jacinn");
    object oDoor = GetObjectByTag ("jacinnsdoor");

    //Get the facing of the PC
    float fFace = GetFacing(oPC);
    //Start the cutscene

    GestaltStartCutscene(oPC,"JacinnConvo",TRUE,TRUE,TRUE,TRUE,2);

    //As soon as the PC crosses the trigger, they hear a scream and then the door to Jacinn's room opens.
    //Jacinn is standing in the doorway and speaks to Thorgrim.

    GestaltActionOpen       (2.0, oJacinn, oDoor, FALSE);

    GestaltSpeak            (4.0,  oJacinn, Thorgrim...what's happening...to me?", NORMAL, 0.0);

    //Jacinn begins to walk slowly toward Thorgrim and the PC

    GestaltFace             (4.0, oJacinn, 0.0, 2,oPC);
    GestaltActionMove       (5.0, oJacinn, oCaptain, FALSE, 1.0, 0.0);

    //Thorgrim turns to face Jacinn
    GestaltFace             (7.0, oCaptain, 0.0, 2,oJacinn);

    //Thorgrim replies to Jacinn
    GestaltSpeak            (9.0,  oCaptain,
                            "Jacinn? What have you done? Where's Sarah?", NORMAL, 0.0);

    //Jacinn's line
    GestaltSpeak            (13.0,  oJacinn, "Inside me...it hurts...I'm dying...", NORMAL, 0.0);

    //Thorgrim's line
    GestaltSpeak            (17.0,  oCaptain, "Jacinn...stop...I'll get Hebriand-", NORMAL, 0.0);

    //Jacinn's line
    GestaltSpeak            (21.0,  oJacinn, "NO! I'm...must eat...flesh...the hunger...for FLESH!", NORMAL, 0.0);

    //PC's line
    GestaltSpeak            (25.0,  oPC, "I don't like the look in his eyes, Captain...", NORMAL, 0.0);

    //Thorgrim's line
    GestaltSpeak            (29.0,  oCaptain, "Jacinn! Please stop, son...I'll get help-", NORMAL, 0.0);

    //Jacinn's line
    GestaltSpeak            (33.0,  oJacinn, "You...will...DIE!", NORMAL, 0.0);

    GestaltActionExecute    (34.0, oPC, oPC, "pp_jacinnattpc");

    //Camera movements
    //Camera starts moving right after Jacinn says his first line
    //The camera starts and stays directly behind the PC
    //The camera starts 10 meters away and ends 4 meters away
    //The camera starts and ends angled almost 90 degrees from the vertical pole
    //The result is to have the camera start behind the PC, facing Jacinn and slowly move in a straight line
    //as the conversation progresses.
 
    GestaltCameraMove       (2.0,
                                            fFace + 0.0,6.0,70.0,
                                            fFace + 0.0, 4.0,70.0,
                                            100.0,30.0,oPC);
 
    //End cutscene

    GestaltStopCutscene     (34.0,  oPC);

}



The script to make the Bad Guy attack (called by the above script):


#include "nw_i0_generic"
void main()
{

object oPC = GetFirstPC();

object oTarget =  GetObjectByTag("Jacinn");

AdjustReputation(oPC, oTarget, -100);

SetIsTemporaryEnemy(oPC, oTarget);

AssignCommand(oTarget, ActionAttack(oPC));

AssignCommand(oTarget, DetermineCombatRound(oPC));

}


Thank you for any help in correcting my scripts!
               
               

               


                     Modifié par UnrealJedi, 16 décembre 2013 - 12:36 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Gestalt Cut scene Issue - Henchman attacks before cutscene ends
« Reply #7 on: December 16, 2013, 12:47:24 am »


               well, since I have never liked Gestalt  and never messed with cut scenes much, before I did into it to much just try and increase the script running past the end  of the cut scene.

  GestaltActionExecute    (37.0, oPC, oPC, "pp_jacinnattpc");
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Gestalt Cut scene Issue - Henchman attacks before cutscene ends
« Reply #8 on: December 16, 2013, 12:51:42 am »


               Instead of trying to execute a separate script to handle the attack, try using the GestaltActionAttack() function like so.

Edit: Hmm... doesn't seem to work when I test it. Lemme tinker some.

Edit 2: Fixed. I just added a DelayCommanded SetIsTemporaryEnemy() right before the attack command.
               
               

               


                     Modifié par Squatting Monk, 16 décembre 2013 - 01:25 .
                     
                  


            

Legacy_UnrealJedi

  • Full Member
  • ***
  • Posts: 226
  • Karma: +0/-0
Gestalt Cut scene Issue - Henchman attacks before cutscene ends
« Reply #9 on: December 16, 2013, 12:55:48 pm »


               Worked like a charm, Squatting Monk. Thanks to both you and Lightfoot for the assist!
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Gestalt Cut scene Issue - Henchman attacks before cutscene ends
« Reply #10 on: December 16, 2013, 02:22:30 pm »


               

UnrealJedi wrote...
Since the Gestalt cutscene system has a conflict with nw_i0_generic, a standard Bioware script, I attempted to alter the main Gestalt cutscene script but that did not work either.


fwiw, fixing Gestalt to work with nw_i0_generic is just a matter of commenting out the redifined constants
and, to make it so you don't have to remember to include it every time you use in_g_cutscene, addding
an include for x0_i0_spawncond:

//const int NW_FLAG_AMBIENT_ANIMATIONS          = 0x00080000;
//const int NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS = 0x00200000;
//const int NW_FLAG_AMBIENT_ANIMATIONS_AVIAN    = 0x00800000;
#include "nw_i0_spawncond".


Cheers,
meaglyn