AILog.Info messages getting printed out of order?

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
kirky_D
Engineer
Engineer
Posts: 24
Joined: 25 Mar 2010 15:34

AILog.Info messages getting printed out of order?

Post 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
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

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

Post 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
{
  // ...
}
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
kirky_D
Engineer
Engineer
Posts: 24
Joined: 25 Mar 2010 15:34

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

Post 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
Blustuff
Engineer
Engineer
Posts: 112
Joined: 21 Aug 2008 09:37
Location: France

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

Post 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 ?)
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 7 guests