Costum AI's
Moderator: OpenTTD Developers
Costum AI's
hi
is there a way to create costum AI's of my own in OpenTTD?
havent seen a thing abput it, so sorry if it already exists(the topic).
is there a way to create costum AI's of my own in OpenTTD?
havent seen a thing abput it, so sorry if it already exists(the topic).
Re: Costum AI's
Please check our FAQ: http://wiki.openttd.org/NoAI_Forum_FAQ
It is linked to as a sticky in this forum.
It is linked to as a sticky in this forum.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: Costum AI's
i have read that, but it didnt answer my question...
Re: Costum AI's
What about question 1.6?
I think it answers your question, since to have your own custom AI, you have to write one.
If that is not what you mean with "create costum AI's of my own", then please explain what you do mean with that phrase?
I think it answers your question, since to have your own custom AI, you have to write one.
If that is not what you mean with "create costum AI's of my own", then please explain what you do mean with that phrase?
Re: Costum AI's
ok i'll try.
what i meant was - is there and add-on that makes it possible to edit /create an AI for the game? something like the scenario editor,maybe.
what i meant was - is there and add-on that makes it possible to edit /create an AI for the game? something like the scenario editor,maybe.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Costum AI's
Yes: any text editor of your choice. But I guess that doesn't really qualify as 'add-on'.
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Costum AI's
what do u mean by 'text editor'?
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Costum AI's
You are obviously missing the fact, that you must program the AI, its not like there is some nice graphical drag and drop editor. The AI is just a piece of program code.
Text editor is any program that can edit text - for example notepad or word.
Text editor is any program that can edit text - for example notepad or word.
Re: Costum AI's
I'm developing my AI using plain notepad... 
EDIT: corrected ugly grammar mistake

EDIT: corrected ugly grammar mistake
Last edited by Brumi on 15 Feb 2010 14:27, edited 1 time in total.
Re: Costum AI's
There is editors like eclipse or vim that can help you a little bit by completing words/code. Though it still comes down to the fact that you need to know programming fairly well (or be very motivated beginner programmer) in order to make an AI. The tools can't help you understand programming, just make programming a bit faster and more convenient.
To take an example, PAXLink is about 5 000 lines of code. Compared to OpenTTD that is not much, but it is still not something you write in an afternoon or two.
To take an example, PAXLink is about 5 000 lines of code. Compared to OpenTTD that is not much, but it is still not something you write in an afternoon or two.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
-
- Engineer
- Posts: 24
- Joined: 06 Feb 2010 22:12
Re: Costum AI's
Sorry to intrude, but does anyone knoe why my Eclipse doesn't complete any words and/or indent my code.Zuu wrote:There is editors like eclipse... that can help you a little bit by completing words/code.
Yes, i am using the squirrel plugin.
Thanks,
SummerBulb
Re: Costum AI's
SQDEV cant complete members from the NoAI API, or from object instances (since Squirrel is not stringly typed).SummerBulb wrote:Sorry to intrude, but does anyone knoe why my Eclipse doesn't complete any words and/or indent my code.Zuu wrote:There is editors like eclipse... that can help you a little bit by completing words/code.
Yes, i am using the squirrel plugin.
Thanks,
SummerBulb
The only way to have something autocompleted (Ctrl-Space) is if it is a static member of a class defined in your AI, from a static context.
Code: Select all
class Foo {
static memberA = "This is static"
memberB = null
function bar(b) {
this.memberB = b
}
}
local x = Foo()
x.<CTRL-SPACE> <-- Nothing happens
Foo.<CTRL-SPACE> <-- Autocomplete window shows [ memberA, bar() ]
PathZilla - A networking AI - Now with tram support.
-
- Engineer
- Posts: 24
- Joined: 06 Feb 2010 22:12
Re: Costum AI's
Wow, looks like you know it all.
Thanks.
Thanks.

Re: Costum AI's
Even with dynamically typed language, you can do static analysis to discover types and enable auto completion. What you said about static methods is true so you can use some trick to fool SQDev : create some file defining the AI* classes with their static methods and constants. SQDev believe the file is included in the project and then use it to autocomplete.Zutty wrote:SQDEV cant complete members from the NoAI API, or from object instances (since Squirrel is not stringly typed).
The only way to have something autocompleted (Ctrl-Space) is if it is a static member of a class defined in your AI, from a static context.
-
- Engineer
- Posts: 24
- Joined: 06 Feb 2010 22:12
Re: Costum AI's
That sounds great, but also sounds like A LOT of work.Blustuff wrote:Even with dynamically typed language, you can do static analysis to discover types and enable auto completion. What you said about static methods is true so you can use some trick to fool SQDev : create some file defining the AI* classes with their static methods and constants. SQDev believe the file is included in the project and then use it to autocomplete.Zutty wrote:SQDEV cant complete members from the NoAI API, or from object instances (since Squirrel is not stringly typed).
The only way to have something autocompleted (Ctrl-Space) is if it is a static member of a class defined in your AI, from a static context.
|wish|i wonder if i could find a file like that somewhere |endwish|

I just might go ahead and do that, in the end...
SummerBulb
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Costum AI's
If it is has done it yet, you can do it quite easily by copying the vertical lists from the doxygen html help. It still needs some manual cleaning, but it simplifies the work a lot.
Re: Costum AI's
I did it for some classes, I could upload it. There is still a lot of work to do to complete this file.
Who is online
Users browsing this forum: No registered users and 6 guests