Easygoing Eyebeast Xaiya Posted December 1, 2007 Share Posted December 1, 2007 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: Code: begintownscript;variables; body; beginstateINIT_STATE;// Setting crime level because this is a friendly town.set_crime_tolerance(2); And t5dlg: Code: begintalkscript;variables;shortbmessage;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. (Ephesos): Screen-stretching code is bad. Quote Link to comment Share on other sites More sharing options...
Unflappable Drayk Lazarus. Posted December 1, 2007 Share Posted December 1, 2007 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. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Ephesos Posted December 1, 2007 Share Posted December 1, 2007 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. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Xaiya Posted December 1, 2007 Author Share Posted December 1, 2007 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... Code: begintownscript;variables; body; beginstateINIT_STATE;break;// Setting crime level because this is a friendly town.set_crime_tolerance(2); Code: begintalkscript;variables;shortbmessage;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? Quote Link to comment Share on other sites More sharing options...
Unflappable Drayk Lazarus. Posted December 1, 2007 Share Posted December 1, 2007 Breaks come at the end of a state, after the state's code. So... Code: 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 Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Swimmin' Salmon Posted December 1, 2007 Share Posted December 1, 2007 Does it matter that the first character in either snippet of code is a space? Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Ephesos Posted December 1, 2007 Share Posted December 1, 2007 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. EDIT: If you want more help scripting, I'd advise getting AIM or some client capable of handling AIM... that's where most of us designers seem to lurk. It's easier than going through the boards sometimes. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Xaiya Posted December 1, 2007 Author Share Posted December 1, 2007 I don't know what AIM is. Edit -and the dialoge problem is fixed now. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted December 1, 2007 Share Posted December 1, 2007 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.) Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Ephesos Posted December 1, 2007 Share Posted December 1, 2007 Iffy: When you get it running, the box in our profiles with "AIM ID" is the handle you should contact us at. Quote Link to comment Share on other sites More sharing options...
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.