I would like to suggest this patch for trunk, its not my work as Krinn wrote it, but I found I needed this while writing my AI.
Krinn made a FS Task, and I posted an updated patch in the AI/GS topic here.
Attached is latest trunk patch.
---
Another suggestion for the API, but no patch as yet:
Since buoys are "common property" it seems like the only reliable and fast way to get a working list of buoys would be to have a method to return an AI/GS list of tiles with buoys on. Any suggestions? Should I take a shot at coding this?
EDIT: Nevermind the second part, the Waypoint class allows this exact thing
[Patch] GS/AITile.IsRiverTile
Moderator: OpenTTD Developers
[Patch] GS/AITile.IsRiverTile
- Attachments
-
- AIGS_IsRiver_r26416.patch
- (5.81 KiB) Downloaded 80 times
Last edited by R2dical on 21 Mar 2014 17:53, edited 1 time in total.
Re: [Patch] GS/AITile.IsRiverTile
no idea what BT_CLEAR_RIVER does, but it doesn't look related to an IsRiverTile test to me.
Perhaps split both additions?
Perhaps split both additions?
Re: [Patch] GS/AITile.IsRiverTile
Yeah, from Krinns FS Task post:
Attached is the patch with only "Add (AI/GS)Tile.IsRiverTile(tile)", the full one above includes the related bits.Krinn wrote:Here a patch that will :
- Add (AI/GS)Tile.IsRiverTile(tile)
- Add BT_CLEAR_RIVER to AI/GS enum BuildType
- Modify (AI/GS)Tile.GetBuildCost() to answer cost to remove a river tile
- Add AITile.GetBuildCost(AITile.BT_CLEAR_RIVER) to regression.nut : i didn't add the regression test against a tile to check river, because the regression.sav file didn't have any river to test against, and i assume it was over me to modify the testing savegame.
- Attachments
-
- AIGS_IsRiver_only_r26416.patch
- (3.31 KiB) Downloaded 70 times
Who is online
Users browsing this forum: No registered users and 17 guests