Easygoing Eyebeast Xaiya Posted January 18, 2008 Posted January 18, 2008 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); } Quote
Magnificent Ornk Ephesos Posted January 18, 2008 Posted January 18, 2008 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. Quote
Understated Ur-Drakon Nioca Posted January 18, 2008 Posted January 18, 2008 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. Quote
Easygoing Eyebeast Xaiya Posted January 18, 2008 Author Posted January 18, 2008 ...wow. I really messed up. Is this common among new scripters? Oh, and it worked. Thank you. Quote
Magnificent Ornk Kelandon Posted January 18, 2008 Posted January 18, 2008 Quote: Originally written by Iffy:...wow. I really messed up. Is this common among new scripters? Yes. Oh, yes. It just takes some practice. Quote
Unflappable Drayk Lazarus. Posted January 18, 2008 Posted January 18, 2008 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. Quote
Easygoing Eyebeast Xaiya Posted January 18, 2008 Author Posted January 18, 2008 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. Quote
Magnificent Ornk Kelandon Posted January 18, 2008 Posted January 18, 2008 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(). Quote
Magnificent Ornk Ephesos Posted January 19, 2008 Posted January 19, 2008 Also, you don't need the parentheses in the condition line (don't ask me why). It can just be: Code: condition = get_flag(0,23) == 1; Quote
Understated Ur-Drakon Celtic Minstrel Posted January 19, 2008 Posted January 19, 2008 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. Quote
Easygoing Eyebeast Xaiya Posted January 19, 2008 Author Posted January 19, 2008 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. Quote
Understated Ur-Drakon Callie Posted January 19, 2008 Posted January 19, 2008 It's okay Iffy, scripts stretch the screen in any format. Quote
Well-Actually War Trall Niemand Posted January 19, 2008 Posted January 19, 2008 There is also a Windows version of the Dialogue Editor. (It's source code, regretably, is lost, but the existing version should work fine.) Quote
Unflappable Drayk Lazarus. Posted January 19, 2008 Posted January 19, 2008 Quote: Originally written by Celtic Minstrel:But that requires a Mac, doesn't it? No, there's a windows version too. Quote
Easygoing Eyebeast Xaiya Posted January 19, 2008 Author Posted January 19, 2008 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; Quote
Understated Ur-Drakon Nioca Posted January 19, 2008 Posted January 19, 2008 You don't stick bread; after conditions. Quote
Easygoing Eyebeast Xaiya Posted January 19, 2008 Author Posted January 19, 2008 bread; 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. Quote
Understated Ur-Drakon Nioca Posted January 19, 2008 Posted January 19, 2008 No, I have no idea how I made that typo either, but it was too good to remove. So there. 'Sides, you got the idea, right? Quote
Easygoing Eyebeast Xaiya Posted January 19, 2008 Author Posted January 19, 2008 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. Quote
Understated Ur-Drakon Callie Posted January 19, 2008 Posted January 19, 2008 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. Quote
Understated Ur-Drakon Celtic Minstrel Posted January 20, 2008 Posted January 20, 2008 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. Quote
Understated Ur-Drakon Nioca Posted January 20, 2008 Posted January 20, 2008 I've seen a single conditional broken up over multiple lines. Like so: Code: if ((a == 3) && (b == 90) &&(demon == 666)) {[insert code and/or gibberish here] Quote
Understated Ur-Drakon Celtic Minstrel Posted January 20, 2008 Posted January 20, 2008 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.