Custom Crash Messages

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
Xander
Route Supervisor
Route Supervisor
Posts: 485
Joined: 18 May 2007 12:47
Location: Oxford
Contact:

Custom Crash Messages

Post by Xander »

Hey all.

Going to start work on a new AI and also I think this might be useful for WrightAI; can we change the "The AI has crashed" message at all? I've been looking around the API documentation but can't see anything obvious.

The reason I ask is that as the AI is in development, there may be some "known bugs" that I don't want to concern users with. A message like "JAMI has crashed for a known reason. There is no need to report this." would be very helpful.

Thanks in advance.
Real Tycoons do it on Trains!

JAMI: Just Another Moronic Intelligence
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: Custom Crash Messages

Post by Morloth »

Xander wrote:Hey all.

Going to start work on a new AI and also I think this might be useful for WrightAI; can we change the "The AI has crashed" message at all? I've been looking around the API documentation but can't see anything obvious.

The reason I ask is that as the AI is in development, there may be some "known bugs" that I don't want to concern users with. A message like "JAMI has crashed for a known reason. There is no need to report this." would be very helpful.

Thanks in advance.
I think you can fix this in your own code by using a try catch block. i.e.:

try {
crash();
} catch(id) {
// Your message here.
}
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 18 guests