Jump to content

Recommended Posts

Posted

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.

 

Code:
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); } 
Posted

Wow, that's broken.

 

Code:
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:

Code:
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.

Posted

Several problems with the dialogue script.

 

1. The code line goes on an individual line. For example, instead of:

Code:
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:

Code:
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:

Code:
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:

Code:
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:

Code:
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:

Code:
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:

Code:
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.

Posted

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.

Posted

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

Code:
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...

Code:
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.
Posted
Code:
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().
Posted
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. frown
Posted
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.
Posted

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.

 

Code:
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; 
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...