[SOLVED] TownGrowth not working?

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
Openend
Engineer
Engineer
Posts: 36
Joined: 18 Jun 2015 09:09

[SOLVED] TownGrowth not working?

Post by Openend »

Hello,

I've made some more progress, but stumbled again:

I have a script, which checks for a sign (its working, I can see it in the debug messages). Now I something like this

Code: Select all

grown = GSTown.ExpandTown(town_id,50); //grown is the bool, return value
or this

Code: Select all

grown = GSTown.SetGrowthRate(town_id,1); // bool again as return value
But the towns I use it on never grow. Ive tried a wide range of values. What Am I doing wrong here?

EDIT: Nevermind, I've found a condition in the source code, that using companymode to read the sign will prevent City Growth if executed in the same scope.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 9 guests