Hi,
I'm trying to write an AI, but have ran into some difficulties trying to check if a station can be built at a particular location before deciding where to build it. To build a station, I have to first flatten the land, and then build the station on it. The problem is that when using AITestMode, actions aren't actually applied, and so you can't test if the station can be built after flattening the land. (And actually, even flattening the land takes multiple raise/lower land actions, and the fact that you can raise/lower each tile corner does not imply that you can flatten the entire rectangle as desired.)
Is there any way make actions in AITestMode stack until the AITestMode object is destroyed, or is there some better way to tell if I can flatten the land and build a station on it without actually flattening the land?
Stacking AITestMode actions
Moderator: OpenTTD Developers
Re: Stacking AITestMode actions
Unfortunately not, no. To do that, the game would need to have a way to "checkpoint" the world state and be able to roll back, and that just doesn't exist right now. It might be possible to add in some way at some point, but don't count on it being any time soon.
Re: Stacking AITestMode actions
Oh I see, that's unfortunate. Guess I'll have to find some heuristic to predict if a station will be buildable.
Who is online
Users browsing this forum: No registered users and 22 guests