Cult of the Nightly Build

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
Boilermaker
Engineer
Engineer
Posts: 2
Joined: 14 Dec 2023 19:48

Cult of the Nightly Build

Post by Boilermaker »

So here I am puttering along with developing my game script, fixing my last compile error. I know full well there will be runtime errors. I'm hoping the first is an easy foe…

Code: Select all

index 'GetProductionLevel' does not exist
Oh yes those are usually straightforward. Let's see. Hmm. Not a typo. Not a scope issue. It's from the script API itself - GSIndustry.GetProductionLevel.

Frustrated, I print out every slot in the GSIndustry table. They're all there, except the last two in the documentation - GetProductionLevel and SetProductionLevel.

Perhaps I'm running an old API version? Yes, the Minimal GS script from whence I began has GetAPIVersion set to a measly 1.2. The transport gods have been warning me of my folly all along with "1.2 API compatibility in effect." appearing in the log every time I load a game.

But what's the latest version? The DuckDuck yields nothing of value. I must begin the github quest. Searching for the log string, I stumble upon the /bin/ai dungeon. I try the 1.11 sword. No result. 12? 13? 14? Alas, I am doomed.

My ego demands I find someone else to blame. There it is, near the bottom, the first occurrence of GetProductionLevel. Added only three months ago in September.

I have no one to blame but myself. Like a lowly serf, I am running the latest stable release from late July.

I have reached the bleeding edge of Tycoon innovation. I stand looking over the precipice into the pit of Build From Source. I am about to jump when an apparition appears. It shows me the way to the Nightly Build.

Archive downloaded, I overwrite my installation files - without bothering to make a backup - like a man possessed. I run my script again…

Code: Select all

index 'math' does not exist
Success! That's a different issue haha.

p.s., getting this PR across the finish line would be a big help:
https://github.com/OpenTTD/OpenTTD/pull/10834
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 27 guests