Dialoge script error.

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: Dialoge script error.
Canned
Member # 8014
Profile #0
I keep getting this error in the dialog script, and it isn't being specific. It just says "Dialogue script error: in line 43". I just can't figure it out. I've tried everything.

Here is the part of the script I am pretty sure it is around.

begintalknode 6;
state = 3;
nextstate = -1;
question = "So what do we have to do?";
text1 = "_Go to a cave that is west from here. In there you will find two portals. Take the left one. The other leads to Hell._";
text2 = "_After that, get through the maze and take the items there. Then come back. I hope you succede. I really need help. And those items will be neccisary_"; code = toggle_quest(0,1); break;

begintalknode 7;
state = 1;
nextstate = 4;
if (get_flag(0,23) == 1) { question = "Hey, we got the items you wanted!";
text1 = "_Great. And you should thank me for the portal. You are probably wondering what those are exactly._");
text2 = "_They are called the 'Bow of God' and 'Arrow of Heaven'. They are called this because they are special._";
text3 = "_The 'Bow of God' is the only bow that can shoot the 'Arrow of Heaven'. Both of them only appear if there is some crazy non-stop demon someplace. And they appear in a secret location, only told to someone in a dream._";
set_flag(0,23,1);
}


--------------------
Don't judge a sentence until you know all the words.
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
Muffins n' Hell: The End is Near
Not in your shed -We are sort of done. Helpful criticism is welcome.
Everyone, just call me Iffy. Please.

Be grateful you have your unsellabe trowels -Goldenking

Just so you know, I am working on Muffins n' Hell the scenario.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Law Bringer
Member # 4153
Profile Homepage #1
Wow, that's broken.

begintalknode 6;
state = 3;
nextstate = -1;
question = "So what do we have to do?";
text1 = "_Go to a cave that is west from here. In there you will find two portals. Take the left one. The other leads to Hell._";
text2 = "_After that, get through the maze and take the items there. Then come back. I hope you succeed. I really need help. And those items will be necessary_";
code =
toggle_quest(0,1);
break;
//the code block and break; need separate lines


begintalknode 7;
state = 1;
nextstate = 4;
condition = get_flag(0,23) == 1;
question = "Hey, we got the items you wanted!";
text1 = "_Great. And you should thank me for the portal. You are probably wondering what those are exactly._"; //Removed a stray parenthesis here
text2 = "_They are called the 'Bow of God' and 'Arrow of Heaven'. They are called this because they are special._";
text3 = "_The 'Bow of God' is the only bow that can shoot the 'Arrow of Heaven'. Both of them only appear if there is some crazy non-stop demon someplace. And they appear in a secret location, only told to someone in a dream._";
code =
set_flag(0,23,1);
break;
So, some pointers. The way you make dialog nodes only appear once is through condition statements. (Look this up in the docs) It uses a line like:
condition = get_flag(0,23) == 1;But the only time you should be using if-statements in a dialog script is in the code section.

Two, you need more line breaks, because there were a couple of things that wound up on the same line. Generally speaking, give each chunk of the node its own line.

Three, I caught a stray parenthesis after a text segment.

Fourth, I corrected some spelling errors. I think that's all.

[ Friday, January 18, 2008 16:13: Message edited by: Ephesos ]

--------------------
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
Shaper
Member # 7472
Profile Homepage #2
Several problems with the dialogue script.

1. The code line goes on an individual line. For example, instead of:
begintalknode 6;
state = 3;
nextstate = -1;
question = "So what do we have to do?";
text1 = "_Go to a cave that is west from here. In there you will find two portals. Take the left one. The other leads to Hell._";
text2 = "_After that, get through the maze and take the items there. Then come back. I hope you succede. I really need help. And those items will be neccisary_"; code = toggle_quest(0,1); break;
It should instead read like this:
begintalknode 6;
state = 3;
nextstate = -1;
question = "So what do we have to do?";
text1 = "_Go to a cave that is west from here. In there you will find two portals. Take the left one. The other leads to Hell._";
text2 = "_After that, get through the maze and take the items there. Then come back. I hope you succede. I really need help. And those items will be neccisary_";
code = toggle_quest(0,1); // << SEE THE DIFFERENCE? <<
break;
2. If you want to display a node only if a certain condition is met, you use the condition field instead of an if operator. You also don't use brackets with it.

So this:
begintalknode 7;
state = 1;
nextstate = 4;
if (get_flag(0,23) == 1) { question = "Hey, we got the items you wanted!";
text1 = "_Great. And you should thank me for the portal. You are probably wondering what those are exactly._");
text2 = "_They are called the 'Bow of God' and 'Arrow of Heaven'. They are called this because they are special._";
text3 = "_The 'Bow of God' is the only bow that can shoot the 'Arrow of Heaven'. Both of them only appear if there is some crazy non-stop demon someplace. And they appear in a secret location, only told to someone in a dream._";
set_flag(0,23,1);
}
should look like this:
begintalknode 7;
state = 1;
nextstate = 4;
condition = (get_flag(0,23) == 1); // << SEE THE DIFFERENCE? <<
question = "Hey, we got the items you wanted!";
text1 = "_Great. And you should thank me for the portal. You are probably wondering what those are exactly._"); // << YOU HAVE A SUPERFLUOUS PARENTHESIS HERE; REMOVE IT <<
text2 = "_They are called the 'Bow of God' and 'Arrow of Heaven'. They are called this because they are special._";
text3 = "_The 'Bow of God' is the only bow that can shoot the 'Arrow of Heaven'. Both of them only appear if there is some crazy non-stop demon someplace. And they appear in a secret location, only told to someone in a dream._";
set_flag(0,23,1); // << THIS IS ALSO WRONG; SEE #3 <<
3. All non-dialogue code done in dialogue nodes must be done using a code field, like the one that toggles the quest in node 6. I suspect that you may have been trying to use a dialogue action here, which takes place in the action field. So instead of this:
begintalknode 7;
state = 1;
nextstate = 4;
condition = (get_flag(0,23) == 1);
question = "Hey, we got the items you wanted!";
text1 = "_Great. And you should thank me for the portal. You are probably wondering what those are exactly._";
text2 = "_They are called the 'Bow of God' and 'Arrow of Heaven'. They are called this because they are special._";
text3 = "_The 'Bow of God' is the only bow that can shoot the 'Arrow of Heaven'. Both of them only appear if there is some crazy non-stop demon someplace. And they appear in a secret location, only told to someone in a dream._";
set_flag(0,23,1);
It should look like either this:
begintalknode 7;
state = 1;
nextstate = 4;
condition = (get_flag(0,23) == 1);
question = "Hey, we got the items you wanted!";
text1 = "_Great. And you should thank me for the portal. You are probably wondering what those are exactly._";
text2 = "_They are called the 'Bow of God' and 'Arrow of Heaven'. They are called this because they are special._";
text3 = "_The 'Bow of God' is the only bow that can shoot the 'Arrow of Heaven'. Both of them only appear if there is some crazy non-stop demon someplace. And they appear in a secret location, only told to someone in a dream._";
code = set_flag(0,23,1); // << SEE THE DIFFERENCE? <<
break;
or this:
begintalknode 7;
state = 1;
nextstate = 4;
condition = (get_flag(0,23) == 1);
question = "Hey, we got the items you wanted!";
text1 = "_Great. And you should thank me for the portal. You are probably wondering what those are exactly._";
text2 = "_They are called the 'Bow of God' and 'Arrow of Heaven'. They are called this because they are special._";
text3 = "_The 'Bow of God' is the only bow that can shoot the 'Arrow of Heaven'. Both of them only appear if there is some crazy non-stop demon someplace. And they appear in a secret location, only told to someone in a dream._";
action = SET_SDF 0 23 1; // << SEE THE DIFFERENCE? <<
The latter of the two options is quicker and cleaner to use, but it really comes down to personal preference.

EDIT: Ephesos beat me to it.

[ Friday, January 18, 2008 16:20: Message edited by: Nioca ]

--------------------
Hz'ii'zt a'iiencf coxnen a'bn'z'p pahuen yzpa'zuhb be'tt'phukh'kn az'ii'ova mxn't bhcizvi'fl?

Nioca's Citadel - A resource for BoA graphics and scripts, as well as my scenarios.
In Last Hope's Light RP - The end is near...
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Canned
Member # 8014
Profile #3
...wow. I really messed up.
Is this common among new scripters?

Oh, and it worked. Thank you.

--------------------
Don't judge a sentence until you know all the words.
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
Muffins n' Hell: The End is Near
Not in your shed -We are sort of done. Helpful criticism is welcome.
Everyone, just call me Iffy. Please.

Be grateful you have your unsellabe trowels -Goldenking

Just so you know, I am working on Muffins n' Hell the scenario.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Off With Their Heads
Member # 4045
Profile Homepage #4
quote:
Originally written by Iffy:

...wow. I really messed up.
Is this common among new scripters?

Yes. Oh, yes. It just takes some practice.

[ Friday, January 18, 2008 16:29: 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
Lifecrafter
Member # 6193
Profile Homepage #5
Consider using Niemand's Dialog Editor if you're having problems. It's good to learn this stuff for yourself, but it's a great program from what I saw, and using it means there's one less thing to worry about when you're learning averscript.

--------------------
"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
Canned
Member # 8014
Profile #6
Uh, the computer I am using is kind of slow and I don't like putting more and more on it.

Oh, and I am experiencing more problems. The dialog option isn't coming, even though I stepped into the place that set the flag that the dialog requires to view that option.

Part sdf is set
beginstate 23;

if (get_flag(0,23) > 0) end();

message_dialog("With no where else to go, and an army of muffins nearby, you step into the portal hoping Iffy wouldn't send you to your doom","");
toggle_quest(0,0);

move_to_new_town(3,18,15);
set_flag(0,23,1);

break;
And...
begintalknode 7;
state = 1;
nextstate = 4;
condition = (get_flag(0,23) == 1);
question = "Hey, we got the items you wanted!";
text1 = "_Great. And you should thank me for the portal. You are probably wondering what those are exactly._";
text2 = "_They are called the 'Bow of God' and 'Arrow of Heaven'. They are called this because they are special._";
text3 = "_The 'Bow of God' is the only bow that can shoot the 'Arrow of Heaven'. Both of them only appear if there is some crazy non-stop demon someplace. And they appear in a secret location, only told to someone in a dream._";
code =
set_flag(0,23,1);
break;
I don't see anything wrong.

--------------------
Don't judge a sentence until you know all the words.
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
Muffins n' Hell: The End is Near
Not in your shed -We are sort of done. Helpful criticism is welcome.
Everyone, just call me Iffy. Please.

Be grateful you have your unsellabe trowels -Goldenking

Just so you know, I am working on Muffins n' Hell the scenario.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Off With Their Heads
Member # 4045
Profile Homepage #7
beginstate 23;

if (get_flag(0,23) > 0) end();

message_dialog("With no where else to go, and an army of muffins nearby, you step into the portal hoping Iffy wouldn't send you to your doom","");
toggle_quest(0,0);

move_to_new_town(3,18,15);
set_flag(0,23,1);

break;
Reverse the order of the move_to_new_town() and the set_flag(). The town script stops running after a move_to_new_town().

--------------------
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 #8
Also, you don't need the parentheses in the condition line (don't ask me why). It can just be:

condition = get_flag(0,23) == 1;

--------------------
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
Shock Trooper
Member # 10488
Profile #9
quote:
Originally written by Lazarus.:

Consider using Niemand's Dialog Editor if you're having problems. It's good to learn this stuff for yourself, but it's a great program from what I saw, and using it means there's one less thing to worry about when you're learning averscript.
But that requires a Mac, doesn't it?

Also, this thread is stretching my screen a lot. :(

[ Friday, January 18, 2008 17:57: Message edited by: Celtic Minstrel ]
Posts: 334 | Registered: Friday, September 14 2007 07:00
Canned
Member # 8014
Profile #10
quote:
the town script stops running after a move_to_new_town().

Oh, yes. That makes perfect sense, yet I didn't think of that.

It works now.

And sorry about the screen stretch, I don't know how to prevent that.

--------------------
Don't judge a sentence until you know all the words.
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
Muffins n' Hell: The End is Near
Not in your shed -We are sort of done. Helpful criticism is welcome.
Everyone, just call me Iffy. Please.

Be grateful you have your unsellabe trowels -Goldenking

Just so you know, I am working on Muffins n' Hell the scenario.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Agent
Member # 8030
Profile Homepage #11
It's okay Iffy, scripts stretch the screen in any format.

--------------------
I dub thee...
Posts: 1384 | Registered: Tuesday, February 6 2007 08:00
Infiltrator
Member # 5576
Profile Homepage #12
There is also a Windows version of the Dialogue Editor.

(It's source code, regretably, is lost, but the existing version should work fine.)

--------------------
Überraschung des Dosenöffners!
"On guard, you musty sofa!"
Posts: 627 | Registered: Monday, March 7 2005 08:00
Lifecrafter
Member # 6193
Profile Homepage #13
quote:
Originally written by Celtic Minstrel:

But that requires a Mac, doesn't it?

No, there's a windows version too.

--------------------
"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
Canned
Member # 8014
Profile #14
I prefer to type the scripts rather than use the dialog editor.
Okay, so I have added more nodes, yet I am having more problems. It says "error: Improper block definer in line 75".

And I have done what seems to be right, and I have checked what I have done over and over, yet I don't detect anything wrong.

begintalknode 10;
state = 6;
nextstate = -1;
condition = (get_flag(0,23) == 1);
break;
question = "No. I can't. Sorry.";
text1 = "Iffy looks down. He looks really sad. _Go to your commander then. You will be given a way out._";

code = set_flag(0,23,2);
break;

begintalknode 11;
state = 6;
nextstate = 1;
condition = (get_flag(0,23) == 1);
break;
question = "Yes, I will.";
text1 = "Iffy smiles. _Thank you. This is greatly appreciated._";
code = set_flag(0,23,3);
break;


--------------------
Don't judge a sentence until you know all the words.
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
Muffins n' Hell: The End is Near
Not in your shed -We are sort of done. Helpful criticism is welcome.
Everyone, just call me Iffy. Please.

Be grateful you have your unsellabe trowels -Goldenking

Just so you know, I am working on Muffins n' Hell the scenario.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Shaper
Member # 7472
Profile Homepage #15
You don't stick bread; after conditions.

--------------------
Hz'ii'zt a'iiencf coxnen a'bn'z'p pahuen yzpa'zuhb be'tt'phukh'kn az'ii'ova mxn't bhcizvi'fl?

Nioca's Citadel - A resource for BoA graphics and scripts, as well as my scenarios.
In Last Hope's Light RP - The end is near...
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Canned
Member # 8014
Profile #16
bread; :P
I wasn't aware of the fact that you don't stick break; after a condition, I was under the impression that I do. Well, it works now thanks.

--------------------
Don't judge a sentence until you know all the words.
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
Muffins n' Hell: The End is Near
Not in your shed -We are sort of done. Helpful criticism is welcome.
Everyone, just call me Iffy. Please.

Be grateful you have your unsellabe trowels -Goldenking

Just so you know, I am working on Muffins n' Hell the scenario.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Shaper
Member # 7472
Profile Homepage #17
No, I have no idea how I made that typo either, but it was too good to remove. So there. :P

'Sides, you got the idea, right?

--------------------
Hz'ii'zt a'iiencf coxnen a'bn'z'p pahuen yzpa'zuhb be'tt'phukh'kn az'ii'ova mxn't bhcizvi'fl?

Nioca's Citadel - A resource for BoA graphics and scripts, as well as my scenarios.
In Last Hope's Light RP - The end is near...
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Canned
Member # 8014
Profile #18
Actually at first when I read that I thought I made a typo in the script, then I realized you made a typo.
But ya, it is all right now.

--------------------
Don't judge a sentence until you know all the words.
Muffins n' Hell|Muffins n' Hell: The Muffins Are Back Again
Muffins n' Hell: The End is Near
Not in your shed -We are sort of done. Helpful criticism is welcome.
Everyone, just call me Iffy. Please.

Be grateful you have your unsellabe trowels -Goldenking

Just so you know, I am working on Muffins n' Hell the scenario.
Posts: 1799 | Registered: Sunday, February 4 2007 08:00
Agent
Member # 8030
Profile Homepage #19
quote:
You don't stick bread; after conditions.
When I first saw that, I thought someone was mentioning the band by the name of Bread.

--------------------
I dub thee...
Posts: 1384 | Registered: Tuesday, February 6 2007 08:00
Shock Trooper
Member # 10488
Profile #20
Avoiding screen stretch: Why don't you just put some line breaks in the really long lines? It won't run with the line breaks in, but at least it doesn't stretch the screen. It'll usually be obvious where you need to take out line breaks for it to run – any line break within a string must go.

Has anyone tested to see if a backslash at the end of a line works as a continuation character as in Python? I would guess not, but if it does, that would be even better.
Posts: 334 | Registered: Friday, September 14 2007 07:00
Shaper
Member # 7472
Profile Homepage #21
I've seen a single conditional broken up over multiple lines. Like so:
if ((a == 3) && (b == 90) &&
(demon == 666)) {
[insert code and/or gibberish here]


--------------------
Hz'ii'zt a'iiencf coxnen a'bn'z'p pahuen yzpa'zuhb be'tt'phukh'kn az'ii'ova mxn't bhcizvi'fl?

Nioca's Citadel - A resource for BoA graphics and scripts, as well as my scenarios.
In Last Hope's Light RP - The end is near...
Posts: 2686 | Registered: Friday, September 8 2006 07:00
Shock Trooper
Member # 10488
Profile #22
That's because AvernumScript is like C in that line break is treated the same way as a space or tab. But suppose you tried to put a line break in the middle of a string? It's the long strings that are causing the screen to stretch.
Posts: 334 | Registered: Friday, September 14 2007 07:00