A novice needs help!

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: A novice needs help!
Infiltrator
Member # 2245
Profile Homepage #0
HELP!

I'm having a crack at scripting, however, it's not working the way I thought it should.

Here's the deal. When the party steps on a certain spot at town, I want a message displayed.

I placed a special node at a spot, and let it be 11.

Then I typed the script for my town.

begintownscript;
variables;
body;
beginstate 10;
message_dialog("Testing, on two three");

break;

However, I get an error.

State not found - 0

Huh? Didn't I just define the state in my script?

--------------------
VIVE LA TAKERS!
VIVE LA REBELLION!
VIVE LA GHALDRING!
Posts: 522 | Registered: Friday, November 15 2002 08:00
Apprentice
Member # 4258
Profile #1
quote:
Originally written by Waylander:



State not found - 0

Huh? Didn't I just define the state in my script?

No, you defined state 10. There a few special states that you NEED to have defined in each town script. They are:

beginstate INIT_STATE;
// This state called whenever this town is entered.

break;

beginstate EXIT_STATE;
// Always called when the town is left.

break;

beginstate START_STATE;
// This state is called every turn the party is in this town.

break;
When you first entered the town it looked for the INIT_STATE in your script (state 0), couldn't find it, and gave you an error. If you don't want anything special to happen on entrance, you can just leave that state empty, but it must be defined.

[ Friday, July 09, 2004 21:02: Message edited by: Gorvin ]
Posts: 28 | Registered: Wednesday, April 14 2004 07:00
Apprentice
Member # 4531
Profile #2
Also, the message_dialog command requires two strings, even if the second one is blank. For example:

message_dialog("Testing, on two three","");

note the second set of quotes which do notheing but are required for the game to show the dialog box properly.
Posts: 32 | Registered: Saturday, June 12 2004 07:00
Infiltrator
Member # 2245
Profile Homepage #3
THANKS!
It didn't show that in the example.

--------------------
VIVE LA TAKERS!
VIVE LA REBELLION!
VIVE LA GHALDRING!
Posts: 522 | Registered: Friday, November 15 2002 08:00
Apprentice
Member # 4729
Profile #4
NOTE: The secoind set of quotes are used for something - for a second paragraph, since every paragraph can only be [some number] (think it was 256) characters long. So you can do like this:
message_dialog("blablablablablablablablablablablablablablablablablablablablablablablablablablabla Ooops I think thats almost 256 char. long I 'll continue on the other paragraph","I'm continuing to write nonsense...");
Posts: 7 | Registered: Friday, July 16 2004 07:00
Agent
Member # 4506
Profile Homepage #5
quote:
Originally written by Nerubian_Lord:

NOTE: The secoind set of quotes are used for something - for a second paragraph, since every paragraph can only be [some number] (think it was 256) characters long. So you can do like this:
message_dialog("blablablablablablablablablablablablablablablablablablablablablablablablablablabla Ooops I think thats almost 256 char. long I 'll continue on the other paragraph","I'm continuing to write nonsense...");

Each thing can only be for 250 symbols long. It's annoying, but we've got to stick with it.

--------------------
"You dare Trifle with Avernum?" ~ Erika the Archmage
--------------------
My Scenarios:
Undead Valley : A small Undead problem, what could possibly go wrong?
--------------------
Richard Black - PROOF of his existance (the Infernal one's website).
--------------------
MY FORUM! Randomosity at it's highest! :)
Posts: 1370 | Registered: Thursday, June 10 2004 07:00
Warrior
Member # 286
Profile #6
It's supposed to be 255, but I made a string 255 characters long and BoA complained at me. I shortened it to 254 and it was perfectly happy. Crazy stuff.

--------------------
Z: "I just feel so insignificant."
Psych: "You ARE. You're an ANT."
--Antz
Posts: 104 | Registered: Saturday, November 17 2001 08:00
Apprentice
Member # 4729
Profile #7
This is because BoA counts the 0
Posts: 7 | Registered: Friday, July 16 2004 07:00
Warrior
Member # 286
Profile #8
Yeah, I realised that soon after posting. :) 255 characters including the terminating null character, so effectively 254 characters.

*grumbles at C strings*

--------------------
Z: "I just feel so insignificant."
Psych: "You ARE. You're an ANT."
--Antz
Posts: 104 | Registered: Saturday, November 17 2001 08:00