Understated Ur-Drakon Nioca Posted September 23, 2006 Share Posted September 23, 2006 I'm having a small problem with one of my town scripts, and I can't figure out why. Here is what's going on. The party walks up to a lever and gets ambushed. Once the ambushers are defeated, the party can pull the lever. The thing is, once the hidden group appears, the whole town script shuts down. Any error message I recieve is lost because the monsters act instantly after the state is called. Here is the state. Any ideas? Code: beginstate 53; if ((get_flag(4,9) == 250) && (is_combat() == 0)) { reset_dialog(); add_dialog_str(0,"Yet again, you attempt to approach this lever. It appears that...",0); add_dialog_str(1,"What do you want to do?",0); add_dialog_choice(0,"Pull the lever."); add_dialog_choice(1,"Back away slowly."); choice = run_dialog(0); if (choice == 1) { if (get_flag(4,5) < 5) { set_terrain(37,46,392); set_terrain(41,46,392); set_terrain(37,42,392); set_terrain(41,42,392); set_flag(4,5,1); flip_terrain(29,42); play_sound(94); pause(2); flip_terrain(29,42); play_sound(94); message_dialog("When you pull this lever, you hear..."); } if (get_flag(4,5) == 125) { set_flag(4,5,250); flip_terrain(29,42); play_sound(94); pause(2); flip_terrain(29,42); play_sound(94); pause(3); play_sound(162); message_dialog("When you pull this lever, you hear..."); } if (get_flag(4,5) == 250) { flip_terrain(29,42); play_sound(94); pause(2); flip_terrain(29,42); play_sound(94); print_str_color("Nothing seems to happen.",3); } } } if (get_flag(4,9) == 0) { message_dialog("As you approach the lever, you hear a rustling noise from..."); set_terrain(26,42,0); set_terrain(27,43,0); set_terrain(26,44,0); set_terrain(26,45,0); set_terrain(28,46,0); set_terrain(30,46,0); set_terrain(29,45,0); set_terrain(29,44,0); set_terrain(30,44,0); set_terrain(31,43,0); set_terrain(32,45,0); activate_hidden_group(3); set_flag(4,9,250); } Quote Link to comment Share on other sites More sharing options...
Unflappable Drayk Lazarus. Posted September 23, 2006 Share Posted September 23, 2006 Make sure all the dialog strings are of the appropriate length, make sure all message_dialogs have a "" for empty strings. If neither of these is a problem, then temporarily delete all monsters in hidden group 3 so that you can see the error message before they print over it. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted September 23, 2006 Share Posted September 23, 2006 Code: beginstate 53; if ((get_flag(4,9) == 250) && (is_combat() == 0)) { reset_dialog(); add_dialog_str(0,"Yet again, you attempt to approach this lever. It appears that...",0); add_dialog_str(1,"What do you want to do?",0); add_dialog_choice(0,"Pull the lever."); add_dialog_choice(1,"Back away slowly."); choice = run_dialog(0); if (choice == 1) { if (get_flag(4,5) < 5) { set_terrain(37,46,392); set_terrain(41,46,392); set_terrain(37,42,392); set_terrain(41,42,392); set_flag(4,5,1); flip_terrain(29,42); play_sound(94); pause(2); flip_terrain(29,42); play_sound(94); ********************message_dialog("When you pull this lever, you hear..."); } if (get_flag(4,5) == 125) { set_flag(4,5,250); flip_terrain(29,42); play_sound(94); pause(2); flip_terrain(29,42); play_sound(94); pause(3); play_sound(162); ************************message_dialog("When you pull this lever, you hear..."); } if (get_flag(4,5) == 250) { flip_terrain(29,42); play_sound(94); pause(2); flip_terrain(29,42); play_sound(94); print_str_color("Nothing seems to happen.",3); } } } if (get_flag(4,9) == 0) { ************************message_dialog("As you approach the lever, you hear a rustling noise from...");[/b] set_terrain(26,42,0); set_terrain(27,43,0); set_terrain(26,44,0); set_terrain(26,45,0); set_terrain(28,46,0); set_terrain(30,46,0); set_terrain(29,45,0); set_terrain(29,44,0); set_terrain(30,44,0); set_terrain(31,43,0); set_terrain(32,45,0); activate_hidden_group(3); set_flag(4,9,250); } Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Nioca Posted September 23, 2006 Author Share Posted September 23, 2006 Two thing I've learned today. First, the message pane has a scroll bar! Secondly, it's much harder to pin down an error if you don't see the message, even if it's something common. Like in this case, where the problem was a missing 'break;' at the end of the state. By the way, Kel, those were truncated message_dialog calls. That's not how they actually appear in the script. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted September 23, 2006 Share Posted September 23, 2006 Quote: Originally written by Nioca:By the way, Kel, those were truncated message_dialog calls. That's not how they actually appear in the script. You mean you inserted three errors into the script and then asked us to find errors? Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Nioca Posted September 24, 2006 Author Share Posted September 24, 2006 Oops. I forgot to make sure that truncating the messages wouldn't cause problems of their own. 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.