Rotghroth Rhapsody Duck in a Top Hat Posted June 12, 2009 Share Posted June 12, 2009 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; Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted June 12, 2009 Share Posted June 12, 2009 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. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted June 12, 2009 Share Posted June 12, 2009 One way that I accomplish this is using move_party() four (or six) times, which will line them up as they're supposed to be. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted June 12, 2009 Share Posted June 12, 2009 I was proposing using relocate_character six times. ...Though, if you do that, will the party revert to their original location once they take a step? Or is the party's location synonymous with the location of the lead character? Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted June 12, 2009 Share Posted June 12, 2009 The game stores the party's location separately from the lead character's postion, so using relocate_character alone will do odd things like send away all of the later party members, who will come back one by one as the party leader moves (or other results, depending on the context of usage). Quote Link to comment Share on other sites More sharing options...
Rotghroth Rhapsody Duck in a Top Hat Posted June 12, 2009 Author Share Posted June 12, 2009 I am unclear on what exactly you want me to do. Can you be a bit more specific? Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted June 12, 2009 Share Posted June 12, 2009 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. Quote Link to comment Share on other sites More sharing options...
Rotghroth Rhapsody Duck in a Top Hat Posted June 12, 2009 Author Share Posted June 12, 2009 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. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Nioca Posted June 12, 2009 Share Posted June 12, 2009 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 Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted June 12, 2009 Share Posted June 12, 2009 I was actually confused, since I thought you were saying you wanted to make a PC do the same thing as the NPC. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted June 13, 2009 Share Posted June 13, 2009 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.) Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted June 13, 2009 Share Posted June 13, 2009 I don't understand how using move_party() four times is any different from using it once... Quote Link to comment Share on other sites More sharing options...
Rotghroth Rhapsody Duck in a Top Hat Posted June 13, 2009 Author Share Posted June 13, 2009 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. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted June 13, 2009 Share Posted June 13, 2009 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. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted June 13, 2009 Share Posted June 13, 2009 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. 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.