How to make Ai?
Moderator: OpenTTD Developers
-
- Engineer
- Posts: 19
- Joined: 31 May 2019 21:26
How to make Ai?
I really like those ais.
But i wanna make the ai just like them.
IDK how to make those, Can you help me guys?
But i wanna make the ai just like them.
IDK how to make those, Can you help me guys?
Re: How to make Ai?
Long story short:
1. Learn the Squirrel programming language
2. Learn the OpenTTD AI API
3. Look at existing AIs and available AI libraries for examples and bases to start from
4. Write some code
1. Learn the Squirrel programming language
2. Learn the OpenTTD AI API
3. Look at existing AIs and available AI libraries for examples and bases to start from
4. Write some code
Re: How to make Ai?
The wiki has a few interesting pages for you:. Start with https://wiki.openttd.org/NoAI and https://wiki.openttd.org/AI:Introduction.
-
- Engineer
- Posts: 16
- Joined: 08 Apr 2020 13:23
Re: How to make Ai?
I would love to make one too. The problem is there is no one explaining how to install the squirrel. I do code but for some reason installing squirrel language is like walking in a labyrinth and there is no instruction anywhere. The only thing I found is how to install SQuirrel DataBase, bummer.
Re: How to make Ai?
You don't need to install Squirrel, everything required to run the AI is already built into OpenTTD. All you need is a text editor to write the code, and place the files in the right location.
-
- Engineer
- Posts: 16
- Joined: 08 Apr 2020 13:23
Re: How to make Ai?
Ooh that's great. So how do I debug then, you know, to check some spelling error, missing semicolon, etc?
And how do I type Squirrel language without autocomplete and libraries? I do code in C++ though
And how do I type Squirrel language without autocomplete and libraries? I do code in C++ though
Re: How to make Ai?
I believe there is Squirrel syntax highlighting available for most major text editors, e.g. VS Code and Notepad++ should have it. I don't know about any autocompletion tools.
You can run OpenTTD with debug logging enabled to get syntax errors printed when it tries to load a script.
You can run OpenTTD with debug logging enabled to get syntax errors printed when it tries to load a script.
Who is online
Users browsing this forum: No registered users and 0 guests