Doesn't Recognize States

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: Doesn't Recognize States
Guardian
Member # 6670
Profile Homepage #0
Okay, a little peer editing would be nice before you all point fingers and laugh:

I've started scripting, and in one town I can't get the game to run the states when the party enters a special encounter rectangle. In the outdoors, it works fine (DO YOU WISH TO LEAVE?). I've typed up the script just the same as I did for the outdoors, and in just the same way as other scenarios have theirs. The special encounter rectangles look fine in the editor, and I DID put the script name in 'Town Details'.

Please tell me what I am doing wrong, before I rip my hair out (below is my script: just ignore the incomplete text stubs for now).

// 3: Vahnatai Cave

begintownscript;

variables;
short choice;

body;

beginstate INIT_STATE;
add_range_to_group(6,24,1);
break;

beginstate EXIT_STATE;
set_flag(3,2,0);
break;

beginstate START_STATE;
break;

beginstate 10;
if (has_special_item(0) == 0) {
message_dialog("YOU GET STONE");
change_spec_item(0,1);
}
break;

beginstate 11;
if ((has_special_item(0) != 0) || (get_flag(3,3) == 1))
message_dialog("YOU HAVE STONE OR HAVE BROKEN CRYSTAL");
else {
message_dialog("YOU DON'T HAVE STONE");
set_flag(3,2,1);
}
break;

beginstate 12;
if (get_flag(3,3) != 1) {
reset_dialog();
add_dialog_str(0, "SMASH?", 0);
add_dialog_choice(0, "YES");
add_dialog_choice(1, "NO");
choice = run_dialog(1);
if (choice == 1) {
set_flag(3,3,1);
play_sound(-108);
swap_terrain(31,6,445,446);
}
}
break;
Thanks in advance.

--------------------
IF I EVER BECOME AN EVIL OVERLORD:
If all the heroes are standing together around a strange device and begin to taunt me, I will pull out a conventional weapon instead of using my unstoppable superweapon on them.
Posts: 1509 | Registered: Tuesday, January 10 2006 08:00
Off With Their Heads
Member # 4045
Profile Homepage #1
You don't happen to get a big, red error message at any point when walking around in this town, do you?

I notice that your message_dialog calls only have one string each. They need two.

--------------------
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
Guardian
Member # 6670
Profile Homepage #2
EDIT: ARGHHHHHHHHHH!!!!!!!!!

Okay, here's what happened:

- I fanatically back up all my work. Normally, I keep my current work in the Data folder, and keep the latest finished version in the Scenario folder.
- The first error I noticed was that the town did not have the script listed in Town Details. I changed the copy in the Data folder, but not the one in the Scenario folder.
- I tried every single possible combination of calls in the script, not knowing the game had no way to refer to it.

Moral of the story: yes, there is a downside to frequently backing up your work. You may all point and laugh now.

(By the way, it works now. Even the guardians who heal periodically based on the current state of two SDFs. If anyone wants this creature script, let me know.)

--------------------
(Self-facepalm.)

[ Friday, April 14, 2006 12:05: Message edited by: Dintiradan ]
Posts: 1509 | Registered: Tuesday, January 10 2006 08:00