Page 1 of 1

AILog.Info messages getting printed out of order?

Posted: 31 Mar 2010 11:01
by kirky_D
This has only just started since I added this little test function but you can see the message "Kai Started" appears after the message about towns in my Test function.

Does anyone know why this might be happening?
Untitled.png
EDIT::

Now I'm really confused. I tried positioning the call to Test() in different points in the code (with a few sleep commands) just to try and see what was going on. Anyway I tried putting it after the while(true) loop and it still executes the call. I even exited and reopened openttd to make sure it was getting loaded correctly.

Anybody have a clue here?
Untitled.png

Re: AILog.Info messages getting printed out of order?

Posted: 31 Mar 2010 13:00
by Zuu
What happens if you remove the semicolon at the first line of your Test-function

Code: Select all

function Kai::Test(); // <--- remove this semicolon
{
  // ...
}

Re: AILog.Info messages getting printed out of order?

Posted: 31 Mar 2010 13:04
by kirky_D
Zuu wrote:What happens if you remove the semicolon at the first line of your Test-function

Code: Select all

function Kai::Test(); // <--- remove this semicolon
{
  // ...
}
lol. I actually just discovered that like 2 minutes ago. All is fine. I'm such an idiot :oops:

Cheers for your help

Re: AILog.Info messages getting printed out of order?

Posted: 31 Mar 2010 14:31
by Blustuff
kirky_D wrote:I'm such an idiot :oops:
The squirrel language allow many constructions like this one which compiles but doesn't make sense. Working on a Squirrel parser, I found many ambiguities in the grammar all of them can give a situation like yours. The ambiguites are (of course) not documented in the squirrel manual. (You have to test against the official compiler to discover what a given statement could be actually doing.) The problem is in general hard to spot which makes developping in Squirrel a bit harder. (or funnier ?)