SaintAI

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
saint
Engineer
Engineer
Posts: 45
Joined: 25 Dec 2005 23:01
Location: Australia

SaintAI

Post by saint »

This is AI is now many revisions out of date, and fails to load on newer builds. I would like to resurrect it at some point in the future, however there is currently no planned time frame.

----------------------------

Original name, I know, but it'll do for now.

I'm not expecting much in the tourney just yet, but that's primarily since it stops building new routes by the end of the second year (depending on number of towns and their size). It's also missing code to remove unprofitable vehicles at the moment and vehicle adding is less than perfect.

I'll get around to mail and industry connection at some point too :wink:

v2 - 29 July 2008
  • Updated for r13862ish - moving of DoCommand()'s out of main AI constructor
v1.01 - 21 Jul 2008
  • Updated for r13751 - API change
v1.0 - 03 Jul 2008
  • Initial release
Attachments
saintai.tar
v2
(25.5 KiB) Downloaded 194 times
Last edited by saint on 06 Jan 2009 03:07, edited 2 times in total.
This is my sig
User avatar
saint
Engineer
Engineer
Posts: 45
Joined: 25 Dec 2005 23:01
Location: Australia

Re: SaintAI

Post by saint »

Updated for r13751.

Looking to getting some industrial action over the next few weekends though (time permitting :wink:)
This is my sig
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: SaintAI

Post by TrueBrain »

As a security measurement, you are no longer allowed to do SetCompanyName in your constructor .. so your AI hangs now ;) Would you mind updating? Tnx!
The only thing necessary for the triumph of evil is for good men to do nothing.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: SaintAI

Post by Yexo »

Since r13856 it's no longer possible to do any DoCommands in the constructor, so SaintAI hangs, as it tries to set the company name inside the constructor in an infinite loop:

Code: Select all

if (!AICompany.SetCompanyName("SaintAI " + this.ver)){
			local i = 2;
			while (!AICompany.SetCompanyName("SaintAI " + this.ver + " #" + i)){
				i = i + 1;
			}
		}
			
		// Clean up a little
		for(local i=0; i<AISign.GetMaxSignID(); i++) {
			if (AISign.IsValidSign(i))
				AISign.RemoveSign(i);
		}
User avatar
saint
Engineer
Engineer
Posts: 45
Joined: 25 Dec 2005 23:01
Location: Australia

Re: SaintAI

Post by saint »

TrueLight wrote:Would you mind updating? Tnx!
Done :) Need to work on increasing my income levels now :wink:
This is my sig
User avatar
Benny
Tycoon
Tycoon
Posts: 2185
Joined: 25 Aug 2007 17:03
Location: ~/

Re: SaintAI

Post by Benny »

Getting error:

Image
Image
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 9 guests