Order flags bug? Unload and wait for (any) full load

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
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Order flags bug? Unload and wait for (any) full load

Post by Michiel »

While playing with order flags, I noticed I can't get my AI to specify AIOrder.AIOF_FULL_LOAD | AIOrder.AIOF_UNLOAD (which, if I understand correctly, should result in the "unload and wait for full load" order). The order isn't added, which presumably means it's invalid. However, through the player interface I can give my vehicles this combination of load flags. Is this a bug or am I doing it wrong?
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Order flags bug? Unload and wait for (any) full load

Post by Yexo »

Michiel wrote:While playing with order flags, I noticed I can't get my AI to specify AIOrder.AIOF_FULL_LOAD | AIOrder.AIOF_UNLOAD (which, if I understand correctly, should result in the "unload and wait for full load" order). The order isn't added, which presumably means it's invalid. However, through the player interface I can give my vehicles this combination of load flags. Is this a bug or am I doing it wrong?
You can check the return value from the function, if it's false, it failed. If the function failed, you can get the error by AIError.GetLastError or a string by AIError.GetLastErrorString. Print that string and you'll see what went wrong.
Note that I'm not saying it's not a bug, just that you should give some more information.
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Re: Order flags bug? Unload and wait for (any) full load

Post by Michiel »

It returns false, and the error is ERR_UNKNOWN, unfortunately.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Order flags bug? Unload and wait for (any) full load

Post by Yexo »

What function are you calling? In case of AppendOrder or InserOrder, are you sure the destination parameter is correct? Those functions return ERR_UNKNOWN when trying to send a bus to a truck stations or a truck to a bus station.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Order flags bug? Unload and wait for (any) full load

Post by Rubidium »

Should be solved when the fix for FS#2130 gets synced into NoAI.
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Re: Order flags bug? Unload and wait for (any) full load

Post by Michiel »

Yexo wrote:What function are you calling? In case of AppendOrder or InserOrder, are you sure the destination parameter is correct? Those functions return ERR_UNKNOWN when trying to send a bus to a truck stations or a truck to a bus station.
Nope, I'm sure I got that right :) It was only when trying to set that combination of flags that it failed.
Rubidium wrote:Should be solved when the fix for FS#2130 gets synced into NoAI.
Cool :)
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 29 guests