Auto-number speech lines error (SOLVED)

Started by Sughly, Sat 19/05/2012 06:32:56

Previous topic - Next topic

Sughly

Alright, I'm baffled by this. Every time I run the 'Auto-number speech lines' wizard, I get this error:



As far as I can tell, there aren't any parse errors. I'm even more sure of this since I tried going in and literally rewriting the line that's been pulled up, it just creates the exact same error for another line, and these lines don't seem to have anything wrong with them! It also seems like I get the same error for 'Create voice acting script', and whether it's for the same reason or not (I assume it might be since it's referring to parsing errors) I get this error if I use the Speech Center plugin:



If anyone at all can shine some light on what's happening here, maybe there's something those error messages are showing that I don't see or understand, then I'd really appreciate it!

Khris

Do you have any open .Say lines that are commented out, like this:

Code: ags
  // player.Say("Hello


Could you post the entiere line that contains "Don't move! Don't go ANYWHERE!" ?

Sughly

#2
It's literally just this...

QuotecSpeaker.Say("Don't move! Don't go ANYWHERE!");

I thought that might have been the case, what you've suggested, so I'm trying to go through all the code but I can't find anything broken (yet). The game compiles fine, runs fine too. It just comes up with these errors during auto-numbering and creating the voice script  :~(

EDIT: It's weird... if I rewrite the line as "Dont move, don't go ANYWHERE!" it still brings up an error... but if I just add another word at the end, even just a space (ie "Don't move! Don't go ANYWHERE! "), it accepts this line and brings up an error on another later line (which also seems fine). Could it just be corrupted somehow? Very confusing...

EDIT #2: Just to let you know, after adding spaces to the end of each line it was bringing up with a parsing error (ended up being about 6 different lines), it worked. I have no idea what happened, and it was a weird way of fixing it, so I suppose it's not really correct to rename the thread solved  ???

EDIT #3: Sorry for these constant updates but it didn't really work. It seems to only be affecting the script for Room 1. By didn't work I mean it says that it did, but half the speech doesn't have any assigned speech numbers, and some speech even as the numbers assigned at the end of the line of code rather than the beginning. What the heck!?

Khris

A shot in the dark:
Do all the affected lines have apostrophes in them?

Sughly

#4
No, I finally figured it out. Deep in the room1 code I closed one of the speech lines twice, ie with two );

So it was a parser error after all. Simply my own stupidity, suprise surprise. Thanks so much for trying to help once again Khris!

Khris

Great you found the cause, but it's weird though that the game still compiled fine. That shouldn't have happened I guess, especially not with a surplus ).

SpeechCenter

Khris is right of course, it shouldn't have compiled and the build command should have pointed to more or less the right place.
Since you used the plugin to check this (which is a cool use which I haven't considered) I wonder if the detailed info window gave the bad line. It should print each line number and column which wasn't parsed correctly, but it may print out a lot more information than you need and not necessarily in line order. I added it just for plugin debugging purposes, but still, I'm curious.


Sughly

Well I had the game backed up at that stage, so I went back and reran Speech Center to get the detailed info for you...



The line in question that has the error is 774, so while it's not picking up on that line exactly its obviously having problems with lines that are following it. I noticed too that all the hotspots and objects for room one had disappeared from the general definitions tab at the top of the room1 script, and as soon as I corrected that line they all came back again. It's a mystery to me as to how the game compiled and, even more so, ran fine from beginning to end! I only had problems when I was dealing with the voice numbering and whatnot.

Anyway, thought I'd add that in there since you guys seemed interested in what was going on  :-D

SpeechCenter

Now it's even more mysterious  ;-D
Preprocessing does not do anything with or care about brackets and semicolons.

I think you should post a code snippet, if you can, starting from the command before line 774 up to line 777 (inclusive). Not because of the plugin, but rather to check if there is a bug with the AGS compiler.

Sughly

Alrighty, here it is (line 1 is really line 773, 5 is 777)...

Code: ags
cAnna.Say("No! I can't think like that!");
cAnna.Say("Grandpa needs me. I HAVE to find a way to help him!");");
Wait(20);
cAnna.Walk(cAnna.x, cAnna.y + 50, eBlock, eAnywhere);
cAnna.Say("And I can't just keep waiting around here!");
Wait(10);


So it seems to be bringing up line 777 (5) at the first apostrophe following the error...

SpeechCenter

#10
Thanks, I can confirm the compiler ignores this error. I assume it just discards the rest of the line, and compiles the rest as intended, but I didn't check. I think it should be fixed since it is an error and the rest of the editor functions don't cope with this.

The real problem is the extra quotation mark which causes all the lines up to 5 (or 777) to be considered as a single string, and "And I can" is parsed as commands. The apostrophe doesn't parse correctly since it expects it to be 't', because again, it's not parsed as part of the string. BTW, the parser does pick up the original error for me, the lines are not sorted and that text box doesn't have a scroll bar, but if you use the keyboard to scroll through you should see line 774 as well. I'll add the scroll bar in the next release.


Sslaxx

Quote from: Sughly on Sun 20/05/2012 06:44:01
Alrighty, here it is (line 1 is really line 773, 5 is 777)...

Code: ags
cAnna.Say("No! I can't think like that!");
cAnna.Say("Grandpa needs me. I HAVE to find a way to help him!");");
Wait(20);
cAnna.Walk(cAnna.x, cAnna.y + 50, eBlock, eAnywhere);
cAnna.Say("And I can't just keep waiting around here!");
Wait(10);


So it seems to be bringing up line 777 (5) at the first apostrophe following the error...
cAnna.Say("Grandpa needs me. I HAVE to find a way to help him!");"); - you need to remove the duplicated "); at the end of this line.
Stuart "Sslaxx" Moore.

SMF spam blocked by CleanTalk