AIOrder.AppendOrder

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
paullb
Traffic Manager
Traffic Manager
Posts: 129
Joined: 19 May 2008 13:11

AIOrder.AppendOrder

Post by paullb »

Question about AIOrder.AppendOrder. I want to have two order flags like below (which has the wrong syntax;

What is the correct syntax for more than one order flag? (like below, non-stop and full-load


AIOrder.AppendOrder(new_bus, this.stationOne.tile, [ AIOrder.AIOF_FULL_LOAD , AIOrder.AIOF_NON_STOP_INTERMEDIATE ] );
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: NoAI Branch - An AI Framework

Post by Roujin »

Well, if it works how flags normally work, you should be able to combine them with a binary or.

Code: Select all

FLAG1 | FLAG2
edit: yes, confirmed. so in your case

Code: Select all

AIOrder.AppendOrder(new_bus, this.stationOne.tile, AIOrder.AIOF_FULL_LOAD | AIOrder.AIOF_NON_STOP_INTERMEDIATE );
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
User avatar
paullb
Traffic Manager
Traffic Manager
Posts: 129
Joined: 19 May 2008 13:11

Re: NoAI Branch - An AI Framework

Post by paullb »

Roujin wrote:Well, if it works how flags normally work, you should be able to combine them with a binary or.

Code: Select all

FLAG1 | FLAG2
edit: yes, confirmed. so in your case

Code: Select all

AIOrder.AppendOrder(new_bus, this.stationOne.tile, AIOrder.AIOF_FULL_LOAD | AIOrder.AIOF_NON_STOP_INTERMEDIATE );
I thought I had tried that, but I guess I must have made a mistake, thanks for confirming.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 37 guests