Jump to content

Help with a cutscene


Recommended Posts

I want the party to walk to the cordinate x15 y10, but since they are coming from many directions I just don't know which are going to be their initial coordinates, so what I am trying first is to march the party to coordinate x15 y7 (the special is called from a rectangle of 8*1 so the initial coordinate "y" will always be 7) and then making them walk to the coordinate x15 y10. Nevertheless I am having trouble with the script.

 

Code:
  beginstate 10;x = char_loc_x(0);While (x != 15) {	If (x > 15) {		march_party(x - 1,7);		force_instant_terrain_redraw();		pause(5);		x = x - 1;		}	If (x < 15) {		march_party(x + 1,7);		force_instant_terrain_redraw();		pause(5);		x = x + 1;		}	}march_party(15,8);force_instant_terrain_redraw();pause(5);march_party(15,9);force_instant_terrain_redraw();pause(5);march_party(15,10);force_instant_terrain_redraw();pause(5);break;
My problems are the following

 

a) I don't know why, but the code is just called when I step into the special encounter for a second time.

 

B) After the cut scene ends my first character ends up in the place where he was before the cutscene started.

Link to comment
Share on other sites

I have no idea about a, but I believe you can fix b with a block_entry call. Since the state is called before the party actually steps into the space, what's happening is that it's playing the cut scene and then stepping into the space from before. I think just sticking block_entry(1) at the beginning of this state will fix that.

Link to comment
Share on other sites

Yeah I realised that what was happening is that when the party entered the town it was placed in a way that the character 0 doesn't need to step on the special encounter.

 

I am having trouble with another part of the cutscene, I want a band of brigands to show up and I have used the following code:

 

Code:
text_bubble_on_char(i,"");		i = random_party_member();text_bubble_on_char(i,"Huh?");		force_instant_terrain_redraw();pause(15);put_effect_on_char(6,10,1,0);put_effect_on_char(7,10,1,0);put_effect_on_char(8,10,1,0);put_effect_on_char(9,10,1,0);put_effect_on_char(10,10,1,0);force_instant_terrain_redraw();play_sound(61);activate_hidden_group(2);pause(20);set_total_visibility(1);force_view_center(15,14);text_bubble_on_char(i,"");		i = random_party_member();text_bubble_on_char(i,"Uh oh");		force_instant_terrain_redraw();pause(15);
However, the brigands appear first and then the teleport effect takes place.
Link to comment
Share on other sites

Thanks, the cutscene is done now. However, the only problem is that it only works for a party with 4 characters. What is the best way to check which characters are present? Also, is there a way to know which one is the character leading the party because if character 0 is dead then there would be a bug in my script.

Link to comment
Share on other sites

I do some really freaky things to check the party composition in the HLPM.

 

From state 12 in t0Party Build.txt:

Code:
	// Figure out who's in the party. The first character becomes i, the second	// j, and the third k. If there are four, ignore this madness.	i = 0;	while (char_ok(i) == 0)		{i = i + 1; }	if (party_size() == 2)		{if (char_ok(i + 3))			j = i + 3;		if (char_ok(i + 2))			j = i + 2;		if (char_ok(i + 1))			j = i + 1;		}	if (party_size() == 3)		{if (char_ok(i + 3) == 0)			{j = i + 1;			k = i + 2; }		if (char_ok(i + 2) == 0)			{j = i + 1;			k = i + 3; }		if (char_ok(i + 1) == 0)			{j = i + 2;			k = i + 3; }		}  
And then if (party_size() == 4), just deal with 0,1,2, and 3 as normal.

 

It gets rather more complicated if you have joined NPCs, though.

 

EDIT: Basically, you can use some combination of party_size and char_ok to figure this out. Also that first bit

 

i = 0;

while (char_ok(i) == 0)

{i = i + 1; }

 

will figure out the leading character. Unfortunately, first_group_member(0) doesn't seem to do this reliably, and it would be the most obvious answer if it worked.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...