Help with a cutscene

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Help with a cutscene
Warrior
Member # 2838
Profile #0
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.

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.

--------------------
…../|,-‘`¯¯`\(o)_\,----,,,_………
…( `\(o),,_/` ¯ : o : :: o`-, … I'm under your bed.
Posts: 118 | Registered: Wednesday, April 2 2003 08:00
Off With Their Heads
Member # 4045
Profile Homepage #1
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.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Warrior
Member # 2838
Profile #2
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:

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.

--------------------
…../|,-‘`¯¯`\(o)_\,----,,,_………
…( `\(o),,_/` ¯ : o : :: o`-, … I'm under your bed.
Posts: 118 | Registered: Wednesday, April 2 2003 08:00
Off With Their Heads
Member # 4045
Profile Homepage #3
For effects, you want run_animation, not force_instant_terrain_redraw.

EDIT: And you could combine this with play_sound using run_animation_sound. I wrote an article on this that you may find useful.

[ Thursday, July 22, 2004 09:27: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Warrior
Member # 2838
Profile #4
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.

--------------------
…../|,-‘`¯¯`\(o)_\,----,,,_………
…( `\(o),,_/` ¯ : o : :: o`-, … I'm under your bed.
Posts: 118 | Registered: Wednesday, April 2 2003 08:00
Off With Their Heads
Member # 4045
Profile Homepage #5
I do some really freaky things to check the party composition in the HLPM.

From state 12 in t0Party Build.txt:
// 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.

[ Thursday, July 22, 2004 11:42: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00