Iffy scripting problems

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: Iffy scripting problems
Canned
Member # 8014
Profile #0
There is something wrong with my scripts and I can't figure it out. When I test them in-game, I am getting errors.

It says:
t5 Error: Improper command in line 0.
t5dlg Error: Unknown command text in line 17.

And these are the scripts
t5:
begintownscript;

variables;


body;

beginstate
INIT_STATE;

// Setting crime level because this is a friendly town.

set_crime_tolerance(2);
And t5dlg:
begintalkscript;

variables;
short
bmessage;

begintalknode 1;
state = -1;
nextstate = 1;
question = "Commander G";
text1 = "Surprisingly, here is Commander G once again. Obviously he has survived. And he seems just as surprised to see you.";

begintalknode 2;
state = 1;
nextstate = -1;
question = "H...How did you and the others survive?";
text = "_Hello to you too. To make a long story short, we were ambushed by some muffins...I think. Maybe I was drunk. Well they were too powerfull and we had to retreat. We came across a portal and we ended up here. With no way back, we had to start constucting a temporary fort._";
So what is wrong? I can't figure it out.

--------------------
I can transform into almost anything, but not sanity -Iffy
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
I like this image
Not in your shed -We are still under developement, but help would be nice. By the way, most of the conversation goes in the Moderator forum, in case your confused.
Everyone, just call me Iffy. Please.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Lifecrafter
Member # 6193
Profile Homepage #1
Init_state needs a break;

Last "text" should be "text1" Texts are always numbered.

Edit: For future reference, "Line 0" errors are almost always caused by missing breaks. Dialog script errors are pretty easy to diagnose. In this case it's an improper command error, so you know it's probably going to be a typo in one of your commands. To make things easier, you're given the line number in which it occurs. If you aren't already, use a text editor with a "go-to line" command. Check the line in question (27 in this case, though Averscript is weird about line numbers so check 26 and 28 as well) for unmatched quotation marks, missing semicolons, or unaccepted commands. That's really about all that can go wrong.

[ Saturday, December 01, 2007 13:23: Message edited by: Lazarus. ]

--------------------
"NOW PASS ME MY BOOTS. I HAVE AN APPOINTMENT WITH A FACE." -Nikki

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
Law Bringer
Member # 4153
Profile Homepage #2
With the dialogue script, two things. First, you don't need a line break after 'short'. In fact, you need to keep it on the same line as the variable. Second, down at the bottom, instead of 'text1', you just have 'text'.

With the town script, you want beginstate and whatever state it is to be on the same line (and you want to add a START_STATE and an EXIT_STATE, even if they're empty).

Generally speaking, don't interrupt lines of code with a line break.

--------------------
TM: "I want BoA to grow. Evolve where the food ladder has rungs to be reached."

Gamble with Gaea, and she eats your dice.
Posts: 4130 | Registered: Friday, March 26 2004 08:00
Canned
Member # 8014
Profile #3
I didn't interupt lines of code, it did that when I copied and pasted.
And now it says
t5dlg error: Overlong or unending string in line 17.
(red)t5 Error: State not found -2

And short is on the same line as variable. And other scenarios don't have the START_STATE and EXIT_STATE.
Oh and...
begintownscript;

variables;


body;

beginstate
INIT_STATE;

break;

// Setting crime

level because this is a friendly town.

set_crime_tolerance(2);
begintalkscript;

variables;
short
bmessage;

begintalknode 1;
state =

-1;
nextstate = 1;
question =

"Commander G";
text1 = "Surprisingly,

here is Commander G once again.

Obviously he has survived. And he seems

just as surprised to see you.";

begintalknode 2;
state = 1;
nextstate

= -1;
question = "H...How did you and

the others survive?";
text1 = "_Hello

to you too. To make a long story short,

we were ambushed by some muffins...I

think. Maybe I was drunk. Well they

were too powerfull and we had to

retreat. We came across a portal and we

ended up here. With no way back, we had

to start constucting a temporary

fort._";
So what is wrong now?

--------------------
I can transform into almost anything, but not sanity -Iffy
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
I like this image
Not in your shed -We are still under developement, but help would be nice. By the way, most of the conversation goes in the Moderator forum, in case your confused.
Everyone, just call me Iffy. Please.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Lifecrafter
Member # 6193
Profile Homepage #4
Breaks come at the end of a state, after the state's code. So...
beginstate x;
//Code goes here.
//Some more code might go here.
//Still more....
break;
And while you can get away without an init, exit and start state, it's common practice to include them even if they're empty. There's a good chance you'll use them later (At least the start and init states).

Also, strings can only be 255 characters long. You'll get an overlong string error if you exceed this. Sometimes this is caused by a missing quotation mark, but here it appears you're just over the limit (Not by much I'd guess, though I'm not counting.) Either reduce the length or split the text into a text1 and text2

--------------------
"NOW PASS ME MY BOOTS. I HAVE AN APPOINTMENT WITH A FACE." -Nikki

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
? Man, ? Amazing
Member # 5755
Profile #5
Does it matter that the first character in either snippet of code is a space?

--------------------
Synergy, et al - "I don't get it."

Thralni - "a lot of people are ... too weird to be trusted"
Posts: 4114 | Registered: Monday, April 25 2005 07:00
Law Bringer
Member # 4153
Profile Homepage #6
When it tells you 'overlong or unending string', that means that one of the strings you used is over 255 characters long. I think that refers to the last string in your sample code ('cause it's really long).

And 'break;' goes at the very end of a state, not right after the beginstate line. It's probably getting confused because set_crime_tolerance(2) is just kinda hanging out in the script, outside of any state.

--------------------
TM: "I want BoA to grow. Evolve where the food ladder has rungs to be reached."

Gamble with Gaea, and she eats your dice.
Posts: 4130 | Registered: Friday, March 26 2004 08:00
Canned
Member # 8014
Profile #7
I don't know what AIM is.

--------------------
I can transform into almost anything, but not sanity -Iffy
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
I like this image
Not in your shed -We are still under developement, but help would be nice. By the way, most of the conversation goes in the Moderator forum, in case your confused.
Everyone, just call me Iffy. Please.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Off With Their Heads
Member # 4045
Profile Homepage #8
quote:
Originally written by Iffy couldn't pick a name:

I don't know what AIM is.
Iffy, if you don't know what something on these boards is, just Google it.

Uh, and make sure that it's not an image (which this one isn't.)

--------------------
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
Law Bringer
Member # 4153
Profile Homepage #9
Iffy: When you get it running, the box in our profiles with "AIM ID" is the handle you should contact us at.

--------------------
TM: "I want BoA to grow. Evolve where the food ladder has rungs to be reached."

Gamble with Gaea, and she eats your dice.
Posts: 4130 | Registered: Friday, March 26 2004 08:00