Jump to content

Iffy scripting problems


Xaiya

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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