Outdoor Special Encounter

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: Outdoor Special Encounter
Warrior
Member # 1451
Profile Homepage #0
My code:

beginstate 12;
if (get_flag(1,1) == 1) && (get_flag(1,2) == 0)
{
set_state_continue(13);
}
if (get_flag(1,2) == 1)
{
set_state_continue(14);
}
if (has_item(377) == 1) && (get_flag(1,2) == 0)
{
set_state_continue(15);
}
if (get_flag(1,1) == 0)
{
set_state_continue(16);
}

break;

beginstate 13;
reset_dialog();
add_dialog_str(0,"Uncomplete.");
add_dialog_choice(0,"Uh huh.");
break;

beginstate 14;
reset_dialog();
add_dialog_str(0,"Completed.");
add_dialog_choice(0,"Uh huh.");
break;

beginstate 15;
reset_dialog();
add_dialog_str(0,"Completing.");
add_dialog_str(1,"_Thanks._");
add_dialog_choice(0,"Ok.");
award_party_xp(5,1);
reward_give(248);
set_flag(1,2,1);
break;

beginstate 16;

reset_dialog();
add_dialog_str(0,"Description.",0);
add_dialog_str(1,"Description.",0);
add_dialog_str(2,"Description.",0);
add_dialog_str(3,"_Bring._",0);
add_dialog_str(4,"_Ok?_",0);
add_dialog_choice(0,"Maybe.");
set_flag(1,1,1);
toggle_quest(1,1);
break;

I want this to be an outdoor get_me_something_or_other quest. But something's wrong. I don't know where, because I have the error line number problem, but I know this: When I walk into the area it gives me the quest, when I return with the item it shows an error. It shows no messages.

Help me? Please?

--------------------
I am pleased to make contact with your entities.
Posts: 123 | Registered: Sunday, July 7 2002 07:00
Infiltrator
Member # 148
Profile #1
Missing a ( ) for the if statements' conditions.

The conditions must be encased in ( )

Example
beginstate 12;
if ((get_flag(1,1) == 1) && (get_flag(1,2) == 0))

...

if ((has_item(377) == 1) && (get_flag(1,2) == 0))


--------------------
My ego is bigger than yours.
Posts: 480 | Registered: Thursday, October 11 2001 07:00
Warrior
Member # 1451
Profile Homepage #2
That doesn't seem to fix it all the way. I now get a completely different error. Something about wrong numbers.

Anyway thanks.

PS: Do you have BoA bitmaps for those giant blue chickens? I could probably use them.

EDIT: I've noticed I missed a few ',0'. I placed them where they should be, now there is no error. It only works in a strange way -- no messages!

[ Tuesday, June 29, 2004 17:37: Message edited by: Abu Dhabi ]

--------------------
I am pleased to make contact with your entities.
Posts: 123 | Registered: Sunday, July 7 2002 07:00
Infiltrator
Member # 148
Profile #3
Post the new script + comments. Always, always comment.

--------------------
My ego is bigger than yours.
Posts: 480 | Registered: Thursday, October 11 2001 07:00
Warrior
Member # 1451
Profile Homepage #4
My code, revised:

beginstate 12; // This is supposed to check SDFs
// and items
if ((get_flag(1,1) == 1) && (get_flag(1,2) == 0))
{
set_state_continue(13);
}
if (get_flag(1,2) == 1)
{
set_state_continue(14);
}
if ((has_item(377) == 1) && (get_flag(1,2) == 0))
{
set_state_continue(15);
}
if (get_flag(1,1) == 0)
{
set_state_continue(16);
}

break;

beginstate 13; // Been here before, not finished
// the quest
reset_dialog();
add_dialog_str(0,"Incomplete.",0);
add_dialog_choice(0,"Uh huh.");
break;

beginstate 14; // Been here before, finished the
// quest
reset_dialog();
add_dialog_str(0,"Completed.",0);
add_dialog_choice(0,"Uh huh.");
break;

beginstate 15; // Have the right item, rewardng
// now
reset_dialog();
add_dialog_str(0,"Completing.",0);
add_dialog_str(1,"_Thanks._");
add_dialog_choice(0,"Ok.");
take_item(377);
award_party_xp(5,1);
reward_give(248);
set_flag(1,2,1);
break;

beginstate 16; // This sould be the first after
// the SDF check but I think it will work anyhow,
// as long as the SDF check is correct
// This describes the first visit to the encounter
reset_dialog();
add_dialog_str(0,"Description.",0);
add_dialog_str(1,"Description.",0);
add_dialog_str(2,"Description.",0);
add_dialog_str(3,"_Bring._",0);
add_dialog_str(4,"_Ok?_",0);
add_dialog_choice(0,"Maybe.");
set_flag(1,1,1);
toggle_quest(1,1);
break;

Happy?

--------------------
I am pleased to make contact with your entities.
Posts: 123 | Registered: Sunday, July 7 2002 07:00
Warrior
Member # 4492
Profile #5
run_dialog(1)?
Posts: 61 | Registered: Wednesday, June 9 2004 07:00
Warrior
Member # 1451
Profile Homepage #6
Come again?

--------------------
I am pleased to make contact with your entities.
Posts: 123 | Registered: Sunday, July 7 2002 07:00
Shock Trooper
Member # 3022
Profile #7
reset_dialog();
add_dialog_str(0,"Description.",0);
add_dialog_str(1,"Description.",0);
add_dialog_str(2,"Description.",0);
add_dialog_str(3,"_Bring._",0);
add_dialog_str(4,"_Ok?_",0);
add_dialog_choice(0,"Maybe.");
set_flag(1,1,1);
toggle_quest(1,1);
I don't know scripts much, but it looks like you have set up a dialog, but haven't run it.
Posts: 269 | Registered: Saturday, May 24 2003 07:00
Warrior
Member # 1451
Profile Homepage #8
Where should I put run_dialog(1)?

Right after reset_dialog() or somewhere else?

--------------------
I am pleased to make contact with your entities.
Posts: 123 | Registered: Sunday, July 7 2002 07:00
Infiltrator
Member # 148
Profile #9
reset the dialog, create the dialog (and choices), then run the dialog.

--------------------
My ego is bigger than yours.
Posts: 480 | Registered: Thursday, October 11 2001 07:00
Warrior
Member # 1451
Profile Homepage #10
Thanks guys! It works now. It still has some minoer flaws, but I should be able to work it out from now.

Thanks again!

--------------------
I am pleased to make contact with your entities.
Posts: 123 | Registered: Sunday, July 7 2002 07:00