OpenTTD | Game script (2024)

  • en
  • pl

OpenTTD allows you to write your own Game Scripts. These scripts can provide goals for all companies, inspect properties of all companies and also communicate with the players of companies.

Feature availability

<1.0

1.0-1.2

1.3

1.4

1.5-12.0

Nightly

OpenTTD Manual

Installation · FAQ
Tutorials and Instructions
Game interface · README.md

Infrastructure

Railways:

Signals · Stations · Junctions · Carrying capacity ·

Roadways · Tramways · Waterways · Airports · Landscaping

Vehicles

Trains · Road vehicles · Ships ·Aircraft · Orders

Settings

Game options · Settings · AI settings ·Custom graphics (NewGRF) · Cheats · Command line

Graphics and sound

OpenGFX ·OpenMSX ·OpenSFX

More topics

Climates · Towns · Industries · Economy ·Disasters · Tips ·Hidden features · Hotkeys ·Console · Game Mechanics ·Multiplayer · Scenario editor ·Online content · Social Integration

Troubleshooting · Links

Gamescript or NoGo provides the possibility of adding goal-based scripts to the game via a framework similar to the NoAI framework using the Squirrel programming language.

'Game Scripts' can modify the way towns behave, delete objects, place new in-game industries, and town buildings, as well as inquire about the state of the game, and do several other in-game actions. Game Script files may be downloaded and selected for activation prior to creation of a new game in order to introduce these features. Unlike Advanced Settings which may be changed part way through a game, Game Scripts should be installed prior to starting a new game in order to ensure correct operation. Game Scripts are not supported by TTDPatch, and are introduced, and supported by, OpenTTD version 1.2.0 and later.

For common issues with Game Scripts, visit the Game Script FAQ

Contents

  • 1Getting Game Scripts
    • 1.1Online content
    • 1.2Manual install
  • 2Activating Game Scripts
  • 3Setting Game Script parameters
  • 4Writing your own Game Script
    • 4.1External links

Getting Game Scripts

Online content

The most common and convenient way to obtain Game Scripts is by using the ingame online content download feature. Most Game Scripts can be found there. There exists also a Game Script forum where you may find development versions of some Game Scripts.

Manual install

If you want to use Game Scripts installed from other locations, which are not available from the online content download, you need to manually install them into the correct place. A Game Script is either a tarball or .tar file, or a directory with several code files. To install a Game Script:

  1. Download the Game Script file(s).
  2. Move (and uncompress) the Game Script file(s) to the Game Script directory of your OpenTTD installation.
  • This will often be:

C:\My Documents\game (Windows 95, 98, ME)

C:\Documents and Settings\<username>\My Documents\OpenTTD\game (Windows 2000, XP)

C:\Users\<username>\Documents\OpenTTD\game (Windows Vista, 7, 8, 10)

~/.openttd/game (Linux, BSD)

~/.local/share/openttd/game/ (Linux)

~/Documents/OpenTTD/game (OSX)

Activating Game Scripts

1. In the main menu, click "AI/Game Script Settings".

2. Select the text in the box under "Game Script"

3. Click the top-left-most button in the bottom menu labeled "Select Game Script"

4. Pick a Game Script of your choice from the pop-up menu.

Setting Game Script parameters

1. In the main menu, click "AI/Game Script Settings".

2. Select the text in the box under "Game Script"

3. Click the 'Configure' button.

4. A row of parameters defined by the Game Script will show up. Change the desired parameters and click the 'Close' button to implement the changes. Use the 'Reset' button to set all parameters back to default values.

When you write a Game Script, you code it in a programming language called Squirrel. The framework used for Game Scripts is called NoGo and share many aspects with the AI framework called NoAI.

For historical reasons there are plenty of wiki articles on how to write AIs, but very few with the Game Script perspective. Thankfully Game Scripts are very similar to AIs only that they don't have ownership of a specific company. Thus the AI articles are still of great help on how to write Game Scripts.

  • Read the AI section (lots of material apply to Game Scripts too)
  • See the external links below for more resources (API docs, Squirrel docs, existing Game Scripts, ..)

When working with your GS you should store your files in $OpenTTD/game. Make a directory there for your GS eg. $OpenTTD/game/myGS and put the .nut files in there. Note that you should not store them in $OpenTTD/online_content/game as that the online_content directory is managed by OpenTTD and may overwrite your files etc.

External links

  • NoGo (Game Script) API documents
  • Squirrel documentation
  • Download a Game Script and read the code to see how it works
  • List of Game Script libraries - there exist several useful libraries that you can import and use
  • Minimal GS - a working minimal GS that can be used as a starting point for new Game Scripts.

Categories:

  • Manual

Folder: Manual

OpenTTD | Game script (2024)
Top Articles
Crustless Broccoli Quiche - Healthy Recipes Blog
11 Pioneer Recipes From the 1800s
Dippin Base Stat Total
Booked On The Bayou Houma 2023
Air Chat En Espanol
Lifestyle | Stewartstown-Fawn Grove Daily Voice
Michigan Lottery Predictions For Today
دانلود فیلم Toc Toc بدون سانسور
Drift Shard Deepwoken
Roy12 Mods
Dbd Wesker Build
Msu Ro
[PDF] JO S T OR - Free Download PDF
8 Garden Sprayers That Work Hard So You Don't Have To
Rpa Service Charge Debit
Ff14 Cloth Softening Powder
Dupage County Fcrc
Arthritis Weather Index
Huniepop Jessie Questions And Answers
Punishment - Chapter 1 - Go_mi - 鬼滅の刃
Cara In Creekmaw Code
James And Lisa Goy Obituary
The Eye Doctors North Topeka
Cookie Clicker The Advanced Method
Spanish Letter Closings: formal, friendly, and informal - Wanderlust Spanish
Define Percosivism
Gabrielle Enright Weight Loss
4 Pics One Word Level 363
Used Zero Turn Mowers | Shop Used Zero Turn Mowers for Sale - GSA Equipment
Does Wanda Sykes Use A Cane
Nickelodeon Home Media
Statek i zarządzanie załogą w Assassin's Creed Odyssey - Assassin's Creed Odyssey - poradnik do gry | GRYOnline.pl
0Gomovies To To
9294027542
New R-Link system and now issues creating R-Link store account.
Entourage Yearbook Login
Porter House Ink Photos
Space Coast Fl Craigslist
Aces Login Palo Alto
Directions To Truist Bank Near Me
Craigslist Nj Apartments South Jersey
Sherlock - Streams, Episodenguide und News zur Serie
Wgu Admissions Login
Bella Poarch Husband: A Deep Dive Into Her Relationship And Personal Life
Yoshidakins
Ucf Cost Calculator
Salmon Fest 2023 Lineup
Grayson County Craigslist
Sarah Colman-Livengood Park Raytown Photos
Csuf Mail
Funny Roblox Id Codes 2023
Latest Posts
Article information

Author: Nicola Considine CPA

Last Updated:

Views: 6657

Rating: 4.9 / 5 (49 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Nicola Considine CPA

Birthday: 1993-02-26

Address: 3809 Clinton Inlet, East Aleisha, UT 46318-2392

Phone: +2681424145499

Job: Government Technician

Hobby: Calligraphy, Lego building, Worldbuilding, Shooting, Bird watching, Shopping, Cooking

Introduction: My name is Nicola Considine CPA, I am a determined, witty, powerful, brainy, open, smiling, proud person who loves writing and wants to share my knowledge and understanding with you.