Author Topic: Cutscene trouble - Calling from a conversation  (Read 388 times)

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Cutscene trouble - Calling from a conversation
« on: August 16, 2013, 01:06:33 am »


               I'm having a bugger of a cutscene problem that I can't seem to solve.  It should be very easy but...

Here's what I'm trying to do.  I want to start a cutscene from a conversation.  I've set the whole thing up, and tested it via an OnUsed event on a placeable.  Everything works exactly as it should – when the cutscene is initiated with the OnUsed event.  When I actually have the script fire during a conversation though, the NPC who the PC was having the conversation with petulantly refuses to participate in the cutscene.  The NPC won’t move, speak, or take any action whatsoever.

I’ve been fighting with this for close to a week now, so any help would be greatly appreciated.
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Cutscene trouble - Calling from a conversation
« Reply #1 on: August 16, 2013, 01:19:44 am »


               Can you post the script that launches the cut-scene?
               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Cutscene trouble - Calling from a conversation
« Reply #2 on: August 16, 2013, 02:30:22 am »


               The following is an example of what I mean.  Inside or outside of a cut scene, the same problem happens.  Run it from an OnUsed, and it works, run it from a conversation (with the NPC), and the NPC won't move.

   object oNinMark = GetWaypointByTag("TBTL_NINDELARA");
   object oNin = GetNearestObjectByTag("NINDELARA");
   AssignCommand(oNin, ActionJumpToObject(oNinMark));

I've tried various different ways of moving the NPC, or jumping the NPC to a location instead of an object, but none of them work.  I've even tried to destroy the NPC and spawn a new one at the WP, but the old one will still be there.
               
               

               


                     Modifié par 3RavensMore, 16 août 2013 - 01:33 .
                     
                  


            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Cutscene trouble - Calling from a conversation
« Reply #3 on: August 16, 2013, 02:45:10 am »


               Try this:


object oNinMark = GetWaypointByTag("TBTL_NINDELARA");
object oNin = GetNearestObjectByTag("NINDELARA", oNinMark);
AssignCommand(oNin, ActionJumpToObject(oNinMark));

               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Cutscene trouble - Calling from a conversation
« Reply #4 on: August 16, 2013, 02:53:50 am »


               It worked!!!  I've been fighting with this for about a week.  THANK YOU!
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Cutscene trouble - Calling from a conversation
« Reply #5 on: August 16, 2013, 03:12:35 am »


               So the problem is that GetNearestObjectByTag() looks for the nearest object to oTarget (which is, by default, OBJECT_SELF). It will never return oTarget. So if OBJECT_SELF is your NPC and you do not set the second parameter to some object, it will never return your NPC. Thus, you were assigning your commands to an invalid object.

The same code worked on a placeable because OBJECT_SELF was the placeable, not the NPC. For conversation scripts, the NPC is OBJECT_SELF.

Knowing that, you can actually simplify this, as actions will normally be executed by OBJECT_SELF anyway:

object oNinMark = GetWaypointByTag("TBTL_NINDELARA");
ActionJumpToObject(oNinMark);

               
               

               


                     Modifié par Squatting Monk, 16 août 2013 - 02:17 .
                     
                  


            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Cutscene trouble - Calling from a conversation
« Reply #6 on: August 16, 2013, 05:01:23 am »


               That's just what I thought after reading your solution.  Sometimes when you stare at the problem for too long, you miss the obvious.  Thanks again, and for the explanation.