AI crashing

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

krinn
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 29 Dec 2010 19:36

Re: AI crashing

Post by krinn »

because A is a class instance of AIList and so b=a mean b point also to that instance and not to a new AIList instance with its content that match A content.

to make what you wish do :

Code: Select all

local a=AIList();
local b=AIList();
b.AddList(a);
trotter94
Engineer
Engineer
Posts: 19
Joined: 06 Feb 2012 23:28

Re: AI crashing

Post by trotter94 »

krinn wrote:because A is a class instance of AIList and so b=a mean b point also to that instance and not to a new AIList instance with its content that match A content.

to make what you wish do :

Code: Select all

local a=AIList();
local b=AIList();
b.AddList(a);

Thanks, thought it would be something like that.

it only took about 3 months to figure out what was happening!!
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 6 guests