Feature Request - AITile.IsClearable()

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
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Feature Request - AITile.IsClearable()

Post by Zutty »

Two things...

1) Can we have an AITile.IsClearable() method to test for things like lighthouses and other player's stuff. I know I could just use DemolishTile() in test mode but in my opinion it seems like better programming style to test a predicate rather than to test for an exception. Thats not really what exceptions are for. I have entered a ticket on Flyspray (#2082).

2) Maybe there should be a sticky for feature requests and bug reports. I know Flyspray is the proper channel (I use an Altiris change request system at work, and I hate it when people request stuff without entering a ticket!!) but I also know that some devs prefer people to enter stuff in the forum. Perhaps there could be a paragraph stating that people should enter issues into Flyspray but that they can also post in the thread if they want a faster response. Just an idea!

Thanks :D
PathZilla - A networking AI - Now with tram support.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: Feature Request - AITile.IsClearable()

Post by TrueBrain »

If we would start adding AITile.IsClearable() with the arguments you gave (which are flawed in my opinion), what else do we need...

AIStation.CanIBuildAStationHere()
AIRoad.CanIBuildARoadPieceHere()
AIVehicle.CanIBuildAVehicleHere()

I mean ... the list would be endless, and one wrapper would be more insane than the other. The idea of test-mode is exactly that you can see if a command would execute or not. As for IsClearable, if we would implement it, it would be EXACTLY that: DemolishTile in test-mode. As there is no other way to do it. And it is exactly the way to do it. As this is exactly what exceptions are for. And this is exactly what test-mode is for.

About your other, completely offtopic, question: I don't read FlySpray. Use this forum. And one single topic to collect bug / feature-requests, would make this subforum completely useless. So I am happy how things are :) Make a topic if you have a request, or if you have a bug, and we can handle that nicely in one topic what we think of it :)
The only thing necessary for the triumph of evil is for good men to do nothing.
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Feature Request - AITile.IsClearable()

Post by Zutty »

Fair enough!

I've just realised DemolishTile() returns a boolean anyway, so I wont need to catch an exception.

Edit: GAAAHH! WHY TRUELIGHT WHY?!!! You're supposed to implement every crazy suggestion I come up with IMMEDIATELY!! ;)

Sorry I think its my god-awful enterprise style of coding that's got the better of me. The rules I'm acustom to don't really apply to game programming.
PathZilla - A networking AI - Now with tram support.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 0 guests