State of Chaos

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: State of Chaos
Shaper
Member # 7472
Profile Homepage #0
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?

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); }


--------------------
Scenarios need reviews! Please rate these scenarios at the CSR after playing them!
AmnesiaDileciaThe Empire's New GroveExpress Delivery
Twilight ValleyWitch HuntWhere the Rivers MeetFoul Hordes
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Lifecrafter
Member # 6193
Profile Homepage #1
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.

--------------------
Guaranteed to blow your mind.

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
Off With Their Heads
Member # 4045
Profile Homepage #2
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); }


[ Saturday, September 23, 2006 15:57: 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
Shaper
Member # 7472
Profile Homepage #3
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. ;)

--------------------
Scenarios need reviews! Please rate these scenarios at the CSR after playing them!
AmnesiaDileciaThe Empire's New GroveExpress Delivery
Twilight ValleyWitch HuntWhere the Rivers MeetFoul Hordes
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Off With Their Heads
Member # 4045
Profile Homepage #4
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? :P

--------------------
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
Shaper
Member # 7472
Profile Homepage #5
Oops. I forgot to make sure that truncating the messages wouldn't cause problems of their own.

--------------------
Scenarios need reviews! Please rate these scenarios at the CSR after playing them!
AmnesiaDileciaThe Empire's New GroveExpress Delivery
Twilight ValleyWitch HuntWhere the Rivers MeetFoul Hordes
Posts: 2686 | Registered: Friday, September 8 2006 07:00