Author Topic: A little Gestalt Help please?  (Read 467 times)

Legacy_TheGmork

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
A little Gestalt Help please?
« on: September 24, 2013, 11:07:00 pm »


                Hey,
I'm making a simple cut scene that uses a clone of the PC as an actor. The problem I'm having is removing the clone at the end with GestaltTagActionDestroy function.

Here is the script:

#include "in_g_cutscene"
void main()
{   
  // Find actors and objects   
  object oPC = GetLocalObject(GetModule(),"cutsceneviewer");   
  object oDest = GetObjectByTag("cswp_fighter01");
 
  //Set the tag for pc clone   
  string sTag = "cloned_pc";
 
  // Find the direction the player's facing in at the start of the scene   
  float fFace = GetFacing(oPC);

  // Start cutscene, fade in   
  GestaltStartCutscene    (oPC,"cs_fighter_001",TRUE,TRUE,TRUE,TRUE,2);   
  GestaltCameraFade       (0.0,  oPC, FADE_IN,FADE_SPEED_MEDIUM);
 
 //Clone PC 
 GestaltClonePC(0.0, oPC, oPC, sTag, "", TRUE);

    // Player and clone and moves them to a waypoint   
   GestaltActionMove       (0.0, oPC, oDest, FALSE, 0.1, 0.0);   
   GestaltTagActionMove(0.2, sTag, oDest, FALSE, 0.0, 0.0, "", TRUE);

    // Fade to black and remove clone   
    GestaltCameraFade(23.0, oPC,   FADE_CROSS,FADE_SPEED_MEDIUM,3.0);   
   GestaltTagActionDestroy(25.0, "cutsceneviewer", OBJECT_INVALID, sTag);
   
  // Camera movements   
  GestaltCameraCrane(0.0, fFace + 180.0, 0.2, 30.0, 5.0,   fFace + 0.0, 100.0, 60.0, 30.0,   20.0, 60.0, oPC);
   // End cutscene   
  GestaltStopCutscene     (26.1, oPC);
}

If some one could help me with it, t'would be grand. '<img'>
Cheers
               
               

               


                     Modifié par TheGmork, 24 septembre 2013 - 10:12 .
                     
                  


            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
A little Gestalt Help please?
« Reply #1 on: September 25, 2013, 09:28:50 pm »


               The problem is that GestaltTagActionDestroy() is searching for an object tagged "cutsceneviewer" to execute the destroy action. PCs have no tag, so this is not properly finding the PC, thus the PC cannot destroy the clone.

Solution: use GestaltActionDestroy() instead:

GestaltActionDestroy(25.0, oPC, OBJECT_INVALID, sTag);

               
               

               
            

Legacy_TheGmork

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
A little Gestalt Help please?
« Reply #2 on: September 25, 2013, 10:38:43 pm »


               Thank you! Worked like a charm! '<img'>