AIEvent.GetEventString()?
Moderator: OpenTTD Developers
AIEvent.GetEventString()?
We have .GetLastErrorString() for errors, can someone do the same thing for events?
Re: AIEvent.GetEventString()?
What is the point of it? For errors it's easy to print what kind of error occured, but for events I see no reason. Either you handle a certain event or it's unknown and you ignore it.
Re: AIEvent.GetEventString()?
Same reason you print errors, to see which one occurred and print it to the AILog.Yexo wrote:What is the point of it? For errors it's easy to print what kind of error occured, but for events I see no reason. Either you handle a certain event or it's unknown and you ignore it.
Re: AIEvent.GetEventString()?
In my opinion there is a difference. Unknown errors are interesting to see, but unknown events are not interesting (if your AI doesn't handle it at all, why log it?) For those events you already have you can easily log the names yourself.
Re: AIEvent.GetEventString()?
During development it would be nice to just be able to print them without too much switch+case.
Re: AIEvent.GetEventString()?
What if this would go to AICommon.Library instead.
Some time I convert AIVehicleType enumeration to string too. To ease debugging.
Some time I convert AIVehicleType enumeration to string too. To ease debugging.

Who is online
Users browsing this forum: No registered users and 9 guests