Jump to content

Party Splitting Up


Recommended Posts

I was working on a creature script in my scenario. It would make the creature using it walk up to a practice dummy, pose to stab it, and then place the blood effect on the dummy's space, over and over again.

 

To my surprise, it worked perfectly. Everything regarding that loop worked. But when I moved my party, my first PC would move, but the others would stay and the whole party would split up. Here is a Picture and here is the script segment:

 

Code:
beginstate START_STATE;	which_text_bubble = get_ran(1,1,3);	if (which_text_bubble == 1)		text_bubble_on_char(ME,"Aaargh!");	if (which_text_bubble == 2)		text_bubble_on_char(ME,"I will show no mercy!");	if (which_text_bubble == 3)		text_bubble_on_char(ME,"Die!");	set_state(10);break;beginstate 10;	which_x = which_x - 1;	set_character_facing(ME,2);	text_bubble_on_char(ME,"");	relocate_character(ME,which_x,30);	force_instant_terrain_redraw();	if (which_x == 25) {		set_state(12);	}break;beginstate 11;	which_x = which_x + 1;	set_character_facing(ME,6);	relocate_character(ME,which_x,30);	force_instant_terrain_redraw();	if (which_x == 29) {		set_state(START_STATE);	}break;beginstate 12;	set_character_pose(ME,1);	force_instant_terrain_redraw();	pause(1);	put_effect_on_space(24,30,12,1,2);	run_animation();	set_character_pose(ME,0);	force_instant_terrain_redraw();	set_state(11);break;
Link to comment
Share on other sites

The relocate_character call only moves one character. If applied to a party member, it only moves that member. The location of the rest of the party members remains the same. I guess it could be fixed by having a special case if the character is a party member, probably relocating all four six members individually.

Link to comment
Share on other sites

Okay, so when you want to move a party member rather than an NPC, you need to first use move_party to move them to wherever you want the lead character to be. Then, if you like, you can call relocate_character to arrange the six or less party members however you want.

 

I think you could use ME < 6 to check if a character is in the party.

Link to comment
Share on other sites

Allow me to repeat my problem, because you guys are giving the impression you didn't even stop to read it.

 

I got an NPC to patrol between two spaces. When he gets to one, he shows his attack pose briefly and an effect appears. THIS ALL WORKED PERFECTLY. But when the party goes close to the NPC, they all split up like in the screenshot. I WANT TO FIX THIS.

Link to comment
Share on other sites

I feel your pain. I've hit this too: Celtic Minstrel is right.

 

Basically, whenever you use the relocate_character() on any critter outside a cutscene, PC or not, it screws up the party's movement, causing exactly what you described.

 

There's no way to fix it, either. Aside from not using the relocate_character() call

Link to comment
Share on other sites

So why aren't you just using move_to_loc_x_y() instead of relocate_character(), if you're making a creature script to make an NPC walk somewhere?

 

Sorry, I seem to be missing whatever is going on here.

 

(Also, it's far better to use move_party() four times than use relocate_character() on the party four times or move_party() once and relocate_character() three times, in part because it means that you don't have to do set_character_facing() — this is handled automatically. It also doesn't screw up the view when you do walk again.)

Link to comment
Share on other sites

Quote:
So why aren't you just using move_to_loc_x_y() instead of relocate_character(), if you're making a creature script to make an NPC walk somewhere?

I didn't know relocate_character() was just for cutscenes at the time. I tried fixing it, and the party moved fine. The NPC didn't. So I just gave up and scrapped the creature script idea. Now he's resting in a corner. wink
Link to comment
Share on other sites

Originally Posted By: Celtic Minstrel
I don't understand how using move_party() four times is any different from using it once...
As I said before, using move_party() four times lines the characters up in the right directions. If you use move_party() once and relocate_character() a bunch of times, you have to use set_character_facing() if you want them to be facing the right ways. If you use move_party() four times, they'll be facing the right directions automatically.

The call relocate_character() leaves characters facing the same direction as they started. The call move_party() orients the characters as if the party had just stepped. So if you want the characters to be neatly lined up from (10,10) to (10,13) and all facing south, you can call
Code:
move_party(10,10);move_party(10,11);move_party(10,12);move_party(10,13);

and it's just done. If you want to be sure that the same thing is done with relocate_character(), you have to do this:
Code:
relocate_character(0,10,13);relocate_character(1,10,12);relocate_character(2,10,11);relocate_character(3,10,10);set_character_facing(0,4);set_character_facing(1,4);set_character_facing(2,4);set_character_facing(3,4);

Try it.
Link to comment
Share on other sites

Originally Posted By: Duck Disguised as a Frog
Quote:
So why aren't you just using move_to_loc_x_y() instead of relocate_character(), if you're making a creature script to make an NPC walk somewhere?

I didn't know relocate_character() was just for cutscenes at the time. I tried fixing it, and the party moved fine. The NPC didn't. So I just gave up and scrapped the creature script idea. Now he's resting in a corner. wink
I suspect move_to_loc_x_y just sets that as his target location, so you'll need to move (or pause) before the creature actually does anything.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...