Aller au contenu

Photo

How to make PC Party move during a cut-scene? [RESOLVED]


  • Veuillez vous connecter pour répondre
15 réponses à ce sujet

#1
ColorsFade

ColorsFade
  • Members
  • 1 270 messages
Is this just NOT possible at all?

I have tried everything I can think of. I can't find an instance in the OC where this actually happens so I can look at the scripting. 

I looked around the forums and noticed this crucial piece of information: 

 Script are executed before (the player clicks) for a NPC's line and after (the player clicks) for a PC's line


Yet, not matter what line I put my "move" action on (PC or NPC), it doesn't work. The PC never moves. Not only that, but the camera never switches to look at my PC. All the other lines of dialog it works. I have that one PC line with a fixed duration of four seconds, but the camera stays on the previous NPC and just hangs there for an extra four seconds. 

Any clues? Anyone ever done this?

Modifié par ColorsFade, 07 novembre 2013 - 09:10 .


#2
andysks

andysks
  • Members
  • 1 651 messages
I struggled with that some months ago and now I make it with my eyes closed.
ga_move with $PC as the tag override for start.
Then I noticed that the delay has a big part. For example if reaching the waypoint in 4 seconds, but the line has a delay of 3, the walk sometimes finishes midway, or continues while next line is spoken. I don't know what it depends on... maybe if there are other actions taking place on next line.

I remember I also had problems putting the move on a PC line. So if I wanted the PC to move in a cutscene without a line spoken, I just add an empty NPC line with a delay.

The camera, I also couldn't make it track or pan to follow the PC. So I had to have more "panoramic views" for the PC movement.

I hope it's some help.

Andy.

#3
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
One trick is to start the PC moving, then cut away to another shot, and in the meantime jump the PC to where you want them. It also helps to jump the PC to a particular waypoint at the beginning on the conversation, so you know exactly where they start off from.

#4
Morbane

Morbane
  • Members
  • 1 883 messages
i think the trial begins with the pc walking into nasher's court - check there....

#5
ColorsFade

ColorsFade
  • Members
  • 1 270 messages

Lugaid of the Red Stripes wrote...

One trick is to start the PC moving, then cut away to another shot, and in the meantime jump the PC to where you want them. It also helps to jump the PC to a particular waypoint at the beginning on the conversation, so you know exactly where they start off from.


Yeah, I had that much. 

What I wanted to have happen was this: 

1) PC clicks on a door
2) Fade to Black
3) Cut-Scene starts with NPC's on the other side of the door
4) (During the fade, I jump the PC and party to a waypoint just on the other side of the door)
5) Cut scene advances to a point where the NPC notes that the PC is walking toward them
6) Walk the PC and party to a waypoint close to the NPC
7) Conversation continues.... blah blah blah. 

The part I couldn't get to work was step (6). But I halfway figured it out. 

For starters, you can'd do it on the PC node. That was one thing. Second, you have to use a static camera. And this is because (a) the PC doesn't have any dialog on this line, so the engine doesn't know to focus the camera on the PC and you cannot specify $PC as the "speaker" in the node (which is how the camera knows to switch focus when you're doing a conversation with multiple NPC's). 

So, you must use a static camera, and since the static camera doesn't have a target (because the PC node doesn't have dialog and therefore doesn't have a target) the static camera cannot pan or track. 

Once you know THAT about the situation, then setting the nodes up correct gets easier: 

*) NPC node -> NPC talks
*) PC node (nothing)
*) NPC node -> make PC walk with static camera, no panning or tracking
*) PC node (nothing)
*) NPC node -> NPC or talks

The problem then is getting my whole team to move, which I am still working on. I can get the PC to move and the party straggles behind him in that herky-jerky way. But at least the PC moves. I'm working on a script to get the rest of my party to do the same. I'll report back... 

Oh, and ga_move just never seems to work very well... 

#6
andysks

andysks
  • Members
  • 1 651 messages
I did this the hard way. Seperate waypoints for every team member to walk to. Of course the moment I needed it the available companions were only 4, so it was possible. But what happens when they are 10 or so? I'm really interested to see how this walk the whole party script will turn out.

ga_move is weird yes. But I have problems sometimes with many scripts like that. Like sometimes ga_force_exit doesn't work. No clue why. And sometimes ga_jump. ga_jump_players never failed me. But I cannot use it for NPCs...

#7
kamal_

kamal_
  • Members
  • 5 254 messages

andysks wrote...

I did this the hard way. Seperate waypoints for every team member to walk to. Of course the moment I needed it the available companions were only 4, so it was possible. But what happens when they are 10 or so?

Depends on how hard you want to make things for yourself. Easy way is just use lots of waypoints. Complicated way is do things dynamically and tell companions things like vector x meters from waypoint z is your destination. Do it the easy way...

#8
ColorsFade

ColorsFade
  • Members
  • 1 270 messages
I was just going to do it a fairly easy way.

The PC is commanded to walk to the waypoint with a distance of 0.0f. The companions get their instructions on a delay of 0.1f and walk to within 1.0f of the waypoint. So theoretically they should be behind the PC and I really don't care how they are organized.

I'll be testing the script again tonight and modifying it to see if I can get it to work.

#9
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages

ColorsFade wrote...

For starters, you can'd do it on the PC node. That was one thing. Second, you have to use a static camera. And this is because (a) the PC doesn't have any dialog on this line, so the engine doesn't know to focus the camera on the PC and you cannot specify $PC as the "speaker" in the node (which is how the camera knows to switch focus when you're doing a conversation with multiple NPC's). 

So, you must use a static camera, and since the static camera doesn't have a target (because the PC node doesn't have dialog and therefore doesn't have a target) the static camera cannot pan or track. 


You can always put some filler text in for the PC (e.g., "...") and then set the delay for a few seconds, or however long it takes for the PC to get where they need to go.

#10
Morbane

Morbane
  • Members
  • 1 883 messages
another place where the whole party is cutscene walking is where they are approaching shandra's farm for the first time...

Khelgar: "This is the place, but..."

#11
ColorsFade

ColorsFade
  • Members
  • 1 270 messages
Hey, thanks Morbane. I'll look that one up and see how they're doing it.

Right now I'm debugging my script and cannot find the problem. Via debug statements I can clearly see my companions are getting the Action assigned. But they're not doing the walk. They're all trying to walk to one waypoint though. Not sure if that's an issue.. Never thought it would be.

#12
ColorsFade

ColorsFade
  • Members
  • 1 270 messages
I got it figured out!

I looked up that cut-scene Morbane. They have a single "party"waypoint that they walk to. The trick was looking in the scripts. This is what I was missing:

AssignCommand(oTarget, ClearAllActions(TRUE));

Clearing actions is crucial. Then it worked.

I'm in the process now of adjusting my script to make it generic. I'll paste code here if I get it proper.

Thanks guys!

#13
Morbane

Morbane
  • Members
  • 1 883 messages
:o 

yay!

#14
ColorsFade

ColorsFade
  • Members
  • 1 270 messages

/******************************************************************





Moves entire party during a cut-scene.



How it works: 	

	Search the roster for members in the player party and moves them

	to the given waypoint. 

	

Parameters: 

	oWP: 	The waypoint to walk the party to

	bRun: 	Whether the party should run to the waypoint or walk (default=walk)

	fRange: The distance from the waypoint that the PC should stop. 

			

			Companions will stop before the PC reaches his/her distance,

			so they should end up slightly behind the PC. 



Usage: 	You should use this script on an NPC Node of a conversation and 

		use it in conjunction with a STATIC camera that uses no panning

		or tracking. 



NOTE: 	Script are executed before (the player clicks) for a NPC's line 

		and after (the player clicks) for a PC's line.



*******************************************************************/



#include "ginc_companion" 



// Function Definitions

void MoveCompanions(object oWP, int bRun=FALSE, float fRange=0.0f);



void main(string sWaypoint, int bRun=FALSE, float fRange=0.0f)

{

	object oCompanion;

	object oPC = GetFirstPC();

	object oWP = GetObjectByTag(sWaypoint);

	

	AssignCommand(oPC, ClearAllActions(TRUE));

	AssignCommand(oPC, ActionForceMoveToObject(oWP, bRun, fRange));



	// Delay the moving of the companions a little bit so the PC has a 

	// head start and can be out in front. 

	DelayCommand(1.0f, MoveCompanions(oWP, bRun, fRange));

}



void MoveCompanions(object oWP, int bRun=FALSE, float fRange=0.0f)

{

	object oPC = GetFirstPC();

	location iLocation = GetLocation(oPC);

	

	// To keep the Companions behind the PC, we increase their distance

	// from the target waypoint a smidge.

	fRange = fRange + 2.5f;

	

	object oMember = GetFirstFactionMember(oPC, FALSE);

	

	while(GetIsObjectValid(oMember))

	{

		// If NOT DEAD

		if(!GetIsDead(oMember))

		{ 

			if(GetIsObjectInParty(oMember))

			{

				AssignCommand(oMember, ClearAllActions(TRUE));

				AssignCommand(oMember, ActionForceMoveToObject(oWP, bRun, fRange));

			}

		}

		

		oMember = GetNextFactionMember(oPC, FALSE);

	}	

}


Modifié par ColorsFade, 07 novembre 2013 - 07:09 .


#15
Tchos

Tchos
  • Members
  • 5 063 messages
Testing (using full editor, tabs, and surrounding with code tags):

/******************************************************************

Moves entire party during a cut-scene.
How it works: Search the roster for members in the player party and 
moves them to the given waypoint.  

Parameters:  
oWP: The waypoint to walk the party to 
bRun: Whether the party should run to the waypoint or walk (default=walk) 
fRange: The distance from the waypoint that the PC should stop.  

Companions will stop before the PC reaches his/her distance, so they 
should end up slightly behind the PC. 

Usage: You should use this script on an NPC Node of a conversation and  
use it in conjunction with a STATIC camera that uses no panning or tracking. 

NOTE: Script are executed before (the player clicks) for a NPC's line and 
after (the player clicks) for a PC's line.

*******************************************************************/

#include "ginc_companion" 

// Function Definitions
void MoveCompanions(object oWP, int bRun=FALSE, float fRange=0.0f);

void main(string sWaypoint, int bRun=FALSE, float fRange=0.0f)
{ 
    object oCompanion; 
    object oPC = GetFirstPC(); 
    object oWP = GetObjectByTag(sWaypoint); 
    AssignCommand(oPC, ClearAllActions(TRUE)); 
    AssignCommand(oPC, ActionForceMoveToObject(oWP, bRun, fRange));

    // Delay the moving of the companions a little bit so the PC has a  
    // head start and can be out in front.  
    DelayCommand(1.0f, MoveCompanions(oWP, bRun, fRange));
}

void MoveCompanions(object oWP, int bRun=FALSE, float fRange=0.0f)
{ 
    object oPC = GetFirstPC(); 
    location iLocation = GetLocation(oPC); 

    // To keep the Companions behind the PC, we increase their distance 
    // fr    om the target waypoint a smidge. 
    fRange = fRange + 2.5f; 

    object oMember = GetFirstFactionMember(oPC, FALSE); 
    while(GetIsObjectValid(oMember)) 
    { 
        // If NOT DEAD 
        if(!GetIsDead(oMember)) 
        {  
            if(GetIsObjectInParty(oMember)) 
            { 
                AssignCommand(oMember, ClearAllActions(TRUE)); 
                AssignCommand(oMember, ActionForceMoveToObject(oWP, bRun, fRange)); 
            } 
        } 
        oMember = GetNextFactionMember(oPC, FALSE); 
    } 
}


#16
ColorsFade

ColorsFade
  • Members
  • 1 270 messages
Thanks Tchos!

I still can't get it right, as far as formatting for this board goes. It looks good when I hit submit... Oh well.