(1): Error! Expecting top-level statement

Sduibek

Creator of Fallout Fixt
Moderator
Modder
What does this mean? Here is my code below, please tell me what i'm doing wrong:

Only section I changed--
Code:
procedure talk_p_proc
begin
	call get_reaction;
	if (get_critter_stat(dude_obj, 34) == 0) then begin
		float_msg(self_obj, message_str(708, random(200, 209)), 2);
		end
	else begin
	float_msg(self_obj, message_str(708, random(210, 219)), 2);
end
end


C:\Games\Fallout\Scripts-editing>sslc_f1 hhooker.ssl hhooker.int
Startreck scripting language compiler (Fallout 1 edition)

Compiling HHooker.ssl
Compiling HHooker.int
HHooker.int(1): Error! Expecting top-level statement

*** THERE WERE ERRORS (1 of them)
 
You have one "end" too much. As far as I can see, it's the one right after your first if-line.

/Edit: Or not, I see it belongs to the "else begin". Maybe the program in which you write the code doesn't like how you indentured the code, but I doubt this. Best way to find out whats wrong is to comment out everything until it compiles. If it compiles, remove the commented out lines one after one until it doesn't work again. Then you know where your problem is.
 
From testing, I think this particular tool (sslc_f1) actually returns that error when the script compiled correctly. Which is odd.

Edit: because when I get the Line#1 error everything seems to work OK in game :crazy:
 
Oh wow, i'm an idiot. I was putting the .int file in the command line arguments and I didn't need to be doing that X[
 
Back
Top