Some API extension ideas

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

srschacher
Engineer
Engineer
Posts: 41
Joined: 15 May 2017 12:48

Re: Some API extension ideas

Post by srschacher »

Aphid wrote:GSTown::SetRating(CompanyID cid,TownID tid, int rating )

Set the rating of the company specified to the amount specified.
Range of the int: -1000 - 1000

int GSTown::GetExactRating(CompanyID cid, TownID tid)
Get the exact rating value of a specified company as an integer.
I am bumping this old thread to support adding a member function to set the town ratings in a game script.

From playing some of the "Goal-Based" game scripts, I was looking at trying to set a town rating to "Attrocious" if a company fails a goal for a specified town. In reading the API documentation, I saw that there were no functions for setting the Town Rating for a particular town and company as a penalty (or boon, I suppose).

Personally, I'd like to set the town to the lowest rating to make it hostile to a company that ignores it, but I suppose that percent deductions (instead of absolute deductions) would be useful to, thereby requiring a function to get the exact amount.

Steve
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 23 guests